summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-10-21 22:04:51 +0000
committerKim van der Riet <kpvdr@apache.org>2013-10-21 22:04:51 +0000
commit888581cb9781259073d190edede25e6253ec7dd9 (patch)
treeca719eb54a498aebb5c59c527b08178491e4ad4c
parent6d5d782b504677fcc4392086cb628dbbb79c800a (diff)
downloadqpid-python-888581cb9781259073d190edede25e6253ec7dd9.tar.gz
QPID-4984: WIP - Merge from trunk r.1534385.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/linearstore@1534394 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/bindings/qmf2/examples/python/agent.py4
-rw-r--r--qpid/cpp/bindings/qmf2/examples/python/find_agents.py4
-rw-r--r--qpid/cpp/bindings/qmf2/python/qmf2.py16
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/configure-windows.ps125
-rw-r--r--qpid/cpp/bld-winsdk.ps12
-rwxr-xr-xqpid/cpp/etc/qpidd.in3
-rw-r--r--qpid/cpp/examples/README.txt5
-rw-r--r--qpid/cpp/examples/examples.sln24
-rw-r--r--qpid/cpp/examples/messaging/hello_world.cpp9
-rw-r--r--qpid/cpp/examples/qmf-agent/example.cpp242
-rw-r--r--qpid/cpp/examples/qmf-agent/example_gen.mak29
-rw-r--r--qpid/cpp/examples/qmf-agent/qmf_agent.vcproj443
-rw-r--r--qpid/cpp/examples/qmf-agent/schema.xml75
-rw-r--r--qpid/cpp/include/qpid/messaging/Handle.h9
-rw-r--r--qpid/cpp/include/qpid/swig_perl_typemaps.i12
-rw-r--r--qpid/cpp/src/CMakeLists.txt35
-rw-r--r--qpid/cpp/src/amqp.cmake24
-rw-r--r--qpid/cpp/src/legacystore.cmake22
-rw-r--r--qpid/cpp/src/qpid/amqp/descriptors.h2
-rw-r--r--qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp5
-rw-r--r--qpid/cpp/src/qpid/amqp_0_10/Codecs.h1
-rw-r--r--qpid/cpp/src/qpid/broker/Broker.cpp10
-rw-r--r--qpid/cpp/src/qpid/broker/Exchange.cpp2
-rw-r--r--qpid/cpp/src/qpid/broker/Message.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/Message.h6
-rw-r--r--qpid/cpp/src/qpid/broker/Queue.cpp45
-rw-r--r--qpid/cpp/src/qpid/broker/Queue.h5
-rw-r--r--qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/QueueRegistry.cpp2
-rw-r--r--qpid/cpp/src/qpid/broker/QueueSettings.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/QueueSettings.h2
-rw-r--r--qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Message.cpp75
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Message.h2
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp101
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/NodeProperties.h8
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Outgoing.cpp27
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Session.cpp53
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Session.h2
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Topic.cpp15
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Topic.h2
-rw-r--r--qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp9
-rw-r--r--qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h1
-rw-r--r--qpid/cpp/src/qpid/client/QueueOptions.cpp11
-rw-r--r--qpid/cpp/src/qpid/client/QueueOptions.h12
-rw-r--r--qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp2
-rw-r--r--qpid/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp6
-rw-r--r--qpid/cpp/src/qpid/legacystore/jrnl/enq_rec.cpp6
-rw-r--r--qpid/cpp/src/qpid/legacystore/jrnl/txn_rec.cpp3
-rw-r--r--qpid/cpp/src/qpid/management/ManagementAgent.cpp20
-rw-r--r--qpid/cpp/src/qpid/messaging/Connection.cpp3
-rw-r--r--qpid/cpp/src/qpid/messaging/HandleInstantiator.cpp64
-rw-r--r--qpid/cpp/src/qpid/messaging/ProtocolRegistry.cpp4
-rw-r--r--qpid/cpp/src/qpid/messaging/Receiver.cpp3
-rw-r--r--qpid/cpp/src/qpid/messaging/Sender.cpp4
-rw-r--r--qpid/cpp/src/qpid/messaging/Session.cpp3
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp209
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp21
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h2
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp181
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp5
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h1
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ReceiverHandle.cpp2
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp108
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp17
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SessionContext.h1
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SessionHandle.cpp9
-rw-r--r--qpid/cpp/src/tests/MessageTest.cpp2
-rw-r--r--qpid/cpp/src/tests/MessagingSessionTests.cpp9
-rw-r--r--qpid/cpp/src/tests/QueueFlowLimitTest.cpp170
-rw-r--r--qpid/cpp/src/tests/QueueOptionsTest.cpp17
-rw-r--r--qpid/cpp/src/tests/QueuePolicyTest.cpp13
-rw-r--r--qpid/cpp/src/tests/assertions.py141
-rw-r--r--qpid/cpp/src/tests/brokertest.py1
-rwxr-xr-xqpid/cpp/src/tests/interlink_tests.py1
-rw-r--r--qpid/cpp/src/tests/legacystore/CMakeLists.txt123
-rw-r--r--qpid/cpp/src/tests/legacystore/OrderingTest.cpp17
-rw-r--r--qpid/cpp/src/tests/legacystore/SimpleTest.cpp35
-rw-r--r--qpid/cpp/src/tests/legacystore/TransactionalTest.cpp15
-rw-r--r--qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp15
-rw-r--r--qpid/cpp/src/tests/legacystore/federation/Makefile.am46
-rwxr-xr-xqpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh313
-rwxr-xr-xqpid/cpp/src/tests/legacystore/federation/run_federation_sys_tests96
-rwxr-xr-xqpid/cpp/src/tests/legacystore/federation/run_long_federation_sys_tests24
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_auto_expand.cpp140
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_basic.cpp558
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_basic_txn.cpp239
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_helper_fns.h882
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_read.cpp460
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_st_read_txn.cpp353
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_enq_map.cpp320
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp416
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_jerrno.cpp47
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_jexception.cpp346
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp402
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_lpmgr.cpp886
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp438
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp163
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp106
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/chk_jdata32
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl59
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/jhexdump41
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp207
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_init_params.cpp100
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp178
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp146
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp113
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp206
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result_agregation.cpp178
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp147
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv74
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/args.cpp226
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/args.h66
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.cpp87
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.h66
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/jtt/jfile_chk.py838
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.cpp77
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.h80
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.cpp439
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.h121
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv234
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp57
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp93
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h62
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp179
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h110
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp201
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h100
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp185
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h81
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp169
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h99
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp218
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h68
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/prof32
-rwxr-xr-xqpid/cpp/src/tests/legacystore/jrnl/run-journal-tests47
-rw-r--r--qpid/cpp/src/tests/legacystore/jrnl/tests.odsbin0 -> 91064 bytes
-rw-r--r--qpid/cpp/src/tests/legacystore/python_tests/__init__.py24
-rw-r--r--qpid/cpp/src/tests/legacystore/python_tests/client_persistence.py234
-rw-r--r--qpid/cpp/src/tests/legacystore/python_tests/resize.py167
-rw-r--r--qpid/cpp/src/tests/legacystore/python_tests/store_test.py416
-rwxr-xr-x[-rw-r--r--]qpid/cpp/src/tests/legacystore/run_python_tests40
-rw-r--r--qpid/cpp/src/tests/legacystore/run_test69
-rwxr-xr-xqpid/cpp/src/tests/ping_broker2
-rwxr-xr-xqpid/cpp/src/tests/qpid-cluster-benchmark2
-rw-r--r--qpid/cpp/src/tests/reject_release.py65
-rwxr-xr-xqpid/cpp/src/tests/swig_python_tests6
-rw-r--r--qpid/cpp/src/tests/test_env.sh.in1
-rw-r--r--qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml34
-rw-r--r--qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml1
-rw-r--r--qpid/doc/book/src/java-broker/Java-Broker-Concepts-Exchanges.xml210
-rw-r--r--qpid/doc/book/src/java-broker/commonEntities.xml2
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Direct.pngbin0 -> 36554 bytes
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Direct.svg23
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Fanout.pngbin0 -> 23348 bytes
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Fanout.svg23
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.pngbin0 -> 40952 bytes
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.svg23
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.pngbin0 -> 44744 bytes
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.svg23
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic.pngbin0 -> 26939 bytes
-rw-r--r--qpid/doc/book/src/java-broker/images/Exchange-Topic.svg23
-rw-r--r--qpid/extras/dispatch/CMakeLists.txt35
-rw-r--r--qpid/extras/dispatch/ChangeLog24
-rw-r--r--qpid/extras/dispatch/README.md12
-rw-r--r--qpid/extras/dispatch/TODO47
-rw-r--r--qpid/extras/dispatch/config.sh27
-rw-r--r--qpid/extras/dispatch/etc/qpid-dispatch.conf54
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch.h1
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/amqp.h18
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/bitmask.h37
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/buffer.h4
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/compose.h3
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/container.h13
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/hash.h25
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/message.h4
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/python_embedded.h7
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/router.h2
-rw-r--r--qpid/extras/dispatch/include/qpid/dispatch/server.h181
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/config/schema.py3
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/adapter.py99
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/binding.py133
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/configuration.py46
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/data.py444
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/link.py233
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/mobile.py307
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/neighbor.py98
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/node.py219
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/path.py359
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/router_engine.py485
-rw-r--r--qpid/extras/dispatch/python/qpid/dispatch/router/routing.py70
-rw-r--r--qpid/extras/dispatch/router/CMakeLists.txt2
-rw-r--r--qpid/extras/dispatch/router/src/main.c2
-rw-r--r--qpid/extras/dispatch/src/agent.c20
-rw-r--r--qpid/extras/dispatch/src/amqp.c30
-rw-r--r--qpid/extras/dispatch/src/bitmask.c124
-rw-r--r--qpid/extras/dispatch/src/buffer.c4
-rw-r--r--qpid/extras/dispatch/src/compose.c8
-rw-r--r--qpid/extras/dispatch/src/container.c73
-rw-r--r--qpid/extras/dispatch/src/dispatch.c32
-rw-r--r--qpid/extras/dispatch/src/hash.c124
-rw-r--r--qpid/extras/dispatch/src/message.c18
-rw-r--r--qpid/extras/dispatch/src/message_private.h2
-rw-r--r--qpid/extras/dispatch/src/python_embedded.c60
-rw-r--r--qpid/extras/dispatch/src/router_agent.c187
-rw-r--r--qpid/extras/dispatch/src/router_node.c1107
-rw-r--r--qpid/extras/dispatch/src/router_private.h177
-rw-r--r--qpid/extras/dispatch/src/router_pynode.c682
-rw-r--r--qpid/extras/dispatch/src/server.c71
-rw-r--r--qpid/extras/dispatch/src/server_private.h1
-rw-r--r--qpid/extras/dispatch/tests/compose_test.c100
-rw-r--r--qpid/extras/dispatch/tests/config-1/A.conf (renamed from qpid/extras/dispatch/tests/onerouter.conf)0
-rw-r--r--qpid/extras/dispatch/tests/config-2/A.conf60
-rw-r--r--qpid/extras/dispatch/tests/config-2/B.conf68
-rw-r--r--qpid/extras/dispatch/tests/config-3-linear/A.conf70
-rw-r--r--qpid/extras/dispatch/tests/config-3-linear/B.conf69
-rw-r--r--qpid/extras/dispatch/tests/config-3-linear/C.conf61
-rw-r--r--qpid/extras/dispatch/tests/config-3-linear/topology.txt12
-rw-r--r--qpid/extras/dispatch/tests/field_test.c4
-rw-r--r--qpid/extras/dispatch/tests/message_test.c18
-rw-r--r--qpid/extras/dispatch/tests/router_engine_test.py985
-rw-r--r--qpid/extras/dispatch/tests/system_tests_one_router.py79
-rw-r--r--qpid/extras/dispatch/tests/tool_test.c33
-rwxr-xr-xqpid/extras/dispatch/tools/src/py/qdstat328
-rw-r--r--qpid/extras/dispatch/tools/src/py/qdtoollibs/__init__.py21
-rw-r--r--qpid/extras/dispatch/tools/src/py/qdtoollibs/disp.py270
-rw-r--r--qpid/java/amqp-1-0-client-jms/pom.xml75
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/assembly/qpid-amqp-1-0-client-jms-bin.xml27
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/AmqpMessage.java64
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/BytesMessage.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Connection.java74
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ConnectionMetaData.java56
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Destination.java56
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/JavaSerializable.java48
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MapMessage.java74
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Message.java356
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageConsumer.java72
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageProducer.java54
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageRejectedException.java9
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ObjectMessage.java54
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Queue.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueBrowser.java60
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueConnection.java60
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueReceiver.java58
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSender.java58
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSession.java84
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Session.java150
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/StreamMessage.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryQueue.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryTopic.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TextMessage.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Topic.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicConnection.java60
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicPublisher.java52
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSession.java86
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSubscriber.java58
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java156
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/BytesMessageImpl.java1076
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java40
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java1099
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionMetaDataImpl.java210
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/DestinationImpl.java170
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MapMessageImpl.java888
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageConsumerImpl.java970
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageFactory.java382
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java2685
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java1010
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ObjectMessageImpl.java322
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueBrowserImpl.java417
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueConnectionImpl.java96
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueImpl.java112
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueReceiverImpl.java112
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java72
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSessionImpl.java114
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/SessionImpl.java1984
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/StreamMessageImpl.java932
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryQueueImpl.java214
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryTopicImpl.java224
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TextMessageImpl.java186
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicConnectionImpl.java96
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicImpl.java112
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java72
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSessionImpl.java112
-rw-r--r--qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSubscriberImpl.java266
-rw-r--r--qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Demo.java861
-rw-r--r--qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Request.java470
-rw-r--r--qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Send.java470
-rw-r--r--qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java6
-rw-r--r--qpid/java/amqp-1-0-client/pom.xml40
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java882
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ConnectionException.java5
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Message.java296
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java1230
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java949
-rw-r--r--qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java786
-rw-r--r--qpid/java/amqp-1-0-common/pom.xml31
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/StringTypeConstructor.java65
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/SymbolTypeConstructor.java6
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/ConnectionHandler.java6
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/FrameHandler.java2
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/SocketExceptionHandler.java31
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java75
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/LinkEndpoint.java12
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ReceivingLinkEndpoint.java2
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java1
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Source.java2
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java3
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java3
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java6
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java12
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java52
-rwxr-xr-xqpid/java/bdbstore/bin/backup.sh2
-rw-r--r--qpid/java/bdbstore/build.xml6
-rw-r--r--qpid/java/bdbstore/jmx/build.xml6
-rw-r--r--qpid/java/bdbstore/jmx/pom.xml78
-rw-r--r--qpid/java/bdbstore/pom.xml91
-rw-r--r--qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java193
-rw-r--r--qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java6
-rw-r--r--qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java501
-rw-r--r--qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java169
-rw-r--r--qpid/java/bdbstore/systests/build.xml28
-rw-r--r--qpid/java/bdbstore/systests/pom.xml198
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java193
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java (renamed from qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java)0
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java544
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java167
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java (renamed from qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java)0
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java (renamed from qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java)0
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java (renamed from qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java)0
-rw-r--r--qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java (renamed from qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java)0
-rw-r--r--qpid/java/broker-core/build-generate-sources.xml101
-rw-r--r--qpid/java/broker-core/build.xml33
-rw-r--r--qpid/java/broker-core/pom.xml278
-rwxr-xr-xqpid/java/broker-core/src/main/java/broker.bnd (renamed from qpid/java/broker/src/main/java/broker.bnd)0
-rw-r--r--qpid/java/broker-core/src/main/java/fallback-log4j.properties (renamed from qpid/java/broker/src/main/java/fallback-log4j.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java (renamed from qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/Broker.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/Binding.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/binding/Binding.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java207
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java133
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java48
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java54
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java102
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java725
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/Exchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/MessageFilter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogMessage.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogRecorder.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java128
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControl_logmessages.properties26
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java146
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java458
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java453
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java210
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java195
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java180
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java332
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java331
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java254
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java190
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java368
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java220
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/InboundMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/InboundMessage.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageContentSource.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageContentSource.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageReference.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageReference.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/message/ServerMessage.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Attribute.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Attribute.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Binding.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Connection.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Consumer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Event.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Event.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/EventType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/EventType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Exchange.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Group.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Group.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupMember.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupMember.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/KeyStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java124
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Plugin.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Plugin.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Port.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java89
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Protocol.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Protocol.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Publisher.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Publisher.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Queue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Session.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Session.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/State.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/State.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Statistics.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Statistics.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Transport.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/Transport.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/TrustStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/User.java65
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java826
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java107
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java1266
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java444
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java632
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java1255
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java61
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/Pluggable.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/Pluggable.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java75
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkModel.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkModel.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/BaseQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/BaseQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/Filterable.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueContext.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueContext.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRunner.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRunner.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueue.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueue.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AccessControl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/AccessControl.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/Result.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/Result.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/SecurityManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectType.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectType.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Operation.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Operation.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Permission.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java75
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java60
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java71
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java60
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java405
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java114
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties24
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/AbstractLDAPSSLSocketFactory.java117
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGenerator.java298
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DependencyListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DependencyListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Event.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/Event.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/HAMessageStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/HAMessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullMessageStore.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullMessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullUpgrader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullUpgrader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/State.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/State.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StateManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StateManager.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreContext.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreFuture.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreFuture.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMessage.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMessage.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Transaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/Transaction.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLog.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLog.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/Subscription.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxBranch.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxBranch.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapValueConverter.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java75
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/State.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/State.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java)0
-rwxr-xr-xqpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java)0
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/tools/security/Passwd.java (renamed from qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory (renamed from qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory)0
-rw-r--r--qpid/java/broker-core/src/main/resources/initial-config.json68
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/SelectorParserTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java292
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java140
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java392
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java115
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java437
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java268
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java133
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java170
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java155
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java301
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java560
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java115
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java111
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java106
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGeneratorTest.java88
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/EventManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/EventManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java183
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/StateManagerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/StateManagerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaData.java72
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataFactory.java51
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java151
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockAction.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockAction.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/StringUtilTest.java67
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/java/org/apache/qpid/tools/security/PasswdTest.java (renamed from qpid/java/broker/src/test/java/org/apache/qpid/tools/security/PasswdTest.java)0
-rw-r--r--qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageMetaDataType19
-rw-r--r--qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory (renamed from qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory)0
-rw-r--r--qpid/java/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java (renamed from qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java)0
-rw-r--r--qpid/java/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm186
-rw-r--r--qpid/java/broker-core/src/xsl/qmf.xsl (renamed from qpid/java/broker/src/xsl/qmf.xsl)0
-rw-r--r--qpid/java/broker-plugins/access-control/build.xml8
-rw-r--r--qpid/java/broker-plugins/access-control/pom.xml75
-rw-r--r--qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java2
-rw-r--r--qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/logging/AccessControl_logmessages.properties28
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/pom.xml57
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/pom.xml57
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java127
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/pom.xml48
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java56
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java2
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/pom.xml69
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/pom.xml62
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/build.xml6
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/pom.xml69
-rw-r--r--qpid/java/broker-plugins/derby-store/build.xml6
-rw-r--r--qpid/java/broker-plugins/derby-store/pom.xml64
-rw-r--r--qpid/java/broker-plugins/jdbc-provider-bone/build.xml4
-rw-r--r--qpid/java/broker-plugins/jdbc-provider-bone/pom.xml63
-rw-r--r--qpid/java/broker-plugins/jdbc-store/build.xml6
-rw-r--r--qpid/java/broker-plugins/jdbc-store/pom.xml64
-rw-r--r--qpid/java/broker-plugins/management-http/build.xml37
-rw-r--r--qpid/java/broker-plugins/management-http/pom.xml204
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/DojoHelper.java116
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java17
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/log/LogFileHelper.java41
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/FileServlet.java27
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/LogFileServlet.java14
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java10
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java4
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogFileListingServlet.java9
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LoggedOnUserPreferencesServlet.java138
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageContentServlet.java18
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java18
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/PreferencesServlet.java137
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java18
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/UserPreferencesServlet.java94
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListTimeZones.java117
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html6
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html20
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html2
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/common/TimeZoneSelector.html67
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/index.html52
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js18
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/sasl.js15
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js73
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/TimeZoneSelector.js107
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilter.js11
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilterTools.js44
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js71
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js95
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js34
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js17
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Preferences.js236
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js189
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js21
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/UserPreferences.js252
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js39
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js116
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js25
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogFileDownloadDialog.js9
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogViewer.js71
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js7
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/logs/showLogViewer.html2
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showExchange.html55
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferences.html22
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html41
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showQueue.html171
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html135
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/resources-maven/dojoconfig.properties5
-rw-r--r--qpid/java/broker-plugins/management-jmx/build.xml6
-rw-r--r--qpid/java/broker-plugins/management-jmx/pom.xml56
-rw-r--r--qpid/java/broker-plugins/memory-store/build.xml6
-rw-r--r--qpid/java/broker-plugins/memory-store/pom.xml41
-rwxr-xr-xqpid/java/broker/bin/qpid-passwd4
-rwxr-xr-xqpid/java/broker/bin/qpid-server4
-rwxr-xr-x[-rw-r--r--]qpid/java/broker/bin/qpid-server.bat4
-rw-r--r--qpid/java/broker/build.xml16
-rw-r--r--qpid/java/broker/pom.xml198
-rw-r--r--[-rwxr-xr-x]qpid/java/broker/python-test.xml0
-rw-r--r--qpid/java/broker/src/main/assembly/qpid-broker-bin.xml48
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java207
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java136
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java41
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java44
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java86
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java709
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/Model.java124
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java89
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/User.java65
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java826
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java111
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java1267
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java444
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java592
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PreferencesProviderCreator.java66
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java1273
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java58
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java12
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java74
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java59
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java70
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java59
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java317
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java94
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties23
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/util/StringUtil.java44
-rw-r--r--qpid/java/broker/src/main/resources/initial-config.json68
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java291
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java143
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java394
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java96
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java391
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java236
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java127
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java147
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java156
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java266
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java560
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java111
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java107
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java48
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java191
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/util/StringUtilTest.java58
-rw-r--r--qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm189
-rw-r--r--qpid/java/build.deps18
-rw-r--r--qpid/java/build.xml4
-rw-r--r--qpid/java/client/build.xml2
-rw-r--r--qpid/java/client/pom.xml114
-rw-r--r--qpid/java/client/src/main/assembly/qpid-client-bin.xml27
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java2
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java7
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java36
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java9
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java17
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java2
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java4
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/message/QpidMessageProperties.java1
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/QpidQueueOptions.java7
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java13
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/client/AMQSession_0_8Test.java2
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10Test.java2
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java2
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/client/transport/MockSender.java49
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/client/transport/TestNetworkConnection.java163
-rw-r--r--qpid/java/common.xml10
-rw-r--r--qpid/java/common/Composite.tpl8
-rw-r--r--qpid/java/common/Constant.tpl8
-rw-r--r--qpid/java/common/Enum.tpl8
-rw-r--r--qpid/java/common/Invoker.tpl8
-rw-r--r--qpid/java/common/MethodDelegate.tpl8
-rw-r--r--qpid/java/common/Option.tpl8
-rw-r--r--qpid/java/common/StructFactory.tpl8
-rw-r--r--qpid/java/common/Type.tpl8
-rwxr-xr-xqpid/java/common/bin/qpid-jaddr4
-rw-r--r--qpid/java/common/build-generate-sources.xml115
-rw-r--r--qpid/java/common/build.xml94
-rw-r--r--qpid/java/common/pom.xml154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java7
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java208
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java1224
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserTokenManager.java1066
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SimpleCharStream.java492
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/Token.java152
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/filter/selector/TokenMgrError.java168
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java46
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java108
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java35
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPingBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPongBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelResumeBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java66
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java52
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileAckBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeBody.java49
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileDeliverBody.java46
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FilePublishBody.java46
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileRejectBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileReturnBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/FileStageBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageAppendBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCancelBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCheckpointBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCloseBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageConsumeBody.java48
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageEmptyBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageGetBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOffsetBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOpenBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageQosBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRecoverBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRejectBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageResumeBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MessageTransferBody.java78
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MethodDispatcher.java35
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java358
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolVersion.java188
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java46
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java67
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeBody.java47
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamDeliverBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamPublishBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/StreamReturnBody.java42
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerBody.java44
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringOkBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableBody.java40
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableOkBody.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TunnelRequestBody.java36
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java34
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicAckBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicDeliverBodyImpl.java168
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetEmptyBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetOkBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicPublishBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRejectBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowOkBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPingBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPongBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelResumeBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ClientMethodDispatcher_0_9.java97
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenBodyImpl.java142
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartBodyImpl.java162
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartOkBodyImpl.java151
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneOkBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundBodyImpl.java138
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundOkBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareBodyImpl.java220
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteBodyImpl.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileAckBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileDeliverBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FilePublishBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileRejectBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileStageBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageAppendBodyImpl.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCancelBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCheckpointBodyImpl.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCloseBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageConsumeBodyImpl.java194
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageEmptyBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageGetBodyImpl.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOffsetBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOpenBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRecoverBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRejectBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageResumeBodyImpl.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageTransferBodyImpl.java384
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodDispatcher_0_9.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java1591
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareOkBodyImpl.java136
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java163
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ServerMethodDispatcher_0_9.java105
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeBodyImpl.java194
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamDeliverBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamPublishBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosBodyImpl.java152
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TunnelRequestBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicAckBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicDeliverBodyImpl.java168
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetEmptyBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetOkBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicPublishBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRejectBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowOkBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ClientMethodDispatcher_0_91.java67
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenBodyImpl.java142
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartBodyImpl.java162
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartOkBodyImpl.java151
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneOkBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundBodyImpl.java138
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundOkBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareBodyImpl.java220
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteBodyImpl.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodDispatcher_0_91.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java877
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareOkBodyImpl.java136
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java163
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ServerMethodDispatcher_0_91.java69
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicAckBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicDeliverBodyImpl.java168
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetEmptyBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetOkBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicPublishBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRejectBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java137
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowOkBodyImpl.java116
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java92
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenBodyImpl.java142
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java125
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartBodyImpl.java162
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartOkBodyImpl.java151
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneOkBodyImpl.java135
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundBodyImpl.java138
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundOkBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareBodyImpl.java220
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteBodyImpl.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileAckBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeBodyImpl.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileDeliverBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FilePublishBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosBodyImpl.java140
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileRejectBodyImpl.java128
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileStageBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodDispatcher_8_0.java38
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java1407
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindBodyImpl.java181
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareBodyImpl.java207
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareOkBodyImpl.java136
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeBodyImpl.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ServerMethodDispatcher_8_0.java92
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelBodyImpl.java129
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeBodyImpl.java180
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamDeliverBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamPublishBodyImpl.java167
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosBodyImpl.java152
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamReturnBodyImpl.java150
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerBodyImpl.java159
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerOkBodyImpl.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringBodyImpl.java137
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringOkBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableBodyImpl.java136
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableOkBodyImpl.java124
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TunnelRequestBodyImpl.java112
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectOkBodyImpl.java100
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Acquired.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionClose.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseCode.java54
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseOk.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionHeartbeat.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionInvoker.java78
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpen.java235
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpenOk.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionRedirect.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecure.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecureOk.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStart.java238
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStartOk.java280
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTune.java272
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java232
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java29
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java593
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java232
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java194
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java232
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java62
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java280
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java280
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBoundResult.java301
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDeclare.java397
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDelete.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQuery.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQueryResult.java268
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeUnbind.java238
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionErrorCode.java72
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionException.java398
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionResult.java194
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionSync.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/FileReturnCode.java52
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/FragmentProperties.java224
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/GetTimeoutResult.java139
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAccept.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcceptMode.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquire.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquireMode.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCancel.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCreditUnit.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryMode.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryPriority.java66
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlow.java236
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlowMode.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlush.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageProperties.java475
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageReject.java238
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRejectCode.java52
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRelease.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResume.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResumeResult.java139
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSetFlowMode.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageStop.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSubscribe.java443
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MessageTransfer.java302
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java217
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java60
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java394
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java232
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java429
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java200
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java54
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java138
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java192
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java193
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java56
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java196
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java229
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java145
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java236
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java154
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java152
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java152
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java52
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java200
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java50
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java111
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java148
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java141
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/transport/Xid.java223
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java105
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java3
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java284
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestFileUtils.java153
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/transport/MockSender.java47
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java161
-rw-r--r--qpid/java/common/templates/method/MethodBodyInterface.vm18
-rw-r--r--qpid/java/common/templates/method/version/MethodBodyClass.vm84
-rw-r--r--qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm9
-rw-r--r--qpid/java/common/templates/model/MethodDispatcherInterface.vm72
-rw-r--r--qpid/java/common/templates/model/MethodRegistryClass.vm27
-rw-r--r--qpid/java/common/templates/model/ProtocolVersionListClass.vm86
-rw-r--r--qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm9
-rw-r--r--qpid/java/common/templates/model/version/AmqpConstantsClass.vm37
-rw-r--r--qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm7
-rw-r--r--qpid/java/common/templates/model/version/MethodDispatcherInterface.vm10
-rw-r--r--qpid/java/common/templates/model/version/MethodRegistryClass.vm69
-rw-r--r--qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm6
-rwxr-xr-xqpid/java/genpom5
-rw-r--r--qpid/java/ivy.retrieve.xml7
-rw-r--r--qpid/java/jca/pom.xml112
-rw-r--r--qpid/java/jca/rar/pom.xml92
-rw-r--r--qpid/java/lib/poms/bcel-5.2.xml22
-rw-r--r--qpid/java/lib/poms/dojo-1.9.1.xml23
-rw-r--r--qpid/java/lib/poms/je-5.0.84.xml22
-rw-r--r--qpid/java/lib/poms/je-5.0.97.xml22
-rw-r--r--qpid/java/management/common/pom.xml35
-rw-r--r--qpid/java/management/example/pom.xml51
-rw-r--r--qpid/java/module.xml109
-rw-r--r--qpid/java/perftests/build.xml2
-rw-r--r--qpid/java/perftests/pom.xml284
-rw-r--r--qpid/java/perftests/src/main/assembly/qpid-perftests-bin.xml33
-rw-r--r--qpid/java/perftests/visualisation-jfc/pom.xml112
-rw-r--r--qpid/java/pom.xml566
-rw-r--r--qpid/java/qpid-test-utils/build.xml26
-rw-r--r--qpid/java/qpid-test-utils/pom.xml54
-rw-r--r--qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/PortHelper.java (renamed from qpid/java/common/src/test/java/org/apache/qpid/test/utils/PortHelper.java)0
-rw-r--r--qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java299
-rw-r--r--qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestFileUtils.java238
-rw-r--r--qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestSSLConstants.java (renamed from qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestSSLConstants.java)0
-rw-r--r--qpid/java/systests/build.xml2
-rw-r--r--qpid/java/systests/pom.xml338
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java97
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java16
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java29
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java2
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/LogViewerTest.java4
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java11
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java4
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/client/CloseOnNoRouteForMandatoryMessageTest.java18
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java115
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java8
-rwxr-xr-xqpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java32
-rw-r--r--qpid/java/tools/pom.xml64
-rw-r--r--qpid/python/qpid/messaging/driver.py14
-rw-r--r--qpid/python/qpid/messaging/endpoints.py11
-rw-r--r--qpid/python/qpid/tests/messaging/implementation.py10
-rw-r--r--qpid/tests/src/py/qpid_tests/broker_0_10/stats.py90
-rw-r--r--qpid/tests/src/py/qpid_tests/broker_0_10/threshold.py9
-rw-r--r--qpid/tools/src/java/bin/qpid-web/web/qmf-ui/scripts/qmf-ui.js11
-rw-r--r--qpid/tools/src/java/bin/qpid-web/web/ui/qmf.html6
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionAudit.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionLogger.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java28
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidCtrl.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidPrintEvents.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidQueueStats.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QueueFuse.java4
-rw-r--r--qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/util/GetOpt.java2
-rwxr-xr-xqpid/tools/src/py/qmf-tool4
-rwxr-xr-xqpid/tools/src/py/qpid-config16
-rwxr-xr-xqpid/tools/src/py/qpid-ha2
-rwxr-xr-xqpid/tools/src/py/qpid-printevents2
-rwxr-xr-xqpid/tools/src/py/qpid-queue-stats2
-rwxr-xr-xqpid/tools/src/py/qpid-route2
-rwxr-xr-xqpid/tools/src/py/qpid-stat2
-rwxr-xr-xqpid/tools/src/py/qpid-store-chk332
-rwxr-xr-xqpid/tools/src/py/qpid-store-resize350
-rwxr-xr-xqpid/tools/src/py/qpid-tool2
-rw-r--r--qpid/tools/src/py/qpidstore/__init__.py19
-rw-r--r--qpid/tools/src/py/qpidstore/janal.py608
-rw-r--r--qpid/tools/src/py/qpidstore/jerr.py219
-rw-r--r--qpid/tools/src/py/qpidstore/jrnl.py794
1676 files changed, 121579 insertions, 28712 deletions
diff --git a/qpid/cpp/bindings/qmf2/examples/python/agent.py b/qpid/cpp/bindings/qmf2/examples/python/agent.py
index b24890f531..a9f1a14349 100755
--- a/qpid/cpp/bindings/qmf2/examples/python/agent.py
+++ b/qpid/cpp/bindings/qmf2/examples/python/agent.py
@@ -19,7 +19,7 @@
# under the License.
#
-import cqpid
+import qpid_messaging
from qmf2 import *
@@ -34,7 +34,7 @@ class ExampleAgent(AgentHandler):
##
## Create and open a messaging connection to a broker.
##
- self.connection = cqpid.Connection(url, "{reconnect:True}")
+ self.connection = qpid_messaging.Connection(url, "{reconnect:True}")
self.session = None
self.connection.open()
diff --git a/qpid/cpp/bindings/qmf2/examples/python/find_agents.py b/qpid/cpp/bindings/qmf2/examples/python/find_agents.py
index 5fd71b3f1c..852f23f747 100644
--- a/qpid/cpp/bindings/qmf2/examples/python/find_agents.py
+++ b/qpid/cpp/bindings/qmf2/examples/python/find_agents.py
@@ -17,7 +17,7 @@
# under the License.
#
-import cqpid
+import qpid_messaging
import qmf2
class FindAgents(qmf2.ConsoleHandler):
@@ -45,7 +45,7 @@ class FindAgents(qmf2.ConsoleHandler):
url = "localhost"
options = ""
-connection = cqpid.Connection(url, options)
+connection = qpid_messaging.Connection(url, options)
connection.open()
session = qmf2.ConsoleSession(connection)
diff --git a/qpid/cpp/bindings/qmf2/python/qmf2.py b/qpid/cpp/bindings/qmf2/python/qmf2.py
index 9f2d8556f4..1d35b93601 100644
--- a/qpid/cpp/bindings/qmf2/python/qmf2.py
+++ b/qpid/cpp/bindings/qmf2/python/qmf2.py
@@ -18,7 +18,7 @@
#
import cqmf2
-import cqpid
+import qpid_messaging
from threading import Thread
import time
@@ -124,7 +124,7 @@ class AgentHandler(Thread):
def run(self):
event = cqmf2.AgentEvent()
while self.__running:
- valid = self.__agent._impl.nextEvent(event, cqpid.Duration.SECOND)
+ valid = self.__agent._impl.nextEvent(event, qpid_messaging.Duration.SECOND)
if valid and self.__running:
if event.getType() == cqmf2.AGENT_METHOD:
self.method(event, event.getMethodName(), event.getArguments(), event.getArgumentSubtypes(),
@@ -156,7 +156,7 @@ class ConsoleHandler(Thread):
def run(self):
event = cqmf2.ConsoleEvent()
while self.__running:
- valid = self.__session._impl.nextEvent(event, cqpid.Duration.SECOND)
+ valid = self.__session._impl.nextEvent(event, qpid_messaging.Duration.SECOND)
if valid and self.__running:
if event.getType() == cqmf2.CONSOLE_AGENT_ADD:
self.agentAdded(Agent(event.getAgent()))
@@ -434,7 +434,7 @@ class Agent(object):
q_arg = q._impl
else:
q_arg = q
- dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ dur = qpid_messaging.Duration(qpid_messaging.Duration.SECOND.getMilliseconds() * timeout)
result = self._impl.query(q_arg, dur)
if result.getType() == cqmf2.CONSOLE_EXCEPTION:
raise Exception(Data(result.getData(0)))
@@ -449,7 +449,7 @@ class Agent(object):
def loadSchemaInfo(self, timeout=30):
"""
"""
- dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ dur = qpid_messaging.Duration(qpid_messaging.Duration.SECOND.getMilliseconds() * timeout)
self._impl.querySchema(dur)
def getPackages(self):
@@ -473,7 +473,7 @@ class Agent(object):
def getSchema(self, schemaId, timeout=30):
"""
"""
- dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ dur = qpid_messaging.Duration(qpid_messaging.Duration.SECOND.getMilliseconds() * timeout)
return Schema(self._impl.getSchema(schemaId._impl, dur))
## TODO: Async query
@@ -555,7 +555,7 @@ class Data(object):
return Agent(self._impl.getAgent())
def update(self, timeout=5):
- dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ dur = qpid_messaging.Duration(qpid_messaging.Duration.SECOND.getMilliseconds() * timeout)
agent = self._impl.getAgent()
query = cqmf2.Query(self._impl.getAddr())
result = agent.query(query, dur)
@@ -590,7 +590,7 @@ class Data(object):
timeout = 30
if '_timeout' in kwargs:
timeout = kwargs['_timeout']
- dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ dur = qpid_messaging.Duration(qpid_messaging.Duration.SECOND.getMilliseconds() * timeout)
##
## Get the list of arguments from the schema, isolate those that are IN or IN_OUT,
diff --git a/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 b/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
index 60b2b539bd..5ee3a8ee46 100644
--- a/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
+++ b/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
@@ -153,6 +153,8 @@ $global:vsVersion = ''
$global:cmakeGenerator = ''
$global:vsSubdir = ''
$global:cmakeCompiler = ''
+$global:cmakeCommandLine32 = ''
+$global:cmakeCommandLine64 = ''
#############################
# Select-Folder
@@ -325,7 +327,8 @@ function WriteDotnetBindingEnvSetupBat
[string] $nBits,
[string] $outfileName,
[string] $studioVersion,
- [string] $studioSubdir
+ [string] $studioSubdir,
+ [string] $cmakeLine
)
$out = @("@ECHO OFF
@@ -337,6 +340,8 @@ REM
REM > call $outfileName
REM >
REM
+REM The solution was generated with cmake command line:
+REM $cmakeLine
ECHO %PATH% | FINDSTR /I boost > NUL
IF %ERRORLEVEL% EQU 0 ECHO WARNING: Boost is defined in your path multiple times!
SET PATH=$boostRoot\lib;%PATH%
@@ -387,7 +392,7 @@ function SelectVisualStudioVersion {
$Form.width = 350
$Form.height = 150
- $Form.Text = ”Select Visual Studio Version”
+ $Form.Text = "Select Visual Studio Version"
$DropDown = new-object System.Windows.Forms.ComboBox
$DropDown.Location = new-object System.Drawing.Size(120,10)
@@ -502,10 +507,11 @@ if ($defined64) {
# 32-bit X86
#
if ($make32) {
- $env:BOOST_ROOT = "$boost32"
cd "$build32"
Write-Host "Running 32-bit CMake in $build32 ..."
- CMake -G "$global:cmakeGenerator" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x86" "-DBoost_COMPILER=$global:cmakeCompiler" $cppDir
+ $global:cmakeCommandLine32 = "CMake -G ""$global:cmakeGenerator"" ""-DGEN_DOXYGEN=No"" ""-DCMAKE_INSTALL_PREFIX=install_x86"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost32"" $cppDir"
+ Write-Host "$global:cmakeCommadLine32"
+ CMake -G "$global:cmakeGenerator" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x86" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost32" $cppDir
} else {
Write-Host "Skipped 32-bit CMake."
}
@@ -514,10 +520,11 @@ if ($make32) {
# 64-bit X64
#
if ($make64) {
- $env:BOOST_ROOT = "$boost64"
cd "$build64"
Write-Host "Running 64-bit CMake in $build64"
- CMake -G "$global:cmakeGenerator Win64" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x64" "-DBoost_COMPILER=$global:cmakeCompiler" $cppDir
+ $global:cmakeCommandLine64 = "CMake -G ""$global:cmakeGenerator Win64"" ""-DGEN_DOXYGEN=No"" ""-DCMAKE_INSTALL_PREFIX=install_x64"" ""-DBoost_COMPILER=$global:cmakeCompiler"" ""-DBOOST_ROOT=$boost64"" $cppDir"
+ Write-Host "$global:cmakeCommadLine64"
+ CMake -G "$global:cmakeGenerator Win64" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x64" "-DBoost_COMPILER=$global:cmakeCompiler" "-DBOOST_ROOT=$boost64" $cppDir
} else {
Write-Host "Skipped 64-bit CMake."
}
@@ -569,7 +576,8 @@ if ($defined32) {
-nBits "32" `
-outfileName "setenv-messaging-$global:vsSubdir-x86-32bit.bat" `
-studioVersion "$global:vsVersion" `
- -studioSubdir "$global:vsSubdir"
+ -studioSubdir "$global:vsSubdir" `
+ -cmakeLine "$global:cmakeCommandLine32"
} else {
Write-Host "Skipped writing 32-bit scripts."
@@ -620,7 +628,8 @@ if ($defined64) {
-nBits "64" `
-outfileName "setenv-messaging-$global:vsSubdir-x64-64bit.bat" `
-studioVersion "$global:vsVersion" `
- -studioSubdir "$global:vsSubdir"
+ -studioSubdir "$global:vsSubdir" `
+ -cmakeLine "$global:cmakeCommandLine64"
} else {
Write-Host "Skipped writing 64-bit scripts."
diff --git a/qpid/cpp/bld-winsdk.ps1 b/qpid/cpp/bld-winsdk.ps1
index 42e6e636a4..671123c17f 100644
--- a/qpid/cpp/bld-winsdk.ps1
+++ b/qpid/cpp/bld-winsdk.ps1
@@ -356,7 +356,7 @@ if ($args.length -lt 3) {
exit
}
-$qpid_src = "qpid"
+$qpid_src = Split-Path -leaf $global:sourceDirectory
$boostRoot = $args[0]
$ver = $args[1]
$generator = ""
diff --git a/qpid/cpp/etc/qpidd.in b/qpid/cpp/etc/qpidd.in
index b53ea40a1f..91448add02 100755
--- a/qpid/cpp/etc/qpidd.in
+++ b/qpid/cpp/etc/qpidd.in
@@ -63,8 +63,9 @@ if [ $RETVAL = 4 ]; then
fi
start() {
+ [[ $QPID_DATA_DIR ]] || QPID_DATA_DIR=/var/lib/qpidd
echo -n $"Starting Qpid AMQP daemon: "
- daemon --pidfile $pidfile --check $prog --user qpidd @sbindir@/$prog ${QPID_DATA_DIR:+--data-dir $QPID_DATA_DIR} --daemon $QPIDD_OPTIONS
+ daemon --pidfile $pidfile --check $prog --user qpidd @sbindir@/$prog --data-dir $QPID_DATA_DIR --daemon $QPIDD_OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
diff --git a/qpid/cpp/examples/README.txt b/qpid/cpp/examples/README.txt
index 494dab7cd9..74de2788c3 100644
--- a/qpid/cpp/examples/README.txt
+++ b/qpid/cpp/examples/README.txt
@@ -221,9 +221,4 @@ On Windows:
C:\Program Files\qpidc-0.7\examples\request-response> server
C:\Program Files\qpidc-0.7\examples\request-response> client
-== qmf-console ==
-
-This directory contains examples which demonstrate integration with
-the Qpid Management Framework (QMF). Refer to the README.txt file
-within the directory for more information.
diff --git a/qpid/cpp/examples/examples.sln b/qpid/cpp/examples/examples.sln
index 6f96105d97..8511fe3cce 100644
--- a/qpid/cpp/examples/examples.sln
+++ b/qpid/cpp/examples/examples.sln
@@ -32,14 +32,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "messaging_drain", "messagin
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "messaging_spout", "messaging\messaging_spout.vcproj", "{D3115AC9-91C4-4D79-BCAC-DE837C70F1EA}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qmf_console_console", "qmf-console\qmf-console_console.vcproj", "{490473E1-FECA-1BAD-2E13-3FFA2B8669C3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qmf_console_ping", "qmf-console\qmf-console_ping.vcproj", "{C1FFDE95-3442-49AE-9985-7EEE3D45B4A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qmf_console_printevents", "qmf-console\qmf-console_printevents.vcproj", "{72C74624-FECA-1BAD-2E13-3FFA2B8669C3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qmf_console_queuestats", "qmf-console\qmf-console_queuestats.vcproj", "{B21825EA-FECA-1BAD-2E13-3FFA2B8669C3}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -96,22 +88,6 @@ Global
{D3115AC9-91C4-4D79-BCAC-DE837C70F1EA}.Release|Win32.Build.0 = Release|Win32
{D3115AC9-91C4-4D79-BCAC-DE837C70F1EA}.Release|x64.ActiveCfg = Release|x64
{D3115AC9-91C4-4D79-BCAC-DE837C70F1EA}.Release|x64.Build.0 = Release|x64
- {490473E1-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.ActiveCfg = Debug|Win32
- {490473E1-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.Build.0 = Debug|Win32
- {490473E1-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.ActiveCfg = Release|Win32
- {490473E1-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.Build.0 = Release|Win32
- {C1FFDE95-3442-49AE-9985-7EEE3D45B4A3}.Debug|Win32.ActiveCfg = Debug|Win32
- {C1FFDE95-3442-49AE-9985-7EEE3D45B4A3}.Debug|Win32.Build.0 = Debug|Win32
- {C1FFDE95-3442-49AE-9985-7EEE3D45B4A3}.Release|Win32.ActiveCfg = Release|Win32
- {C1FFDE95-3442-49AE-9985-7EEE3D45B4A3}.Release|Win32.Build.0 = Release|Win32
- {72C74624-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.ActiveCfg = Debug|Win32
- {72C74624-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.Build.0 = Debug|Win32
- {72C74624-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.ActiveCfg = Release|Win32
- {72C74624-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.Build.0 = Release|Win32
- {B21825EA-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.ActiveCfg = Debug|Win32
- {B21825EA-FECA-1BAD-2E13-3FFA2B8669C3}.Debug|Win32.Build.0 = Debug|Win32
- {B21825EA-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.ActiveCfg = Release|Win32
- {B21825EA-FECA-1BAD-2E13-3FFA2B8669C3}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/qpid/cpp/examples/messaging/hello_world.cpp b/qpid/cpp/examples/messaging/hello_world.cpp
index 86342b3c47..a868a64b5e 100644
--- a/qpid/cpp/examples/messaging/hello_world.cpp
+++ b/qpid/cpp/examples/messaging/hello_world.cpp
@@ -33,9 +33,9 @@ int main(int argc, char** argv) {
std::string broker = argc > 1 ? argv[1] : "localhost:5672";
std::string address = argc > 2 ? argv[2] : "amq.topic";
std::string connectionOptions = argc > 3 ? argv[3] : "";
-
- Connection connection(broker, connectionOptions);
+
try {
+ Connection connection(broker, connectionOptions);
connection.open();
Session session = connection.createSession();
@@ -47,12 +47,11 @@ int main(int argc, char** argv) {
Message message = receiver.fetch(Duration::SECOND * 1);
std::cout << message.getContent() << std::endl;
session.acknowledge();
-
+
connection.close();
return 0;
} catch(const std::exception& error) {
std::cerr << error.what() << std::endl;
- connection.close();
- return 1;
+ return 1;
}
}
diff --git a/qpid/cpp/examples/qmf-agent/example.cpp b/qpid/cpp/examples/qmf-agent/example.cpp
deleted file mode 100644
index f9be4f0164..0000000000
--- a/qpid/cpp/examples/qmf-agent/example.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- *
- * 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/management/Manageable.h>
-#include <qpid/management/ManagementObject.h>
-#include <qpid/agent/ManagementAgent.h>
-#include <qpid/sys/Mutex.h>
-#include <qpid/sys/Time.h>
-#include <qpid/log/Statement.h>
-#include "qpid/types/Variant.h"
-#include "qmf/org/apache/qpid/agent/example/Parent.h"
-#include "qmf/org/apache/qpid/agent/example/Child.h"
-#include "qmf/org/apache/qpid/agent/example/ArgsParentCreate_child.h"
-#include "qmf/org/apache/qpid/agent/example/ArgsParentTest_method.h"
-#include "qmf/org/apache/qpid/agent/example/EventChildCreated.h"
-#include "qmf/org/apache/qpid/agent/example/Package.h"
-
-#include <signal.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-static bool running = true;
-
-using namespace std;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-using qpid::sys::Mutex;
-using qpid::types::Variant;
-namespace _qmf = qmf::org::apache::qpid::agent::example;
-
-class ChildClass;
-
-//==============================================================
-// CoreClass is the operational class that corresponds to the
-// "Parent" class in the management schema.
-//==============================================================
-class CoreClass : public Manageable
-{
- string name;
- ManagementAgent* agent;
- _qmf::Parent* mgmtObject;
- std::vector<ChildClass*> children;
- Mutex vectorLock;
-
-public:
-
- CoreClass(ManagementAgent* agent, string _name);
- ~CoreClass() { mgmtObject->resourceDestroy(); }
-
- ManagementObject* GetManagementObject(void) const
- { return mgmtObject; }
-
- void doLoop();
- bool AuthorizeMethod(uint32_t methodId, Args& args, const string& userId);
- status_t ManagementMethod(uint32_t methodId, Args& args, string& text);
-};
-
-class ChildClass : public Manageable
-{
- string name;
- _qmf::Child* mgmtObject;
-
-public:
-
- ChildClass(ManagementAgent* agent, CoreClass* parent, string name);
- ~ChildClass() { mgmtObject->resourceDestroy(); }
-
- ManagementObject* GetManagementObject(void) const
- { return mgmtObject; }
-
- void doWork()
- {
- mgmtObject->inc_count(2);
- }
-};
-
-CoreClass::CoreClass(ManagementAgent* _agent, string _name) : name(_name), agent(_agent)
-{
- static uint64_t persistId = 0x111222333444555LL;
- mgmtObject = new _qmf::Parent(agent, this, name);
-
- agent->addObject(mgmtObject);
- mgmtObject->set_state("IDLE");
-
- Variant::Map args;
- Variant::Map subMap;
- args["first"] = "String data";
- args["second"] = 34;
- subMap["string-data"] = "Text";
- subMap["numeric-data"] = 10000;
- args["map-data"] = subMap;
- mgmtObject->set_args(args);
-
- Variant::List list;
- list.push_back(20000);
- list.push_back("string-item");
- mgmtObject->set_list(list);
-}
-
-void CoreClass::doLoop()
-{
- // Periodically bump a counter to provide a changing statistical value
- while (running) {
- qpid::sys::sleep(1);
- mgmtObject->inc_count();
- mgmtObject->set_state("IN_LOOP");
-
- {
- Mutex::ScopedLock _lock(vectorLock);
-
- for (std::vector<ChildClass*>::iterator iter = children.begin();
- iter != children.end();
- iter++) {
- (*iter)->doWork();
- }
- }
- }
-}
-
-
-bool CoreClass::AuthorizeMethod(uint32_t methodId, Args& args, const string& userId)
-{
- QPID_LOG(trace, "AuthorizeMethod for methodId=" << methodId << " userId=" << userId);
- return methodId != _qmf::Parent::METHOD_AUTH_FAIL;
-}
-
-
-Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args, string& /*text*/)
-{
- Mutex::ScopedLock _lock(vectorLock);
-
- switch (methodId) {
- case _qmf::Parent::METHOD_CREATE_CHILD: {
- _qmf::ArgsParentCreate_child& ioArgs = (_qmf::ArgsParentCreate_child&) args;
-
- ChildClass *child = new ChildClass(agent, this, ioArgs.i_name);
- ioArgs.o_childRef = child->GetManagementObject()->getObjectId();
-
- children.push_back(child);
-
- agent->raiseEvent(_qmf::EventChildCreated(ioArgs.i_name));
-
- return STATUS_OK;
- }
-
- case _qmf::Parent::METHOD_TEST_METHOD: {
- _qmf::ArgsParentTest_method& ioArgs = (_qmf::ArgsParentTest_method&) args;
-
- ioArgs.io_aMap["add"] = "me";
- ioArgs.io_aList.push_back(Variant("Stuff"));
- // TBD
- return STATUS_OK;
- }
- }
-
- return STATUS_NOT_IMPLEMENTED;
-}
-
-ChildClass::ChildClass(ManagementAgent* agent, CoreClass* parent, string name)
-{
- mgmtObject = new _qmf::Child(agent, this, parent, name);
-
- agent->addObject(mgmtObject);
-}
-
-
-//==============================================================
-// Main program
-//==============================================================
-
-ManagementAgent::Singleton* singleton;
-
-void shutdown(int)
-{
- running = false;
-}
-
-int main_int(int argc, char** argv)
-{
- singleton = new ManagementAgent::Singleton();
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- signal(SIGINT, shutdown);
-
- // Create the qmf management agent
- ManagementAgent* agent = singleton->getInstance();
-
- // Register the Qmf_example schema with the agent
- _qmf::Package packageInit(agent);
-
- // Name the agent.
- agent->setName("apache.org", "qmf-example");
-
- // Start the agent. It will attempt to make a connection to the
- // management broker
- agent->init(host, port, 5, false, ".magentdata");
-
- // Allocate some core objects
- CoreClass core1(agent, "Example Core Object #1");
- CoreClass core2(agent, "Example Core Object #2");
- CoreClass core3(agent, "Example Core Object #3");
-
- core1.doLoop();
-
- // done, cleanup and exit
- delete singleton;
-
- return 0;
-}
-
-int main(int argc, char** argv)
-{
- try {
- return main_int(argc, argv);
- } catch(std::exception& e) {
- cout << "Top Level Exception: " << e.what() << endl;
- }
-}
-
diff --git a/qpid/cpp/examples/qmf-agent/example_gen.mak b/qpid/cpp/examples/qmf-agent/example_gen.mak
deleted file mode 100644
index 1d71e77b63..0000000000
--- a/qpid/cpp/examples/qmf-agent/example_gen.mak
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# 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 nmake file generates the C++ mapping from the example schema.
-#
-# The Visual Studio projects assume the existence of the generated files.
-# These generated files must be created using this makefile for Windows
-# developers working from the source repository.
-
-mgen_dir=..\..\..\cpp\managementgen
-
-all:
- python $(mgen_dir)\qmf-gen -o .\gen\qmf .\schema.xml
diff --git a/qpid/cpp/examples/qmf-agent/qmf_agent.vcproj b/qpid/cpp/examples/qmf-agent/qmf_agent.vcproj
deleted file mode 100644
index 2a1c04b367..0000000000
--- a/qpid/cpp/examples/qmf-agent/qmf_agent.vcproj
+++ /dev/null
@@ -1,443 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<!--
- -
- - 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.
- -
- -->
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="qmf_agent"
- ProjectGUID="{771767FB-FECA-1BAD-2E13-3FFA2B8669C3}"
- RootNamespace="qmf_console_ping"
- Keyword="Win32Proj"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="Debug\qmf_agent\I386"
- ConfigurationType="1"
- CharacterSet="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qpidcommond.lib qpidclientd.lib qmfagentd.lib"
- OutputFile="$(OutDir)\qmf_agent.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib;$(QPID_ROOT)\bin,..\..\bin"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release\qmf_console_ping\I386"
- ConfigurationType="1"
- CharacterSet="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qpidcommon.lib qpidclient.lib qmfagent.lib"
- OutputFile="$(OutDir)\ping.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib;$(QPID_ROOT)\bin,..\..\bin"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="."
- IntermediateDirectory="Debug\qmf_console_ping\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies="qpidcommond.lib qpidclientd.lib qmfagentd.lib"
- OutputFile="$(OutDir)\ping.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib;$(QPID_ROOT)\bin,..\..\bin"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="Release"
- IntermediateDirectory="Release\qmf_console_ping\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="2"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,$(QPID_ROOT)\include,..\..\include"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies="qpidcommon.lib qpidclient.lib qmfagent.lib"
- OutputFile="$(OutDir)\ping.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib;$(QPID_ROOT)\bin,..\..\bin"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c"
- >
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Child.cpp"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\EventChildCreated.cpp"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\EventChildDestroyed.cpp"
- >
- </File>
- <File
- RelativePath=".\example.cpp"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Package.cpp"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Parent.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh"
- >
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\ArgsParentCreate_child.h"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Child.h"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\EventChildCreated.h"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\EventChildDestroyed.h"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Package.h"
- >
- </File>
- <File
- RelativePath=".\gen\qmf\org\apache\qpid\agent\example\Parent.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/qpid/cpp/examples/qmf-agent/schema.xml b/qpid/cpp/examples/qmf-agent/schema.xml
deleted file mode 100644
index 2a3bb461cc..0000000000
--- a/qpid/cpp/examples/qmf-agent/schema.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<schema package="org.apache.qpid.agent.example">
-
-<!--
- 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.
--->
-
- <!--
- ===============================================================
- Parent
- ===============================================================
- -->
- <class name="Parent">
-
- This class represents a parent object
-
- <property name="name" type="lstr" access="RC" index="y"/>
- <property name="args" type="map" access="RO"/>
- <property name="list" type="list" access="RO"/>
-
- <statistic name="state" type="sstr" desc="Operational state of the link"/>
- <statistic name="count" type="count64" unit="tick" desc="Counter that increases monotonically"/>
-
- <method name="create_child" desc="Create child object">
- <arg name="name" dir="I" type="lstr"/>
- <arg name="childRef" dir="O" type="objId"/>
- </method>
-
- <method name="test_method" desc="Test Method with Map and List Arguments">
- <arg name="aMap" dir="IO" type="map"/>
- <arg name="aList" dir="IO" type="list"/>
- </method>
-
- <method name="auth_fail" desc="Method that fails authorization">
- </method>
-
- </class>
-
-
- <!--
- ===============================================================
- Child
- ===============================================================
- -->
- <class name="Child">
- <property name="ParentRef" type="objId" references="Parent" access="RC" index="y" parentRef="y"/>
- <property name="name" type="lstr" access="RC" index="y"/>
-
- <statistic name="count" type="count64" unit="tick" desc="Counter that increases monotonically"/>
-
- <method name="delete"/>
- </class>
-
- <eventArguments>
- <arg name="childName" type="lstr"/>
- </eventArguments>
-
- <event name="ChildCreated" args="childName"/>
- <event name="ChildDestroyed" args="childName"/>
-</schema>
-
diff --git a/qpid/cpp/include/qpid/messaging/Handle.h b/qpid/cpp/include/qpid/messaging/Handle.h
index 97a8f00b54..2edab26744 100644
--- a/qpid/cpp/include/qpid/messaging/Handle.h
+++ b/qpid/cpp/include/qpid/messaging/Handle.h
@@ -53,14 +53,15 @@ template <class T> class Handle {
void swap(Handle<T>& h) { T* t = h.impl; h.impl = impl; impl = t; }
+ private:
+ // Not implemented, subclasses must implement.
+ Handle(const Handle&);
+ Handle& operator=(const Handle&);
+
protected:
typedef T Impl;
QPID_MESSAGING_INLINE_EXTERN Handle() :impl() {}
- // Not implemented,subclasses must implement.
- QPID_MESSAGING_EXTERN Handle(const Handle&);
- QPID_MESSAGING_EXTERN Handle& operator=(const Handle&);
-
Impl* impl;
friend class PrivateImplRef<T>;
diff --git a/qpid/cpp/include/qpid/swig_perl_typemaps.i b/qpid/cpp/include/qpid/swig_perl_typemaps.i
index da24bfe402..f1425ebd67 100644
--- a/qpid/cpp/include/qpid/swig_perl_typemaps.i
+++ b/qpid/cpp/include/qpid/swig_perl_typemaps.i
@@ -192,8 +192,10 @@
}
%typemap (out) uint8_t, uint16_t, uint32_t, uint64_t {
- sv_setuv($result, (UV)$1);
- argvi++;
+ SV* tmp = sv_newmortal();
+ sv_setuv(tmp, (UV)$1);
+ $result = tmp;
+ argvi++;
}
%typemap (in) int8_t, int16_t, int32_t, int64_t {
@@ -206,8 +208,10 @@
}
%typemap (out) int8_t, int16_t, int32_t, int64_t {
- sv_setiv($result, (IV)$1);
- argvi++;
+ SV* tmp = sv_newmortal();
+ sv_setiv(tmp, (IV)$1);
+ $result = tmp;
+ argvi++;
}
%typemap(in) bool {
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index e7cf72e745..ea377142c3 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -299,14 +299,14 @@ if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
set (CATCH_UNDEFINED "")
endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
- set (COMPILER_FLAGS "-fvisibility-inlines-hidden -Wl,--as-needed")
+ set (COMPILER_FLAGS "-fvisibility-inlines-hidden")
# gcc 4.1.2 on RHEL 5 needs -Wno-attributes to avoid an error that's fixed
# in later gcc versions.
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_EQUAL 4.1.2)
- set (COMPILER_FLAGS "-Wl,--as-needed")
- message (STATUS "Cannot use -fvisibility=hidden on gcc 4.1.2")
+ message (STATUS "Cannot restrict library symbol export on gcc 4.1.2")
+ set (HIDE_SYMBOL_FLAGS "-fno-visibility-inlines-hidden")
else (GCC_VERSION VERSION_EQUAL 4.1.2)
set (HIDE_SYMBOL_FLAGS "-fno-visibility-inlines-hidden -fvisibility=hidden")
endif (GCC_VERSION VERSION_EQUAL 4.1.2)
@@ -890,10 +890,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
windows/SCM.cpp
)
- set (qpidmessaging_platform_SOURCES
- qpid/messaging/HandleInstantiator.cpp
- )
-
else (CMAKE_SYSTEM_NAME STREQUAL Windows)
# POSIX (Non-Windows) platforms have a lot of overlap in sources; the only
@@ -991,9 +987,6 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (qpidd_platform_SOURCES
posix/QpiddBroker.cpp
)
-
- set (qpidmessaging_platform_SOURCES
- )
endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (qpidcommon_SOURCES
@@ -1203,8 +1196,8 @@ install (DIRECTORY ../include/qpid
PATTERN ".svn" EXCLUDE)
install_pdb (qpidclient ${QPID_COMPONENT_CLIENT})
-set (qpidmessaging_SOURCES_hidden
- qpid/messaging/AddressParser.h
+set (qpidmessaging_SOURCES
+ ${amqpc_SOURCES}
qpid/messaging/AddressImpl.h
qpid/messaging/ConnectionImpl.h
qpid/messaging/ReceiverImpl.h
@@ -1228,16 +1221,8 @@ set (qpidmessaging_SOURCES_hidden
qpid/client/amqp0_10/SessionImpl.cpp
qpid/client/amqp0_10/SenderImpl.h
qpid/client/amqp0_10/SenderImpl.cpp
-)
-set_source_files_properties(
- ${qpidmessaging_SOURCES_hidden}
- PROPERTIES
- COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
-
-set (qpidmessaging_SOURCES
- ${qpidmessaging_platform_SOURCES}
- ${qpidmessaging_SOURCES_hidden}
qpid/messaging/Address.cpp
+ qpid/messaging/AddressParser.h
qpid/messaging/AddressParser.cpp # The functions in here are not in the public interface, but qmf uses them
qpid/messaging/Connection.cpp
qpid/messaging/Duration.cpp
@@ -1256,17 +1241,14 @@ set (qpidmessaging_SOURCES
qpid/messaging/amqp/EncodedMessage.h
qpid/messaging/amqp/EncodedMessage.cpp
)
-set_source_files_properties(
- ${qpidmessaging_SOURCES}
- PROPERTIES
- COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
add_msvc_version (qpidmessaging library dll)
add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
-target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon)
+target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon ${PROTON_LIBRARIES})
set_target_properties (qpidmessaging PROPERTIES
LINK_FLAGS "${HIDE_SYMBOL_FLAGS} ${LINK_VERSION_SCRIPT_FLAG}"
+ COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}"
VERSION ${qpidmessaging_version}
SOVERSION ${qpidmessaging_version_major})
install (TARGETS qpidmessaging
@@ -1533,6 +1515,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_subdirectory(qpid/store)
add_subdirectory(tests)
+add_subdirectory(tests/legacystore)
# Support for pkg-config
diff --git a/qpid/cpp/src/amqp.cmake b/qpid/cpp/src/amqp.cmake
index 38b7d01315..52316d22b3 100644
--- a/qpid/cpp/src/amqp.cmake
+++ b/qpid/cpp/src/amqp.cmake
@@ -163,14 +163,22 @@ if (BUILD_AMQP)
qpid/messaging/amqp/TcpTransport.h
qpid/messaging/amqp/TcpTransport.cpp
)
- add_library (amqpc MODULE ${amqpc_SOURCES})
- target_link_libraries (amqpc qpidmessaging qpidtypes qpidclient qpidcommon ${PROTON_LIBRARIES})
- set_target_properties (amqpc PROPERTIES
- PREFIX ""
- LINK_FLAGS "${CATCH_UNDEFINED}")
- install (TARGETS amqpc
- DESTINATION ${QPIDC_MODULE_DIR}
- COMPONENT ${QPID_COMPONENT_CLIENT})
+ if (WIN32)
+ set(proton_dll "${PROTON_LIBRARY_DIRS}/${PROTON_LIBRARIES}.dll")
+ set(proton_dlld "${PROTON_LIBRARY_DIRS}/${PROTON_LIBRARIES}d.dll")
+ install (PROGRAMS ${proton_dll}
+ DESTINATION ${QPID_INSTALL_LIBDIR}
+ COMPONENT ${QPID_COMPONENT_COMMON}
+ CONFIGURATIONS Release|MinSizeRel|RelWithDebInfo)
+ install (PROGRAMS ${proton_dlld}
+ DESTINATION ${QPID_INSTALL_LIBDIR}
+ COMPONENT ${QPID_COMPONENT_COMMON}
+ CONFIGURATIONS Debug)
+ endif (WIN32)
+else (BUILD_AMQP)
+ # ensure that qpid build ignores proton
+ UNSET( amqpc_SOURCES )
+ UNSET( PROTON_LIBRARIES )
endif (BUILD_AMQP)
diff --git a/qpid/cpp/src/legacystore.cmake b/qpid/cpp/src/legacystore.cmake
index 1fdb51aa32..878dc5f247 100644
--- a/qpid/cpp/src/legacystore.cmake
+++ b/qpid/cpp/src/legacystore.cmake
@@ -146,12 +146,34 @@ if (BUILD_LEGACYSTORE)
)
target_link_libraries (legacystore
+ ${clock_gettime_LIB}
aio
uuid
qpidcommon qpidtypes qpidbroker
${DB_LIBRARY}
)
+ # For use in the store tests only
+ add_library (legacystore_shared SHARED
+ ${legacy_jrnl_SOURCES}
+ ${legacy_store_SOURCES}
+ ${legacy_qmf_SOURCES}
+ )
+
+ set_target_properties (legacystore_shared PROPERTIES
+ COMPILE_DEFINITIONS _IN_QPID_BROKER
+ INCLUDE_DIRECTORIES "${legacy_include_DIRECTORIES}"
+ )
+
+ target_link_libraries (legacystore_shared
+ ${clock_gettime_LIB}
+ aio
+ uuid
+ qpidcommon qpidtypes qpidbroker
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${DB_LIBRARY}
+ )
+
install(TARGETS legacystore
DESTINATION ${QPIDD_MODULE_DIR}
COMPONENT ${QPID_COMPONENT_BROKER})
diff --git a/qpid/cpp/src/qpid/amqp/descriptors.h b/qpid/cpp/src/qpid/amqp/descriptors.h
index e395fc25d7..857231ddda 100644
--- a/qpid/cpp/src/qpid/amqp/descriptors.h
+++ b/qpid/cpp/src/qpid/amqp/descriptors.h
@@ -33,7 +33,7 @@ const std::string DELIVERY_ANNOTATIONS_SYMBOL("amqp:delivery-annotations:map");
const std::string MESSAGE_ANNOTATIONS_SYMBOL("amqp:message-annotations:map");
const std::string APPLICATION_PROPERTIES_SYMBOL("amqp:application-properties:map");
const std::string AMQP_SEQUENCE_SYMBOL("amqp:amqp-sequence:list");
-const std::string AMQP_VALUE_SYMBOL("amqp:amqp-sequence:*");
+const std::string AMQP_VALUE_SYMBOL("amqp:amqp-value:*");
const std::string DATA_SYMBOL("amqp:data:binary");
const std::string FOOTER_SYMBOL("amqp:footer:map");
diff --git a/qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp b/qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp
index 930f402f85..49d152cc05 100644
--- a/qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp
+++ b/qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp
@@ -575,6 +575,11 @@ void translate(const boost::shared_ptr<FieldValue> from, Variant& to)
to = toVariant(from);
}
+boost::shared_ptr<framing::FieldValue> translate(const types::Variant& from)
+{
+ return toFieldValue(from);
+}
+
const std::string ListCodec::contentType("amqp/list");
const std::string MapCodec::contentType("amqp/map");
diff --git a/qpid/cpp/src/qpid/amqp_0_10/Codecs.h b/qpid/cpp/src/qpid/amqp_0_10/Codecs.h
index 408307eb7a..79d76bcc4b 100644
--- a/qpid/cpp/src/qpid/amqp_0_10/Codecs.h
+++ b/qpid/cpp/src/qpid/amqp_0_10/Codecs.h
@@ -80,6 +80,7 @@ QPID_COMMON_EXTERN void translate(const boost::shared_ptr<qpid::framing::FieldVa
qpid::types::Variant& to);
QPID_COMMON_EXTERN void translate(const types::Variant& from,
boost::shared_ptr<qpid::framing::FieldValue> to);
+QPID_COMMON_EXTERN boost::shared_ptr<qpid::framing::FieldValue> translate(const types::Variant& from);
}} // namespace qpid::amqp_0_10
diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp
index 2770c9d66b..dd2769ec92 100644
--- a/qpid/cpp/src/qpid/broker/Broker.cpp
+++ b/qpid/cpp/src/qpid/broker/Broker.cpp
@@ -355,6 +355,11 @@ Broker::Broker(const Broker::Options& conf) :
//recover any objects via object factories
objects.restore(*this);
+ // Assign to queues their users who created them (can be done after ACL is loaded in Plugin::initializeAll above
+ if ((getAcl()) && (store.get())) {
+ queues.eachQueue(boost::bind(&qpid::broker::Queue::updateAclUserQueueCount, _1));
+ }
+
if(conf.enableMgmt) {
if (getAcl()) {
mgmtObject->set_maxConns(getAcl()->getMaxConnectTotal());
@@ -1289,8 +1294,9 @@ std::pair<boost::shared_ptr<Queue>, bool> Broker::createQueue(
if (!acl->authorise(userId,acl::ACT_CREATE,acl::OBJ_QUEUE,name,&params) )
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));
+ if (!queues.find(name))
+ if (!acl->approveCreateQueue(userId,name) )
+ throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied queue create request from " << userId));
}
Exchange::shared_ptr alternate;
diff --git a/qpid/cpp/src/qpid/broker/Exchange.cpp b/qpid/cpp/src/qpid/broker/Exchange.cpp
index 0a25d57cd8..efd83a3225 100644
--- a/qpid/cpp/src/qpid/broker/Exchange.cpp
+++ b/qpid/cpp/src/qpid/broker/Exchange.cpp
@@ -135,7 +135,7 @@ void Exchange::doRoute(Deliverable& msg, ConstBindingList b)
if (mgmtExchange != 0)
{
qmf::org::apache::qpid::broker::Exchange::PerThreadStats *eStats = mgmtExchange->getStatistics();
- uint64_t contentSize = msg.getMessage().getContentSize();
+ uint64_t contentSize = msg.getMessage().getMessageSize();
eStats->msgReceives += 1;
eStats->byteReceives += contentSize;
diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp
index e71125b4ab..deca238f22 100644
--- a/qpid/cpp/src/qpid/broker/Message.cpp
+++ b/qpid/cpp/src/qpid/broker/Message.cpp
@@ -71,9 +71,9 @@ bool Message::isPersistent() const
return getEncoding().isPersistent();
}
-uint64_t Message::getContentSize() const
+uint64_t Message::getMessageSize() const
{
- return getEncoding().getContentSize();
+ return getEncoding().getMessageSize();
}
boost::intrusive_ptr<AsyncCompletion> Message::getIngressCompletion() const
diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h
index 84f62a771d..fdc919242e 100644
--- a/qpid/cpp/src/qpid/broker/Message.h
+++ b/qpid/cpp/src/qpid/broker/Message.h
@@ -68,7 +68,7 @@ public:
virtual std::string getRoutingKey() const = 0;
virtual bool isPersistent() const = 0;
virtual uint8_t getPriority() const = 0;
- virtual uint64_t getContentSize() const = 0;
+ virtual uint64_t getMessageSize() const = 0;
virtual qpid::amqp::MessageId getMessageId() const = 0;
virtual qpid::amqp::MessageId getCorrelationId() const = 0;
virtual std::string getPropertyAsString(const std::string& key) const = 0;
@@ -83,7 +83,7 @@ public:
QPID_BROKER_EXTERN Message();
QPID_BROKER_EXTERN ~Message();
- bool isRedelivered() const { return deliveryCount; }
+ bool isRedelivered() const { return deliveryCount > 0; }
void deliver() { ++deliveryCount; }
void undeliver() { --deliveryCount; }
int getDeliveryCount() const { return deliveryCount; }
@@ -119,7 +119,7 @@ public:
QPID_BROKER_EXTERN qpid::types::Variant getProperty(const std::string& key) const;
void processProperties(qpid::amqp::MapHandler&) const;
- QPID_BROKER_EXTERN uint64_t getContentSize() const;
+ QPID_BROKER_EXTERN uint64_t getMessageSize() const;
QPID_BROKER_EXTERN Encoding& getEncoding();
QPID_BROKER_EXTERN const Encoding& getEncoding() const;
diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp
index d1f1afd61a..449488435d 100644
--- a/qpid/cpp/src/qpid/broker/Queue.cpp
+++ b/qpid/cpp/src/qpid/broker/Queue.cpp
@@ -88,7 +88,7 @@ inline void mgntEnqStats(const Message& msg,
_qmf::Queue::PerThreadStats *qStats = mgmtObject->getStatistics();
_qmf::Broker::PerThreadStats *bStats = brokerMgmtObject->getStatistics();
- uint64_t contentSize = msg.getContentSize();
+ uint64_t contentSize = msg.getMessageSize();
qStats->msgTotalEnqueues +=1;
bStats->msgTotalEnqueues += 1;
qStats->byteTotalEnqueues += contentSize;
@@ -111,7 +111,7 @@ inline void mgntDeqStats(const Message& msg,
if (mgmtObject != 0){
_qmf::Queue::PerThreadStats *qStats = mgmtObject->getStatistics();
_qmf::Broker::PerThreadStats *bStats = brokerMgmtObject->getStatistics();
- uint64_t contentSize = msg.getContentSize();
+ uint64_t contentSize = msg.getMessageSize();
qStats->msgTotalDequeues += 1;
bStats->msgTotalDequeues += 1;
@@ -131,7 +131,15 @@ inline void mgntDeqStats(const Message& msg,
QueueSettings merge(const QueueSettings& inputs, const Broker::Options& globalOptions)
{
QueueSettings settings(inputs);
- if (!settings.maxDepth.hasSize() && globalOptions.queueLimit) {
+ settings.maxDepth = QueueDepth();
+ if (inputs.maxDepth.hasCount() && inputs.maxDepth.getCount()) {
+ settings.maxDepth.setCount(inputs.maxDepth.getCount());
+ }
+ if (inputs.maxDepth.hasSize()) {
+ if (inputs.maxDepth.getSize()) {
+ settings.maxDepth.setSize(inputs.maxDepth.getSize());
+ }
+ } else if (globalOptions.queueLimit) {
settings.maxDepth.setSize(globalOptions.queueLimit);
}
return settings;
@@ -194,7 +202,7 @@ Queue::Queue(const string& _name, const QueueSettings& _settings,
redirectSource(false)
{
current.setCount(0);//always track depth in messages
- if (settings.maxDepth.hasSize()) current.setSize(0);//track depth in bytes only if policy requires it
+ if (settings.maxDepth.getSize()) current.setSize(0);//track depth in bytes only if policy requires it
if (settings.traceExcludes.size()) {
split(traceExclude, settings.traceExcludes, ", ");
}
@@ -297,7 +305,7 @@ void Queue::deliverTo(Message msg, TxBuffer* txn)
void Queue::recoverPrepared(const Message& msg)
{
Mutex::ScopedLock locker(messageLock);
- current += QueueDepth(1, msg.getContentSize());
+ current += QueueDepth(1, msg.getMessageSize());
}
void Queue::recover(Message& msg)
@@ -311,7 +319,7 @@ void Queue::process(Message& msg)
push(msg);
if (mgmtObject != 0){
_qmf::Queue::PerThreadStats *qStats = mgmtObject->getStatistics();
- const uint64_t contentSize = msg.getContentSize();
+ const uint64_t contentSize = msg.getMessageSize();
qStats->msgTxnEnqueues += 1;
qStats->byteTxnEnqueues += contentSize;
mgmtObject->statisticsUpdated();
@@ -853,7 +861,7 @@ bool Queue::enqueue(TransactionContext* ctxt, Message& msg)
{
Mutex::ScopedLock locker(messageLock);
- if (!checkDepth(QueueDepth(1, msg.getContentSize()), msg)) {
+ if (!checkDepth(QueueDepth(1, msg.getMessageSize()), msg)) {
return false;
}
}
@@ -883,7 +891,7 @@ void Queue::enqueueAborted(const Message& msg)
//Called when any transactional enqueue is aborted (including but
//not limited to a recovered dtx transaction)
Mutex::ScopedLock locker(messageLock);
- current -= QueueDepth(1, msg.getContentSize());
+ current -= QueueDepth(1, msg.getMessageSize());
}
void Queue::enqueueCommited(Message& msg)
@@ -911,7 +919,7 @@ void Queue::dequeueCommited(const Message& msg)
observeDequeue(msg, locker, settings.autodelete ? &autodelete : 0);
if (mgmtObject != 0) {
mgmtObject->inc_msgTxnDequeues();
- mgmtObject->inc_byteTxnDequeues(msg.getContentSize());
+ mgmtObject->inc_byteTxnDequeues(msg.getMessageSize());
}
}
@@ -954,7 +962,7 @@ void Queue::dequeueCommitted(const QueueCursor& cursor)
Mutex::ScopedLock locker(messageLock);
Message* msg = messages->find(cursor);
if (msg) {
- const uint64_t contentSize = msg->getContentSize();
+ const uint64_t contentSize = msg->getMessageSize();
observeDequeue(*msg, locker, settings.autodelete ? &autodelete : 0);
if (mgmtObject != 0) {
mgmtObject->inc_msgTxnDequeues();
@@ -978,7 +986,7 @@ void Queue::dequeueCommitted(const QueueCursor& cursor)
*/
void Queue::observeDequeue(const Message& msg, const Mutex::ScopedLock& lock, ScopedAutoDelete* autodelete)
{
- current -= QueueDepth(1, msg.getContentSize());
+ current -= QueueDepth(1, msg.getMessageSize());
mgntDeqStats(msg, mgmtObject, brokerMgmtObject);
for (Observers::const_iterator i = observers.begin(); i != observers.end(); ++i) {
try{
@@ -1182,18 +1190,27 @@ void Queue::encode(Buffer& buffer) const
buffer.putShortString(name);
buffer.put(encodableSettings);
buffer.putShortString(alternateExchange.get() ? alternateExchange->getName() : std::string(""));
+ buffer.putShortString(userId);
}
uint32_t Queue::encodedSize() const
{
return name.size() + 1/*short string size octet*/
+ (alternateExchange.get() ? alternateExchange->getName().size() : 0) + 1 /* short string */
+ + userId.size() + 1 /* short string */
+ encodableSettings.encodedSize();
}
+void Queue::updateAclUserQueueCount()
+{
+ if (broker->getAcl())
+ broker->getAcl()->approveCreateQueue(userId, name);
+}
+
Queue::shared_ptr Queue::restore( QueueRegistry& queues, Buffer& buffer )
{
string name;
+ string _userId;
buffer.getShortString(name);
FieldTable ft;
buffer.get(ft);
@@ -1207,6 +1224,12 @@ Queue::shared_ptr Queue::restore( QueueRegistry& queues, Buffer& buffer )
result.first->alternateExchangeName.assign(altExch);
}
+ //get userId of queue's creator; ACL counters for userId are done after ACL plugin is initialized
+ if (buffer.available()) {
+ buffer.getShortString(_userId);
+ result.first->setOwningUser(_userId);
+ }
+
return result.first;
}
diff --git a/qpid/cpp/src/qpid/broker/Queue.h b/qpid/cpp/src/qpid/broker/Queue.h
index a832b95feb..a7eb71c6bb 100644
--- a/qpid/cpp/src/qpid/broker/Queue.h
+++ b/qpid/cpp/src/qpid/broker/Queue.h
@@ -204,6 +204,7 @@ class Queue : public boost::enable_shared_from_this<Queue>,
QueueDepth current;
QueueBindings bindings;
std::string alternateExchangeName;
+ std::string userId; // queue owner for ACL quota purposes
boost::shared_ptr<Exchange> alternateExchange;
framing::SequenceNumber sequence;
qmf::org::apache::qpid::broker::Queue::shared_ptr mgmtObject;
@@ -384,6 +385,10 @@ class Queue : public boost::enable_shared_from_this<Queue>,
/** Get the message at position pos, returns true if found and sets msg */
QPID_BROKER_EXTERN bool find(framing::SequenceNumber pos, Message& msg ) const;
+ // Remember the queue's owner so acl quotas can be restored after restart
+ void setOwningUser(std::string& _userId) { userId = _userId; }
+ void updateAclUserQueueCount();
+
QPID_BROKER_EXTERN void setAlternateExchange(boost::shared_ptr<Exchange> exchange);
QPID_BROKER_EXTERN boost::shared_ptr<Exchange> getAlternateExchange();
QPID_BROKER_EXTERN bool isLocal(const Message& msg);
diff --git a/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp b/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
index 9b2e31c925..607dc09fe8 100644
--- a/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
+++ b/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
@@ -112,7 +112,7 @@ void QueueFlowLimit::enqueued(const Message& msg)
sys::Mutex::ScopedLock l(indexLock);
++count;
- size += msg.getContentSize();
+ size += msg.getMessageSize();
if (!flowStopped) {
if (flowStopCount && count > flowStopCount) {
@@ -150,7 +150,7 @@ void QueueFlowLimit::dequeued(const Message& msg)
throw Exception(QPID_MSG("Flow limit count underflow on dequeue. Queue=" << queueName));
}
- uint64_t _size = msg.getContentSize();
+ uint64_t _size = msg.getMessageSize();
if (_size <= size) {
size -= _size;
} else {
diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
index 606a8cceae..1283a42e6d 100644
--- a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
+++ b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
@@ -64,6 +64,8 @@ QueueRegistry::declare(const string& name, const QueueSettings& settings,
//Move this to factory also?
if (alternate)
queue->setAlternateExchange(alternate);//need to do this *before* create
+ queue->setOwningUser(userId);
+
if (!recovering) {
//create persistent record if required
queue->create();
diff --git a/qpid/cpp/src/qpid/broker/QueueSettings.cpp b/qpid/cpp/src/qpid/broker/QueueSettings.cpp
index c505217dbb..0b4a268489 100644
--- a/qpid/cpp/src/qpid/broker/QueueSettings.cpp
+++ b/qpid/cpp/src/qpid/broker/QueueSettings.cpp
@@ -112,10 +112,10 @@ QueueSettings::QueueSettings(bool d, bool a) :
bool QueueSettings::handle(const std::string& key, const qpid::types::Variant& value)
{
- if (key == MAX_COUNT && value.asUint32() > 0) {
+ if (key == MAX_COUNT) {
maxDepth.setCount(value);
return true;
- } else if (key == MAX_SIZE && value.asUint64() > 0) {
+ } else if (key == MAX_SIZE) {
maxDepth.setSize(value);
return true;
} else if (key == POLICY_TYPE) {
diff --git a/qpid/cpp/src/qpid/broker/QueueSettings.h b/qpid/cpp/src/qpid/broker/QueueSettings.h
index 8d72115e18..e150e365c2 100644
--- a/qpid/cpp/src/qpid/broker/QueueSettings.h
+++ b/qpid/cpp/src/qpid/broker/QueueSettings.h
@@ -110,7 +110,7 @@ struct QueueSettings
void validate() const;
QPID_BROKER_EXTERN void populate(const std::map<std::string, qpid::types::Variant>& inputs, std::map<std::string, qpid::types::Variant>& unused);
QPID_BROKER_EXTERN void populate(const qpid::framing::FieldTable& inputs, qpid::framing::FieldTable& unused);
- std::map<std::string, qpid::types::Variant> asMap() const;
+ QPID_BROKER_EXTERN std::map<std::string, qpid::types::Variant> asMap() const;
struct Aliases : std::map<std::string, std::string>
{
diff --git a/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp b/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp
index 345b9d89d5..afb9d9ff4e 100644
--- a/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp
+++ b/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp
@@ -44,7 +44,7 @@ ThresholdAlerts::ThresholdAlerts(const std::string& n,
void ThresholdAlerts::enqueued(const Message& m)
{
- size += m.getContentSize();
+ size += m.getMessageSize();
++count;
if (sizeGoingUp && sizeThreshold && size >= sizeThreshold) {
@@ -64,7 +64,7 @@ void ThresholdAlerts::enqueued(const Message& m)
void ThresholdAlerts::dequeued(const Message& m)
{
- size -= m.getContentSize();
+ size -= m.getMessageSize();
--count;
if (!sizeGoingUp && sizeThreshold && size <= sizeThresholdDown) {
diff --git a/qpid/cpp/src/qpid/broker/amqp/Message.cpp b/qpid/cpp/src/qpid/broker/amqp/Message.cpp
index 572eea3881..7015db324b 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Message.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Message.cpp
@@ -31,6 +31,7 @@
#include "qpid/log/Statement.h"
#include "qpid/framing/Buffer.h"
#include <string.h>
+#include <boost/lexical_cast.hpp>
namespace qpid {
namespace broker {
@@ -79,8 +80,51 @@ uint8_t Message::getPriority() const
else return priority.get();
}
-std::string Message::getPropertyAsString(const std::string& /*key*/) const { return empty; }
-std::string Message::getAnnotationAsString(const std::string& /*key*/) const { return empty; }
+namespace {
+class StringRetriever : public MapHandler
+{
+ public:
+ StringRetriever(const std::string& k) : key(k) {}
+ void handleBool(const qpid::amqp::CharSequence& actualKey, bool actualValue) { process(actualKey, actualValue); }
+ void handleUint8(const qpid::amqp::CharSequence& actualKey, uint8_t actualValue) { process(actualKey, actualValue); }
+ void handleUint16(const qpid::amqp::CharSequence& actualKey, uint16_t actualValue) { process(actualKey, actualValue); }
+ void handleUint32(const qpid::amqp::CharSequence& actualKey, uint32_t actualValue) { process(actualKey, actualValue); }
+ void handleUint64(const qpid::amqp::CharSequence& actualKey, uint64_t actualValue) { process(actualKey, actualValue); }
+ void handleInt8(const qpid::amqp::CharSequence& actualKey, int8_t actualValue) { process(actualKey, actualValue); }
+ void handleInt16(const qpid::amqp::CharSequence& actualKey, int16_t actualValue) { process(actualKey, actualValue); }
+ void handleInt32(const qpid::amqp::CharSequence& actualKey, int32_t actualValue) { process(actualKey, actualValue); }
+ void handleInt64(const qpid::amqp::CharSequence& actualKey, int64_t actualValue) { process(actualKey, actualValue); }
+ void handleFloat(const qpid::amqp::CharSequence& actualKey, float actualValue) { process(actualKey, actualValue); }
+ void handleDouble(const qpid::amqp::CharSequence& actualKey, double actualValue) { process(actualKey, actualValue); }
+ void handleVoid(const qpid::amqp::CharSequence&) { /*nothing to do*/ }
+ void handleString(const qpid::amqp::CharSequence& actualKey, const qpid::amqp::CharSequence& actualValue, const qpid::amqp::CharSequence& /*encoding*/)
+ {
+ if (isRequestedKey(actualKey)) value = std::string(actualValue.data, actualValue.size);
+ }
+ std::string getValue() const { return value; }
+ private:
+ const std::string key;
+ std::string value;
+
+ template <typename T> void process(const qpid::amqp::CharSequence& actualKey, T actualValue)
+ {
+ if (isRequestedKey(actualKey)) value = boost::lexical_cast<std::string>(actualValue);
+ }
+
+ bool isRequestedKey(const qpid::amqp::CharSequence& actualKey)
+ {
+ //TODO: avoid allocating new string by just iterating over chars
+ return key == std::string(actualKey.data, actualKey.size);
+ }
+};
+}
+
+std::string Message::getPropertyAsString(const std::string& key) const
+{
+ StringRetriever sr(key);
+ processProperties(sr);
+ return sr.getValue();
+}
namespace {
class PropertyAdapter : public Reader {
@@ -135,19 +179,30 @@ namespace {
state(KEY)
{}
};
+
+void processMapData(const CharSequence& source, MapHandler& handler)
+{
+ qpid::amqp::Decoder d(source.data, source.size);
+ PropertyAdapter adapter(handler);
+ d.read(adapter);
+
+}
}
void Message::processProperties(MapHandler& mh) const {
- qpid::amqp::Decoder d(applicationProperties.data, applicationProperties.size);
- PropertyAdapter mha(mh);
- d.read(mha);
+ processMapData(applicationProperties, mh);
+}
+
+std::string Message::getAnnotationAsString(const std::string& key) const
+{
+ StringRetriever sr(key);
+ processMapData(messageAnnotations, sr);
+ if (sr.getValue().empty()) processMapData(deliveryAnnotations, sr);
+ return sr.getValue();
+
}
-//getContentSize() is primarily used in stats about the number of
-//bytes enqueued/dequeued etc, not sure whether this is the right name
-//and whether it should indeed only be the content that is thus
-//measured
-uint64_t Message::getContentSize() const { return data.size(); }
+uint64_t Message::getMessageSize() const { return data.size(); }
//getContent() is used primarily for decoding qmf messages in
//management and ha, but also by the xml exchange
std::string Message::getContent() const
diff --git a/qpid/cpp/src/qpid/broker/amqp/Message.h b/qpid/cpp/src/qpid/broker/amqp/Message.h
index 3a7c4529de..5bf49ef556 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Message.h
+++ b/qpid/cpp/src/qpid/broker/amqp/Message.h
@@ -44,7 +44,7 @@ class Message : public qpid::broker::Message::Encoding, private qpid::amqp::Mess
std::string getRoutingKey() const;
bool isPersistent() const;
uint8_t getPriority() const;
- uint64_t getContentSize() const;
+ uint64_t getMessageSize() const;
std::string getPropertyAsString(const std::string& key) const;
std::string getAnnotationAsString(const std::string& key) const;
bool getTtl(uint64_t&) const;
diff --git a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
index eb30c78128..45536c2262 100644
--- a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
@@ -20,10 +20,13 @@
*/
#include "qpid/broker/amqp/NodeProperties.h"
#include "qpid/broker/amqp/DataReader.h"
+#include "qpid/broker/Exchange.h"
+#include "qpid/broker/Queue.h"
#include "qpid/broker/QueueSettings.h"
#include "qpid/amqp/CharSequence.h"
#include "qpid/amqp/Descriptor.h"
#include "qpid/amqp/descriptors.h"
+#include "qpid/amqp_0_10/Codecs.h"
#include "qpid/types/Variant.h"
#include "qpid/broker/QueueSettings.h"
#include "qpid/log/Statement.h"
@@ -100,7 +103,7 @@ bool getLifetimeDescriptorSymbol(QueueSettings::LifetimePolicy policy, pn_bytes_
}
-NodeProperties::NodeProperties() : queue(true), durable(false), autoDelete(false), exclusive(false), exchangeType("topic"), lifetime(QueueSettings::DELETE_IF_UNUSED) {}
+NodeProperties::NodeProperties() : received(false), queue(true), durable(false), autoDelete(false), exclusive(false), exchangeType("topic"), lifetime(QueueSettings::DELETE_IF_UNUSED) {}
void NodeProperties::read(pn_data_t* data)
{
@@ -108,26 +111,92 @@ void NodeProperties::read(pn_data_t* data)
reader.read(data);
}
-void NodeProperties::write(pn_data_t* data)
+void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Queue> node)
{
- pn_data_put_map(data);
- pn_data_enter(data);
- pn_data_put_symbol(data, convert(SUPPORTED_DIST_MODES));
- pn_data_put_string(data, convert(queue ? MOVE : COPY));
- pn_bytes_t symbol;
- if (autoDelete && getLifetimeDescriptorSymbol(lifetime, symbol)) {
- pn_data_put_symbol(data, convert(LIFETIME_POLICY));
- pn_data_put_described(data);
+ if (received) {
+ pn_data_put_map(data);
pn_data_enter(data);
- pn_data_put_symbol(data, symbol);
- pn_data_put_list(data);
+ pn_data_put_symbol(data, convert(SUPPORTED_DIST_MODES));
+ pn_data_put_string(data, convert(MOVE));//TODO: should really add COPY as well, since queues can be browsed
+ pn_bytes_t symbol;
+ if (autoDelete && node->isAutoDelete() && getLifetimeDescriptorSymbol(node->getSettings().lifetime, symbol)) {
+ pn_data_put_symbol(data, convert(LIFETIME_POLICY));
+ pn_data_put_described(data);
+ pn_data_enter(data);
+ pn_data_put_symbol(data, symbol);
+ pn_data_put_list(data);
+ pn_data_exit(data);
+ }
+ if (durable && node->isDurable()) {
+ pn_data_put_symbol(data, convert(DURABLE));
+ pn_data_put_bool(data, true);
+ }
+ if (exclusive && node->hasExclusiveOwner()) {
+ pn_data_put_symbol(data, convert(EXCLUSIVE));
+ pn_data_put_bool(data, true);
+ }
+ if (!alternateExchange.empty() && node->getAlternateExchange()) {
+ pn_data_put_symbol(data, convert(ALTERNATE_EXCHANGE));
+ pn_data_put_string(data, convert(node->getAlternateExchange()->getName()));
+ }
+
+ qpid::types::Variant::Map actual = node->getSettings().asMap();
+ qpid::types::Variant::Map unrecognised;
+ QueueSettings dummy;
+ dummy.populate(actual, unrecognised);
+ for (qpid::types::Variant::Map::const_iterator i = unrecognised.begin(); i != unrecognised.end(); ++i) {
+ actual.erase(i->first);
+ }
+ for (qpid::types::Variant::Map::const_iterator i = properties.begin(); i != properties.end(); ++i) {
+ qpid::types::Variant::Map::const_iterator j = actual.find(i->first);
+ if (j != actual.end()) {
+ pn_data_put_symbol(data, convert(j->first));
+ pn_data_put_string(data, convert(j->second.asString()));
+ }
+ }
+
pn_data_exit(data);
}
- pn_data_exit(data);
}
+namespace {
+const std::string QPID_MSG_SEQUENCE("qpid.msg_sequence");
+const std::string QPID_IVE("qpid.ive");
+}
+void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Exchange> node)
+{
+ if (received) {
+ pn_data_put_map(data);
+ pn_data_enter(data);
+ pn_data_put_symbol(data, convert(SUPPORTED_DIST_MODES));
+ pn_data_put_string(data, convert(COPY));
+ if (durable && node->isDurable()) {
+ pn_data_put_symbol(data, convert(DURABLE));
+ pn_data_put_bool(data, true);
+ }
+ if (!exchangeType.empty()) {
+ pn_data_put_symbol(data, convert(EXCHANGE_TYPE));
+ pn_data_put_string(data, convert(node->getType()));
+ }
+ if (!alternateExchange.empty() && node->getAlternate()) {
+ pn_data_put_symbol(data, convert(ALTERNATE_EXCHANGE));
+ pn_data_put_string(data, convert(node->getAlternate()->getName()));
+ }
+
+ for (qpid::types::Variant::Map::const_iterator i = properties.begin(); i != properties.end(); ++i) {
+ if ((i->first == QPID_MSG_SEQUENCE || i->first == QPID_IVE) && node->getArgs().isSet(i->first)) {
+ pn_data_put_symbol(data, convert(i->first));
+ pn_data_put_bool(data, true);
+ }
+ }
+
+ pn_data_exit(data);
+ }
+}
+
void NodeProperties::process(const std::string& key, const qpid::types::Variant& value, const Descriptor* d)
{
+ received = true;
QPID_LOG(debug, "Processing node property " << key << " = " << value);
if (key == SUPPORTED_DIST_MODES) {
if (value == MOVE) queue = true;
@@ -248,6 +317,7 @@ QueueSettings NodeProperties::getQueueSettings()
qpid::types::Variant::Map unused;
settings.populate(properties, unused);
settings.lifetime = lifetime;
+ qpid::amqp_0_10::translate(unused, settings.storeSettings);
return settings;
}
@@ -277,4 +347,9 @@ bool NodeProperties::trackControllingLink() const
return lifetime == QueueSettings::DELETE_ON_CLOSE || lifetime == QueueSettings::DELETE_IF_EMPTY;
}
+const qpid::types::Variant::Map& NodeProperties::getProperties() const
+{
+ return properties;
+}
+
}}} // namespace qpid::broker::amqp
diff --git a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
index 03780c10a9..df96d5a023 100644
--- a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
+++ b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
@@ -24,10 +24,13 @@
#include "qpid/amqp/MapReader.h"
#include "qpid/types/Variant.h"
#include "qpid/broker/QueueSettings.h"
+#include <boost/shared_ptr.hpp>
struct pn_data_t;
namespace qpid {
namespace broker {
+class Exchange;
+class Queue;
struct QueueSettings;
namespace amqp {
@@ -36,7 +39,8 @@ class NodeProperties : public qpid::amqp::MapReader
public:
NodeProperties();
void read(pn_data_t*);
- void write(pn_data_t*);
+ void write(pn_data_t*,boost::shared_ptr<Queue>);
+ void write(pn_data_t*,boost::shared_ptr<Exchange>);
void onNullValue(const qpid::amqp::CharSequence&, const qpid::amqp::Descriptor*);
void onBooleanValue(const qpid::amqp::CharSequence&, bool, const qpid::amqp::Descriptor*);
void onUByteValue(const qpid::amqp::CharSequence&, uint8_t, const qpid::amqp::Descriptor*);
@@ -61,7 +65,9 @@ class NodeProperties : public qpid::amqp::MapReader
std::string getExchangeType() const;
std::string getAlternateExchange() const;
bool trackControllingLink() const;
+ const qpid::types::Variant::Map& getProperties() const;
private:
+ bool received;
bool queue;
bool durable;
bool autoDelete;
diff --git a/qpid/cpp/src/qpid/broker/amqp/Outgoing.cpp b/qpid/cpp/src/qpid/broker/amqp/Outgoing.cpp
index e8c05ed7b0..1b7a47b360 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Outgoing.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Outgoing.cpp
@@ -45,6 +45,17 @@ void Outgoing::wakeup()
session.wakeup();
}
+namespace {
+bool requested_reliable(pn_link_t* link)
+{
+ return pn_link_remote_snd_settle_mode(link) == PN_SND_UNSETTLED;
+}
+bool requested_unreliable(pn_link_t* link)
+{
+ return pn_link_remote_snd_settle_mode(link) == PN_SND_SETTLED;
+}
+}
+
OutgoingFromQueue::OutgoingFromQueue(Broker& broker, const std::string& source, const std::string& target, boost::shared_ptr<Queue> q, pn_link_t* l, Session& session,
qpid::sys::OutputControl& o, SubscriptionType type, bool e, bool p)
: Outgoing(broker, session, source, target, pn_link_name(l)),
@@ -54,7 +65,8 @@ OutgoingFromQueue::OutgoingFromQueue(Broker& broker, const std::string& source,
queue(q), deliveries(5000), link(l), out(o),
current(0), outstanding(0),
buffer(1024)/*used only for header at present*/,
- unreliable(pn_link_remote_snd_settle_mode(link) == PN_SND_SETTLED)
+ //for exclusive queues, assume unreliable unless reliable is explicitly requested; otherwise assume reliable unless unreliable requested
+ unreliable(exclusive ? !requested_reliable(link) : requested_unreliable(link))
{
for (size_t i = 0 ; i < deliveries.capacity(); ++i) {
deliveries[i].init(i);
@@ -106,8 +118,8 @@ void OutgoingFromQueue::handle(pn_delivery_t* delivery)
write(&buffer[0], encoder.getPosition());
Translation t(r.msg);
t.write(*this);
- if (unreliable) pn_delivery_settle(delivery);
if (pn_link_advance(link)) {
+ if (unreliable) pn_delivery_settle(delivery);
--outstanding;
outgoingMessageSent();
QPID_LOG(debug, "Sent message " << r.msg.getSequence() << " from " << queue->getName() << ", index=" << r.index);
@@ -121,6 +133,10 @@ void OutgoingFromQueue::handle(pn_delivery_t* delivery)
} else if (pn_delivery_updated(delivery)) {
assert(r.delivery == delivery);
r.disposition = pn_delivery_remote_state(delivery);
+ if (!r.disposition && pn_delivery_settled(delivery)) {
+ //if peer has settled without setting state, assume accepted
+ r.disposition = PN_ACCEPTED;
+ }
if (r.disposition) {
switch (r.disposition) {
case PN_ACCEPTED:
@@ -132,17 +148,18 @@ void OutgoingFromQueue::handle(pn_delivery_t* delivery)
outgoingMessageRejected();
break;
case PN_RELEASED:
- if (preAcquires()) queue->release(r.cursor, false);//TODO: for PN_RELEASED, delivery count should not be incremented
+ if (preAcquires()) queue->release(r.cursor, false);//for PN_RELEASED, delivery count should not be incremented
outgoingMessageRejected();//TODO: not quite true...
break;
case PN_MODIFIED:
- if (preAcquires()) queue->release(r.cursor, true);//TODO: proper handling of modified
+ if (preAcquires()) queue->release(r.cursor, pn_disposition_is_failed(pn_delivery_remote(delivery)));
+ //TODO: handle undeliverable-here and message-annotations
outgoingMessageRejected();//TODO: not quite true...
break;
default:
QPID_LOG(warning, "Unhandled disposition: " << r.disposition);
}
- //TODO: ony settle once any dequeue on store has completed
+ //TODO: only settle once any dequeue on store has completed
pn_delivery_settle(delivery);
r.reset();
}
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp
index 4627d724a5..c4265ef420 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Session.cpp
@@ -44,6 +44,7 @@
#include "qpid/framing/FieldTable.h"
#include "qpid/framing/MessageTransferBody.h"
#include "qpid/log/Statement.h"
+#include "qpid/amqp_0_10/Codecs.h"
#include <boost/intrusive_ptr.hpp>
#include <boost/format.hpp>
#include <map>
@@ -100,11 +101,13 @@ void readCapabilities(pn_data_t* data, F f)
if (type == PN_ARRAY) {
pn_data_enter(data);
while (pn_data_next(data)) {
- f(convert(pn_data_get_symbol(data)));
+ std::string s = convert(pn_data_get_symbol(data));
+ f(s);
}
pn_data_exit(data);
} else if (type == PN_SYMBOL) {
- f(convert(pn_data_get_symbol(data)));
+ std::string s = convert(pn_data_get_symbol(data));
+ f(s);
} else {
QPID_LOG(error, "Skipping capabilities field of type " << pn_type_name(type));
}
@@ -200,25 +203,32 @@ Session::ResolvedNode Session::resolve(const std::string name, pn_terminus_t* te
node.exchange = connection.getBroker().getExchanges().find(name);
node.queue = connection.getBroker().getQueues().find(name);
node.topic = connection.getTopics().get(name);
+ bool createOnDemand = is_capability_requested(CREATE_ON_DEMAND, pn_terminus_capabilities(terminus));
+ //Strictly speaking, properties should only be specified when the
+ //terminus is dynamic. However we will not enforce that here. If
+ //properties are set on the attach request, we will set them on
+ //our reply. This allows the 'create' and 'assert' options in the
+ //qpid messaging API to be implemented over 1.0.
+ node.properties.read(pn_terminus_properties(terminus));
+
if (node.topic) node.exchange = node.topic->getExchange();
- if (node.exchange && !node.queue && is_capability_requested(CREATE_ON_DEMAND, pn_terminus_capabilities(terminus))) {
- node.properties.read(pn_terminus_properties(terminus));
+ if (node.exchange && !node.queue && createOnDemand) {
if (!node.properties.getExchangeType().empty() && node.properties.getExchangeType() != node.exchange->getType()) {
+ //emulate 0-10 exchange-declare behaviour
throw Exception(qpid::amqp::error_conditions::PRECONDITION_FAILED, "Exchange of different type already exists");
}
}
if (!node.queue && !node.exchange) {
- if (pn_terminus_is_dynamic(terminus) || is_capability_requested(CREATE_ON_DEMAND, pn_terminus_capabilities(terminus))) {
+ if (pn_terminus_is_dynamic(terminus) || createOnDemand) {
//is it a queue or an exchange?
- node.properties.read(pn_terminus_properties(terminus));
if (node.properties.isQueue()) {
node.queue = connection.getBroker().createQueue(name, node.properties.getQueueSettings(), this, node.properties.getAlternateExchange(), connection.getUserId(), connection.getId()).first;
} else {
qpid::framing::FieldTable args;
+ qpid::amqp_0_10::translate(node.properties.getProperties(), args);
node.exchange = connection.getBroker().createExchange(name, node.properties.getExchangeType(), node.properties.isDurable(), node.properties.getAlternateExchange(),
args, connection.getUserId(), connection.getId()).first;
}
- node.created = true;
} else {
size_t i = name.find('@');
if (i != std::string::npos && (i+1) < name.length()) {
@@ -320,12 +330,11 @@ void Session::setupIncoming(pn_link_t* link, pn_terminus_t* target, const std::s
if (node.queue) {
setCapabilities(pn_terminus_capabilities(target), pn_terminus_capabilities(pn_link_target(link)), node.queue);
authorise.incoming(node.queue);
+ node.properties.write(pn_terminus_properties(pn_link_target(link)), node.queue);
} else if (node.exchange) {
setCapabilities(pn_terminus_capabilities(target), pn_terminus_capabilities(pn_link_target(link)), node.exchange);
authorise.incoming(node.exchange);
- }
- if (node.created) {
- node.properties.write(pn_terminus_properties(pn_link_target(link)));
+ node.properties.write(pn_terminus_properties(pn_link_target(link)), node.exchange);
}
const char* sourceAddress = pn_terminus_get_address(pn_link_remote_source(link));
@@ -357,10 +366,12 @@ void Session::setupIncoming(pn_link_t* link, pn_terminus_t* target, const std::s
void Session::setupOutgoing(pn_link_t* link, pn_terminus_t* source, const std::string& name)
{
ResolvedNode node = resolve(name, source, false);
- if (node.queue) setCapabilities(pn_terminus_capabilities(source), pn_terminus_capabilities(pn_link_source(link)), node.queue);
- else if (node.exchange) setCapabilities(pn_terminus_capabilities(source), pn_terminus_capabilities(pn_link_source(link)), node.exchange);
- if (node.created) {
- node.properties.write(pn_terminus_properties(pn_link_source(link)));
+ if (node.queue) {
+ setCapabilities(pn_terminus_capabilities(source), pn_terminus_capabilities(pn_link_source(link)), node.queue);
+ node.properties.write(pn_terminus_properties(pn_link_source(link)), node.queue);
+ } else if (node.exchange) {
+ setCapabilities(pn_terminus_capabilities(source), pn_terminus_capabilities(pn_link_source(link)), node.exchange);
+ node.properties.write(pn_terminus_properties(pn_link_source(link)), node.exchange);
}
Filter filter;
@@ -385,11 +396,14 @@ void Session::setupOutgoing(pn_link_t* link, pn_terminus_t* source, const std::s
authorise.access(node.exchange);//do separate access check before trying to create the queue
bool shared = is_capability_requested(SHARED, pn_terminus_capabilities(source));
bool durable = pn_terminus_get_durability(source);
- QueueSettings settings(durable, !durable);
+ bool autodelete = !durable && pn_link_remote_snd_settle_mode(link) == PN_SND_SETTLED;
+ QueueSettings settings(durable, autodelete);
+ std::string altExchange;
if (node.topic) {
settings = node.topic->getPolicy();
settings.durable = durable;
- settings.autodelete = !durable;
+ settings.autodelete = autodelete;
+ altExchange = node.topic->getAlternateExchange();
}
settings.autoDeleteDelay = pn_terminus_get_timeout(source);
if (settings.autoDeleteDelay) {
@@ -408,7 +422,7 @@ void Session::setupOutgoing(pn_link_t* link, pn_terminus_t* source, const std::s
queueName << connection.getContainerId() << "_" << pn_link_name(link);
}
boost::shared_ptr<qpid::broker::Queue> queue
- = connection.getBroker().createQueue(queueName.str(), settings, this, "", connection.getUserId(), connection.getId()).first;
+ = connection.getBroker().createQueue(queueName.str(), settings, this, altExchange, connection.getUserId(), connection.getId()).first;
if (!shared) queue->setExclusiveOwner(this);
authorise.outgoing(node.exchange, queue, filter);
filter.bind(node.exchange, queue);
@@ -607,6 +621,11 @@ void IncomingToExchange::handle(qpid::broker::Message& message)
authorise.route(exchange, message);
DeliverableMessage deliverable(message, 0);
exchange->route(deliverable);
+ if (!deliverable.delivered) {
+ if (exchange->getAlternate()) {
+ exchange->getAlternate()->route(deliverable);
+ }
+ }
}
}}} // namespace qpid::broker::amqp
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.h b/qpid/cpp/src/qpid/broker/amqp/Session.h
index b94d3c226d..a991ac9e3e 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Session.h
+++ b/qpid/cpp/src/qpid/broker/amqp/Session.h
@@ -100,8 +100,6 @@ class Session : public ManagedSession, public boost::enable_shared_from_this<Ses
boost::shared_ptr<qpid::broker::amqp::Topic> topic;
boost::shared_ptr<Relay> relay;
NodeProperties properties;
- bool created;
- ResolvedNode() : created(false) {}
};
ResolvedNode resolve(const std::string name, pn_terminus_t* terminus, bool incoming);
diff --git a/qpid/cpp/src/qpid/broker/amqp/Topic.cpp b/qpid/cpp/src/qpid/broker/amqp/Topic.cpp
index 4bb581628b..9640988834 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Topic.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Topic.cpp
@@ -31,6 +31,7 @@ namespace {
const std::string TOPIC("topic");
const std::string EXCHANGE("exchange");
const std::string DURABLE("durable");
+const std::string ALTERNATE_EXCHANGE("alternate-exchange");
const std::string EMPTY;
std::string getProperty(const std::string& k, const qpid::types::Variant::Map& m)
@@ -52,22 +53,25 @@ qpid::types::Variant::Map filter(const qpid::types::Variant::Map& properties)
qpid::types::Variant::Map filtered = properties;
filtered.erase(DURABLE);
filtered.erase(EXCHANGE);
+ filtered.erase(ALTERNATE_EXCHANGE);
return filtered;
}
}
Topic::Topic(Broker& broker, const std::string& n, const qpid::types::Variant::Map& properties)
- : PersistableObject(n, TOPIC, properties), name(n), durable(testProperty(DURABLE, properties)), exchange(broker.getExchanges().get(getProperty(EXCHANGE, properties)))
+ : PersistableObject(n, TOPIC, properties), name(n), durable(testProperty(DURABLE, properties)), exchange(broker.getExchanges().get(getProperty(EXCHANGE, properties))),
+ alternateExchange(getProperty(ALTERNATE_EXCHANGE, properties))
{
if (exchange->getName().empty()) throw qpid::Exception("Exchange must be specified.");
qpid::types::Variant::Map unused;
- policy.populate(properties, unused);
+ qpid::types::Variant::Map filtered = filter(properties);
+ policy.populate(filtered, unused);
qpid::management::ManagementAgent* agent = broker.getManagementAgent();
if (agent != 0) {
topic = _qmf::Topic::shared_ptr(new _qmf::Topic(agent, this, name, exchange->GetManagementObject()->getObjectId(), durable));
- topic->set_properties(filter(properties));
+ topic->set_properties(filtered);
agent->addObject(topic);
}
}
@@ -99,7 +103,10 @@ const std::string& Topic::getName() const
{
return name;
}
-
+const std::string& Topic::getAlternateExchange() const
+{
+ return alternateExchange;
+}
boost::shared_ptr<Topic> TopicRegistry::createTopic(Broker& broker, const std::string& name, const qpid::types::Variant::Map& properties)
{
boost::shared_ptr<Topic> topic(new Topic(broker, name, properties));
diff --git a/qpid/cpp/src/qpid/broker/amqp/Topic.h b/qpid/cpp/src/qpid/broker/amqp/Topic.h
index decebdb0d4..e08830ba0f 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Topic.h
+++ b/qpid/cpp/src/qpid/broker/amqp/Topic.h
@@ -51,6 +51,7 @@ class Topic : public PersistableObject, public management::Manageable
~Topic();
const std::string& getName() const;
const QueueSettings& getPolicy() const;
+ const std::string& getAlternateExchange() const;
boost::shared_ptr<Exchange> getExchange();
bool isDurable() const;
boost::shared_ptr<qpid::management::ManagementObject> GetManagementObject() const;
@@ -59,6 +60,7 @@ class Topic : public PersistableObject, public management::Manageable
bool durable;
boost::shared_ptr<Exchange> exchange;
QueueSettings policy;
+ std::string alternateExchange;
qmf::org::apache::qpid::broker::Topic::shared_ptr topic;
};
diff --git a/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp b/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp
index e3a967796b..8055b3fe1a 100644
--- a/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp
@@ -52,6 +52,11 @@ uint64_t MessageTransfer::getContentSize() const
return frames.getContentSize();
}
+uint64_t MessageTransfer::getMessageSize() const
+{
+ return getRequiredCredit();
+}
+
std::string MessageTransfer::getAnnotationAsString(const std::string& key) const
{
const qpid::framing::MessageProperties* mp = getProperties<qpid::framing::MessageProperties>();
@@ -180,7 +185,7 @@ class SendHeader
copy.castBody<AMQHeaderBody>()->get<MessageProperties>(true);
for (qpid::types::Variant::Map::const_iterator i = annotations.begin();
i != annotations.end(); ++i) {
- props->getApplicationHeaders().setString(i->first, i->second.asString());
+ props->getApplicationHeaders().set(i->first, qpid::amqp_0_10::translate(i->second));
}
}
if (redelivered || ttl || timestamp) {
@@ -397,7 +402,7 @@ boost::intrusive_ptr<PersistableMessage> MessageTransfer::merge(const std::map<s
boost::intrusive_ptr<MessageTransfer> clone(new MessageTransfer(this->frames));
qpid::framing::MessageProperties* mp = clone->frames.getHeaders()->get<qpid::framing::MessageProperties>(true);
for (qpid::types::Variant::Map::const_iterator i = annotations.begin(); i != annotations.end(); ++i) {
- mp->getApplicationHeaders().setString(i->first, i->second);
+ mp->getApplicationHeaders().set(i->first, qpid::amqp_0_10::translate(i->second));
}
return clone;
}
diff --git a/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h b/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h
index d32c0d07fd..422446db51 100644
--- a/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h
+++ b/qpid/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h
@@ -45,6 +45,7 @@ class MessageTransfer : public qpid::broker::Message::Encoding, public qpid::bro
bool isPersistent() const;
uint8_t getPriority() const;
uint64_t getContentSize() const;
+ uint64_t getMessageSize() const;
qpid::amqp::MessageId getMessageId() const;
qpid::amqp::MessageId getCorrelationId() const;
std::string getPropertyAsString(const std::string& key) const;
diff --git a/qpid/cpp/src/qpid/client/QueueOptions.cpp b/qpid/cpp/src/qpid/client/QueueOptions.cpp
index 460f3f5490..e589bd76cd 100644
--- a/qpid/cpp/src/qpid/client/QueueOptions.cpp
+++ b/qpid/cpp/src/qpid/client/QueueOptions.cpp
@@ -38,7 +38,6 @@ const std::string QueueOptions::strFLOW_TO_DISK("flow_to_disk");
const std::string QueueOptions::strRING("ring");
const std::string QueueOptions::strRING_STRICT("ring_strict");
const std::string QueueOptions::strLastValueQueue("qpid.last_value_queue");
-const std::string QueueOptions::strPersistLastNode("qpid.persist_last_node");
const std::string QueueOptions::strLVQMatchProperty("qpid.LVQ_key");
const std::string QueueOptions::strLastValueQueueNoBrowse("qpid.last_value_queue_no_browse");
const std::string QueueOptions::strQueueEventMode("qpid.queue_event_generation");
@@ -74,11 +73,6 @@ void QueueOptions::setSizePolicy(QueueSizePolicy sp, uint64_t maxSize, uint32_t
}
-void QueueOptions::setPersistLastNode()
-{
- setInt(strPersistLastNode, 1);
-}
-
void QueueOptions::setOrdering(QueueOrderingPolicy op)
{
if (op == LVQ){
@@ -102,11 +96,6 @@ void QueueOptions::clearSizePolicy()
erase(strTypeKey);
}
-void QueueOptions::clearPersistLastNode()
-{
- erase(strPersistLastNode);
-}
-
void QueueOptions::clearOrdering()
{
erase(strLastValueQueue);
diff --git a/qpid/cpp/src/qpid/client/QueueOptions.h b/qpid/cpp/src/qpid/client/QueueOptions.h
index 3984b63fdd..a2f30a50b5 100644
--- a/qpid/cpp/src/qpid/client/QueueOptions.h
+++ b/qpid/cpp/src/qpid/client/QueueOptions.h
@@ -56,12 +56,6 @@ class QPID_CLIENT_CLASS_EXTERN QueueOptions: public framing::FieldTable
QPID_CLIENT_EXTERN void setSizePolicy(QueueSizePolicy sp, uint64_t maxSize, uint32_t maxCount );
/**
- * Enables the persisting of a queue to the store module when a cluster fails down to it's last
- * node. Does so optimistically. Will start persisting when cluster count >1 again.
- */
- QPID_CLIENT_EXTERN void setPersistLastNode();
-
- /**
* Sets the odering policy on the Queue, default ordering is FIFO.
*/
QPID_CLIENT_EXTERN void setOrdering(QueueOrderingPolicy op);
@@ -72,11 +66,6 @@ class QPID_CLIENT_CLASS_EXTERN QueueOptions: public framing::FieldTable
QPID_CLIENT_EXTERN void clearSizePolicy();
/**
- * Clear Persist Last Node Policy
- */
- QPID_CLIENT_EXTERN void clearPersistLastNode();
-
- /**
* get the key used match LVQ in args for message transfer
*/
QPID_CLIENT_EXTERN void getLVQKey(std::string& key);
@@ -116,7 +105,6 @@ class QPID_CLIENT_CLASS_EXTERN QueueOptions: public framing::FieldTable
static QPID_CLIENT_EXTERN const std::string strRING;
static QPID_CLIENT_EXTERN const std::string strRING_STRICT;
static QPID_CLIENT_EXTERN const std::string strLastValueQueue;
- static QPID_CLIENT_EXTERN const std::string strPersistLastNode;
static QPID_CLIENT_EXTERN const std::string strLVQMatchProperty;
static QPID_CLIENT_EXTERN const std::string strLastValueQueueNoBrowse;
static QPID_CLIENT_EXTERN const std::string strQueueEventMode;
diff --git a/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp b/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
index 982bfa3503..71527bc323 100644
--- a/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
+++ b/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
@@ -490,7 +490,7 @@ void SessionImpl::releaseImpl(qpid::messaging::Message& m)
{
SequenceSet set;
set.add(MessageImplAccess::get(m).getInternalId());
- session.messageRelease(set);
+ session.messageRelease(set, true);
}
void SessionImpl::receiverCancelled(const std::string& name)
diff --git a/qpid/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp b/qpid/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp
index f820c3c075..270ebdd69e 100644
--- a/qpid/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp
+++ b/qpid/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp
@@ -270,12 +270,14 @@ deq_rec::decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t max_
// Get and check header
_deq_hdr.hdr_copy(h);
rd_cnt = sizeof(rec_hdr);
- _deq_hdr._deq_rid = *(u_int64_t*)((char*)rptr + rd_cnt);
+ //_deq_hdr._deq_rid = *(u_int64_t*)((char*)rptr + rd_cnt);
+ std::memcpy((void*)&_deq_hdr._deq_rid, (char*)rptr + rd_cnt, sizeof(u_int64_t));
rd_cnt += sizeof(u_int64_t);
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
rd_cnt += sizeof(u_int32_t); // Filler 0
#endif
- _deq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ //_deq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ std::memcpy((void*)&_deq_hdr._xidsize, (char*)rptr + rd_cnt, sizeof(std::size_t));
rd_cnt = _deq_hdr.size();
chk_hdr();
if (_deq_hdr._xidsize)
diff --git a/qpid/cpp/src/qpid/legacystore/jrnl/enq_rec.cpp b/qpid/cpp/src/qpid/legacystore/jrnl/enq_rec.cpp
index 468599836b..94f42066a0 100644
--- a/qpid/cpp/src/qpid/legacystore/jrnl/enq_rec.cpp
+++ b/qpid/cpp/src/qpid/legacystore/jrnl/enq_rec.cpp
@@ -360,7 +360,8 @@ enq_rec::decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t max_
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
rd_cnt += sizeof(u_int32_t); // Filler 0
#endif
- _enq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ //_enq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ std::memcpy((void*)&_enq_hdr._xidsize, (char*)rptr + rd_cnt, sizeof(std::size_t));
rd_cnt += sizeof(std::size_t);
#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
rd_cnt += sizeof(u_int32_t); // Filler 0
@@ -368,7 +369,8 @@ enq_rec::decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t max_
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
rd_cnt += sizeof(u_int32_t); // Filler 1
#endif
- _enq_hdr._dsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ //_enq_hdr._dsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ std::memcpy((void*)&_enq_hdr._dsize, (char*)rptr + rd_cnt, sizeof(std::size_t));
rd_cnt = _enq_hdr.size();
chk_hdr();
if (_enq_hdr._xidsize + (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize))
diff --git a/qpid/cpp/src/qpid/legacystore/jrnl/txn_rec.cpp b/qpid/cpp/src/qpid/legacystore/jrnl/txn_rec.cpp
index 918a6ce902..1008e7700e 100644
--- a/qpid/cpp/src/qpid/legacystore/jrnl/txn_rec.cpp
+++ b/qpid/cpp/src/qpid/legacystore/jrnl/txn_rec.cpp
@@ -270,7 +270,8 @@ txn_rec::decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t max_
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
rd_cnt += sizeof(u_int32_t); // Filler 0
#endif
- _txn_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ //_txn_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
+ std::memcpy((void*)&_txn_hdr._xidsize, (char*)rptr + rd_cnt, sizeof(std::size_t));
rd_cnt = _txn_hdr.size();
chk_hdr();
_buff = std::malloc(_txn_hdr._xidsize);
diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
index d80dd6e6a3..d4a07f407c 100644
--- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
@@ -2122,19 +2122,21 @@ bool ManagementAgent::authorizeAgentMessage(Message& msg)
string methodName;
string cid;
+ boost::intrusive_ptr<const qpid::broker::amqp_0_10::MessageTransfer> transfer = protocols->translate(msg);
//
- // If the message is larger than our working buffer size, we can't determine if it's
- // authorized or not. In this case, return true (authorized) if there is no ACL in place,
- // otherwise return false;
+ // If the message is larger than our working buffer size (or if it
+ // could not be converted to an 0-10 messgae-transfer), we can't
+ // determine if it's authorized or not. In this case, return true
+ // (authorized) if there is no ACL in place, otherwise return
+ // false;
//
- if (msg.getContentSize() > qmfV1BufferSize)
+ if (!transfer || transfer->getContentSize() > qmfV1BufferSize)
return broker->getAcl() == 0;
- inBuffer.putRawData(msg.getContent());
+ inBuffer.putRawData(transfer->getContent());
uint32_t bufferLen = inBuffer.getPosition();
inBuffer.reset();
- boost::intrusive_ptr<const qpid::broker::amqp_0_10::MessageTransfer> transfer = protocols->translate(msg);
const framing::MessageProperties* p =
transfer ? transfer->getFrames().getHeaders()->get<framing::MessageProperties>() : 0;
@@ -2283,13 +2285,13 @@ void ManagementAgent::dispatchAgentCommand(Message& msg, bool viaLocal)
ResizableBuffer inBuffer(qmfV1BufferSize);
uint8_t opcode;
- if (msg.getContentSize() > qmfV1BufferSize) {
+ if (transfer->getContentSize() > qmfV1BufferSize) {
QPID_LOG(debug, "ManagementAgent::dispatchAgentCommandLH: Message too large: " <<
- msg.getContentSize());
+ transfer->getContentSize());
return;
}
- inBuffer.putRawData(msg.getContent());
+ inBuffer.putRawData(transfer->getContent());
uint32_t bufferLen = inBuffer.getPosition();
inBuffer.reset();
diff --git a/qpid/cpp/src/qpid/messaging/Connection.cpp b/qpid/cpp/src/qpid/messaging/Connection.cpp
index 71618d1057..c8a60fc56b 100644
--- a/qpid/cpp/src/qpid/messaging/Connection.cpp
+++ b/qpid/cpp/src/qpid/messaging/Connection.cpp
@@ -31,6 +31,9 @@
namespace qpid {
namespace messaging {
+// Explicitly instantiate Handle superclass
+template class Handle<ConnectionImpl>;
+
using namespace qpid::types;
typedef PrivateImplRef<qpid::messaging::Connection> PI;
diff --git a/qpid/cpp/src/qpid/messaging/HandleInstantiator.cpp b/qpid/cpp/src/qpid/messaging/HandleInstantiator.cpp
deleted file mode 100644
index c9a7680bb4..0000000000
--- a/qpid/cpp/src/qpid/messaging/HandleInstantiator.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * 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/messaging/Connection.h"
-#include "qpid/messaging/Receiver.h"
-#include "qpid/messaging/Sender.h"
-#include "qpid/messaging/Session.h"
-
-namespace qpid {
-namespace messaging {
-
-using namespace qpid::types;
-
-void HandleInstantiatorDoNotCall(void)
-{
- // This function exists to instantiate various template Handle
- // bool functions. The instances are then available to
- // the qpidmessaging DLL and subsequently exported.
- // This function must not be exported nor called called.
- // For further information refer to
- // https://issues.apache.org/jira/browse/QPID-2926
-
- Connection connection;
- if (connection.isValid()) connection.close();
- if (connection.isNull() ) connection.close();
- if (connection ) connection.close();
- if (!connection ) connection.close();
-
- Receiver receiver;
- if (receiver.isValid()) receiver.close();
- if (receiver.isNull() ) receiver.close();
- if (receiver ) receiver.close();
- if (!receiver ) receiver.close();
-
- Sender sender;
- if (sender.isValid()) sender.close();
- if (sender.isNull() ) sender.close();
- if (sender ) sender.close();
- if (!sender ) sender.close();
-
- Session session;
- if (session.isValid()) session.close();
- if (session.isNull() ) session.close();
- if (session ) session.close();
- if (!session ) session.close();
-}
-}} // namespace qpid::messaging
diff --git a/qpid/cpp/src/qpid/messaging/ProtocolRegistry.cpp b/qpid/cpp/src/qpid/messaging/ProtocolRegistry.cpp
index 0232da8ae1..9e1e5f23fe 100644
--- a/qpid/cpp/src/qpid/messaging/ProtocolRegistry.cpp
+++ b/qpid/cpp/src/qpid/messaging/ProtocolRegistry.cpp
@@ -19,7 +19,7 @@
*
*/
#include "ProtocolRegistry.h"
-#include "qpid/Exception.h"
+#include "qpid/messaging/exceptions.h"
#include "qpid/client/amqp0_10/ConnectionImpl.h"
#include "qpid/client/LoadPlugins.h"
#include <map>
@@ -61,7 +61,7 @@ ConnectionImpl* ProtocolRegistry::create(const std::string& url, const Variant::
Registry::const_iterator i = theRegistry().find(name.asString());
if (i != theRegistry().end()) return (i->second)(url, stripped);
else if (name.asString() == "amqp0-10") return new qpid::client::amqp0_10::ConnectionImpl(url, stripped);
- else throw qpid::Exception("Unsupported protocol: " + name.asString());
+ else throw MessagingException("Unsupported protocol: " + name.asString());
}
return 0;
}
diff --git a/qpid/cpp/src/qpid/messaging/Receiver.cpp b/qpid/cpp/src/qpid/messaging/Receiver.cpp
index f60e5f55b3..18670ec068 100644
--- a/qpid/cpp/src/qpid/messaging/Receiver.cpp
+++ b/qpid/cpp/src/qpid/messaging/Receiver.cpp
@@ -29,6 +29,9 @@
namespace qpid {
namespace messaging {
+// Explicitly instantiate Handle superclass
+template class Handle<ReceiverImpl>;
+
typedef PrivateImplRef<qpid::messaging::Receiver> PI;
Receiver::Receiver(ReceiverImpl* impl) { PI::ctor(*this, impl); }
diff --git a/qpid/cpp/src/qpid/messaging/Sender.cpp b/qpid/cpp/src/qpid/messaging/Sender.cpp
index a60de3d606..a26f2544c8 100644
--- a/qpid/cpp/src/qpid/messaging/Sender.cpp
+++ b/qpid/cpp/src/qpid/messaging/Sender.cpp
@@ -27,6 +27,10 @@
namespace qpid {
namespace messaging {
+
+// Explicitly instantiate Handle superclass
+template class Handle<SenderImpl>;
+
typedef PrivateImplRef<qpid::messaging::Sender> PI;
Sender::Sender(SenderImpl* impl) { PI::ctor(*this, impl); }
diff --git a/qpid/cpp/src/qpid/messaging/Session.cpp b/qpid/cpp/src/qpid/messaging/Session.cpp
index cccfd9a873..fd0519705d 100644
--- a/qpid/cpp/src/qpid/messaging/Session.cpp
+++ b/qpid/cpp/src/qpid/messaging/Session.cpp
@@ -30,6 +30,9 @@
namespace qpid {
namespace messaging {
+// Explicitly instantiate Handle superclass
+template class Handle<SessionImpl>;
+
typedef PrivateImplRef<qpid::messaging::Session> PI;
Session::Session(SessionImpl* impl) { PI::ctor(*this, impl); }
diff --git a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
index beac50cdac..9d0f60a8b7 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
@@ -22,6 +22,7 @@
#include "qpid/messaging/Address.h"
#include "qpid/messaging/AddressImpl.h"
#include "qpid/amqp/descriptors.h"
+#include "qpid/types/encodings.h"
#include "qpid/log/Statement.h"
#include <vector>
#include <set>
@@ -290,6 +291,127 @@ void write(pn_data_t* data, const Variant& value)
break;
}
}
+bool read(pn_data_t* data, pn_type_t type, qpid::types::Variant& value);
+bool read(pn_data_t* data, qpid::types::Variant& value)
+{
+ return read(data, pn_data_type(data), value);
+}
+void readList(pn_data_t* data, qpid::types::Variant::List& value)
+{
+ size_t count = pn_data_get_list(data);
+ pn_data_enter(data);
+ for (size_t i = 0; i < count && pn_data_next(data); ++i) {
+ qpid::types::Variant e;
+ if (read(data, e)) value.push_back(e);
+ }
+ pn_data_exit(data);
+}
+void readMap(pn_data_t* data, qpid::types::Variant::Map& value)
+{
+ size_t count = pn_data_get_list(data);
+ pn_data_enter(data);
+ for (size_t i = 0; i < (count/2) && pn_data_next(data); ++i) {
+ std::string key = convert(pn_data_get_symbol(data));
+ pn_data_next(data);
+ qpid::types::Variant e;
+ if (read(data, e)) value[key]= e;
+ }
+ pn_data_exit(data);
+}
+void readArray(pn_data_t* data, qpid::types::Variant::List& value)
+{
+ size_t count = pn_data_get_array(data);
+ pn_type_t type = pn_data_get_array_type(data);
+ pn_data_enter(data);
+ for (size_t i = 0; i < count && pn_data_next(data); ++i) {
+ qpid::types::Variant e;
+ if (read(data, type, e)) value.push_back(e);
+ }
+ pn_data_exit(data);
+}
+bool read(pn_data_t* data, pn_type_t type, qpid::types::Variant& value)
+{
+ switch (type) {
+ case PN_NULL:
+ if (value.getType() != qpid::types::VAR_VOID) value = qpid::types::Variant();
+ return true;
+ case PN_BOOL:
+ value = pn_data_get_bool(data);
+ return true;
+ case PN_UBYTE:
+ value = pn_data_get_ubyte(data);
+ return true;
+ case PN_BYTE:
+ value = pn_data_get_byte(data);
+ return true;
+ case PN_USHORT:
+ value = pn_data_get_ushort(data);
+ return true;
+ case PN_SHORT:
+ value = pn_data_get_short(data);
+ return true;
+ case PN_UINT:
+ value = pn_data_get_uint(data);
+ return true;
+ case PN_INT:
+ value = pn_data_get_int(data);
+ return true;
+ case PN_CHAR:
+ value = pn_data_get_char(data);
+ return true;
+ case PN_ULONG:
+ value = pn_data_get_ulong(data);
+ return true;
+ case PN_LONG:
+ value = pn_data_get_long(data);
+ return true;
+ case PN_TIMESTAMP:
+ value = pn_data_get_timestamp(data);
+ return true;
+ case PN_FLOAT:
+ value = pn_data_get_float(data);
+ return true;
+ case PN_DOUBLE:
+ value = pn_data_get_double(data);
+ return true;
+ case PN_UUID:
+ value = qpid::types::Uuid(pn_data_get_uuid(data).bytes);
+ return true;
+ case PN_BINARY:
+ value = convert(pn_data_get_binary(data));
+ value.setEncoding(qpid::types::encodings::BINARY);
+ return true;
+ case PN_STRING:
+ value = convert(pn_data_get_string(data));
+ value.setEncoding(qpid::types::encodings::UTF8);
+ return true;
+ case PN_SYMBOL:
+ value = convert(pn_data_get_string(data));
+ value.setEncoding(qpid::types::encodings::ASCII);
+ return true;
+ case PN_LIST:
+ value = qpid::types::Variant::List();
+ readList(data, value.asList());
+ return true;
+ break;
+ case PN_MAP:
+ value = qpid::types::Variant::Map();
+ readMap(data, value.asMap());
+ return true;
+ case PN_ARRAY:
+ value = qpid::types::Variant::List();
+ readArray(data, value.asList());
+ return true;
+ case PN_DESCRIBED:
+ case PN_DECIMAL32:
+ case PN_DECIMAL64:
+ case PN_DECIMAL128:
+ default:
+ return false;
+ }
+
+}
+
const uint32_t DEFAULT_DURABLE_TIMEOUT(15*60);//15 minutes
const uint32_t DEFAULT_TIMEOUT(0);
}
@@ -354,7 +476,7 @@ AddressHelper::AddressHelper(const Address& address) :
properties[LIFETIME_POLICY] = DELETE_ON_CLOSE;
}
- if (properties.size() && !(isTemporary || createPolicy.size())) {
+ if (properties.size() && !(isTemporary || !createPolicy.empty() || !assertPolicy.empty())) {
QPID_LOG(warning, "Properties will be ignored! " << address);
}
@@ -420,10 +542,48 @@ void AddressHelper::addFilter(const std::string& name, const std::string& descri
filters.push_back(Filter(name, descriptor, value));
}
+namespace {
+bool checkLifetimePolicy(const std::string& requested, const std::string& actual)
+{
+ if (actual == qpid::amqp::lifetime_policy::DELETE_ON_CLOSE_SYMBOL && requested == DELETE_ON_CLOSE) return true;
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_SYMBOL && requested == DELETE_IF_UNUSED) return true;
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_MESSAGES_SYMBOL && requested == DELETE_IF_EMPTY) return true;
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_OR_MESSAGES_SYMBOL && requested == DELETE_IF_UNUSED_AND_EMPTY) return true;
+ else return actual == requested;
+}
+bool checkLifetimePolicy(const std::string& requested, uint64_t actual)
+{
+ if (actual == qpid::amqp::lifetime_policy::DELETE_ON_CLOSE_CODE)
+ return checkLifetimePolicy(requested, qpid::amqp::lifetime_policy::DELETE_ON_CLOSE_SYMBOL);
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_CODE)
+ return checkLifetimePolicy(requested, qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_SYMBOL);
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_MESSAGES_CODE)
+ return checkLifetimePolicy(requested, qpid::amqp::lifetime_policy::DELETE_ON_NO_MESSAGES_SYMBOL);
+ else if (actual == qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_OR_MESSAGES_CODE)
+ return checkLifetimePolicy(requested, qpid::amqp::lifetime_policy::DELETE_ON_NO_LINKS_OR_MESSAGES_SYMBOL);
+ else
+ return false;
+}
+bool checkLifetimePolicy(const std::string& requested, pn_data_t* actual)
+{
+ bool result(false);
+ if (pn_data_is_described(actual)) {
+ pn_data_enter(actual);
+ pn_data_next(actual);
+ if (pn_data_type(actual) == PN_ULONG) {
+ result = checkLifetimePolicy(requested, pn_data_get_ulong(actual));
+ } else if (pn_data_type(actual) == PN_SYMBOL) {
+ result = checkLifetimePolicy(requested, convert(pn_data_get_symbol(actual)));
+ }
+ pn_data_exit(actual);
+ }
+ return result;
+}
+}
void AddressHelper::checkAssertion(pn_terminus_t* terminus, CheckMode mode)
{
if (assertEnabled(mode)) {
- QPID_LOG(debug, "checking assertions: " << capabilities);
+ QPID_LOG(debug, "checking capabilities: " << capabilities);
//ensure all desired capabilities have been offered
std::set<std::string> desired;
for (Variant::List::const_iterator i = capabilities.begin(); i != capabilities.end(); ++i) {
@@ -493,6 +653,40 @@ void AddressHelper::checkAssertion(pn_terminus_t* terminus, CheckMode mode)
}
}
if (!first) throw qpid::messaging::AssertionFailed(missing.str());
+
+ //assert on properties (Note: this violates the AMQP 1.0
+ //specification - as does the create option - by sending
+ //node-properties even if the dynamic option is not
+ //set. However this can be avoided by not specifying any node
+ //properties when asserting)
+ if (!type.empty() || durableNode || !properties.empty()) {
+ qpid::types::Variant::Map requested = properties;
+ if (!type.empty()) requested[SUPPORTED_DIST_MODES] = type == TOPIC ? COPY : MOVE;
+ if (durableNode) requested[DURABLE] = true;
+
+ data = pn_terminus_properties(terminus);
+ if (pn_data_next(data)) {
+ size_t count = pn_data_get_map(data);
+ pn_data_enter(data);
+ for (size_t i = 0; i < count && pn_data_next(data); ++i) {
+ std::string key = convert(pn_data_get_symbol(data));
+ pn_data_next(data);
+ qpid::types::Variant::Map::const_iterator j = requested.find(key);
+ qpid::types::Variant v;
+ if (j != requested.end() &&
+ ((key == LIFETIME_POLICY && checkLifetimePolicy(j->second.asString(), data)) ||
+ (read(data, v) && v.asString() == j->second.asString()))) {
+ requested.erase(j->first);
+ }
+ }
+ pn_data_exit(data);
+ if (!requested.empty()) {
+ std::stringstream missing;
+ missing << "Requested node properties not met: " << requested;
+ throw qpid::messaging::AssertionFailed(missing.str());
+ }
+ }
+ }
}
}
@@ -582,6 +776,8 @@ void AddressHelper::configure(pn_link_t* link, pn_terminus_t* terminus, CheckMod
//application expects name of node to be as specified
setNodeProperties(terminus);
createOnDemand = true;
+ } else if (assertEnabled(mode)) {
+ setNodeProperties(terminus);
}
}
@@ -616,6 +812,13 @@ void AddressHelper::configure(pn_link_t* link, pn_terminus_t* terminus, CheckMod
}
if (isUnreliable()) {
pn_link_set_snd_settle_mode(link, PN_SND_SETTLED);
+ } else if (!reliability.empty()) {
+ if (reliability == EXACTLY_ONCE ) {
+ QPID_LOG(warning, "Unsupported reliability mode: " << reliability);
+ } else if (reliability != AT_LEAST_ONCE ) {
+ QPID_LOG(warning, "Unrecognised reliability mode: " << reliability);
+ }
+ pn_link_set_snd_settle_mode(link, PN_SND_UNSETTLED);
}
}
@@ -688,7 +891,7 @@ void AddressHelper::setNodeProperties(pn_terminus_t* terminus)
putLifetimePolicy(data, toLifetimePolicy(i->second.asString()));
} else {
pn_data_put_symbol(data, convert(i->first));
- pn_data_put_string(data, convert(i->second.asString()));
+ write(data, i->second);
}
}
pn_data_exit(data);
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
index dba5cb1e1c..b230aeaf0d 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
@@ -234,6 +234,14 @@ void ConnectionContext::acknowledge(boost::shared_ptr<SessionContext> ssn, qpid:
wakeupDriver();
}
+void ConnectionContext::nack(boost::shared_ptr<SessionContext> ssn, qpid::messaging::Message& message, bool reject)
+{
+ qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);
+ checkClosed(ssn);
+ ssn->nack(MessageImplAccess::get(message).getInternalId(), reject);
+ wakeupDriver();
+}
+
void ConnectionContext::detach(boost::shared_ptr<SessionContext> ssn, boost::shared_ptr<SenderContext> lnk)
{
qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);
@@ -468,6 +476,15 @@ void ConnectionContext::checkClosed(boost::shared_ptr<SessionContext> ssn)
}
}
+bool ConnectionContext::isClosed(boost::shared_ptr<SessionContext> ssn, boost::shared_ptr<ReceiverContext> lnk)
+{
+ try {
+ checkClosed(ssn, lnk->receiver);
+ return false;
+ } catch (const LinkError&) {
+ return true;
+ }
+}
void ConnectionContext::checkClosed(boost::shared_ptr<SessionContext> ssn, boost::shared_ptr<ReceiverContext> lnk)
{
checkClosed(ssn, lnk->receiver);
@@ -584,7 +601,7 @@ std::size_t ConnectionContext::decodePlain(const char* buffer, std::size_t size)
lock.notifyAll();
return n;
} else if (n == PN_ERR) {
- throw qpid::Exception(QPID_MSG("Error on input: " << getError()));
+ throw MessagingException(QPID_MSG("Error on input: " << getError()));
} else {
return 0;
}
@@ -608,7 +625,7 @@ std::size_t ConnectionContext::encodePlain(char* buffer, std::size_t size)
haveOutput = true;
return n;
} else if (n == PN_ERR) {
- throw qpid::Exception(QPID_MSG("Error on output: " << getError()));
+ throw MessagingException(QPID_MSG("Error on output: " << getError()));
} else if (n == PN_EOS) {
haveOutput = false;
return 0;//Is this right?
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h
index 2fdba7a3b2..b31ffe62e9 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h
+++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h
@@ -77,10 +77,12 @@ class ConnectionContext : public qpid::sys::ConnectionCodec, public qpid::messag
void attach(boost::shared_ptr<SessionContext>, boost::shared_ptr<ReceiverContext>);
void detach(boost::shared_ptr<SessionContext>, boost::shared_ptr<SenderContext>);
void detach(boost::shared_ptr<SessionContext>, boost::shared_ptr<ReceiverContext>);
+ bool isClosed(boost::shared_ptr<SessionContext>, boost::shared_ptr<ReceiverContext>);
void send(boost::shared_ptr<SessionContext>, boost::shared_ptr<SenderContext> ctxt, const qpid::messaging::Message& message, bool sync);
bool fetch(boost::shared_ptr<SessionContext> ssn, boost::shared_ptr<ReceiverContext> lnk, qpid::messaging::Message& message, qpid::messaging::Duration timeout);
bool get(boost::shared_ptr<SessionContext> ssn, boost::shared_ptr<ReceiverContext> lnk, qpid::messaging::Message& message, qpid::messaging::Duration timeout);
void acknowledge(boost::shared_ptr<SessionContext> ssn, qpid::messaging::Message* message, bool cumulative);
+ void nack(boost::shared_ptr<SessionContext> ssn, qpid::messaging::Message& message, bool reject);
void setOption(const std::string& name, const qpid::types::Variant& value);
std::string getAuthenticatedUsername();
diff --git a/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp b/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp
index 266060c117..504c5030a8 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp
@@ -20,7 +20,9 @@
*/
#include "qpid/messaging/amqp/EncodedMessage.h"
#include "qpid/messaging/Address.h"
+#include "qpid/messaging/exceptions.h"
#include "qpid/messaging/MessageImpl.h"
+#include "qpid/Exception.h"
#include "qpid/amqp/Decoder.h"
#include "qpid/amqp/DataBuilder.h"
#include "qpid/amqp/ListBuilder.h"
@@ -100,66 +102,73 @@ const char* EncodedMessage::getData() const
void EncodedMessage::init(qpid::messaging::MessageImpl& impl)
{
- //initial scan of raw data
- qpid::amqp::Decoder decoder(data, size);
- InitialScan reader(*this, impl);
- decoder.read(reader);
- bareMessage = reader.getBareMessage();
- if (bareMessage.data && !bareMessage.size) {
- bareMessage.size = (data + size) - bareMessage.data;
+ try {
+ //initial scan of raw data
+ qpid::amqp::Decoder decoder(data, size);
+ InitialScan reader(*this, impl);
+ decoder.read(reader);
+ bareMessage = reader.getBareMessage();
+ if (bareMessage.data && !bareMessage.size) {
+ bareMessage.size = (data + size) - bareMessage.data;
+ }
+ } catch (const qpid::Exception& e) {
+ throw FetchError(e.what());
}
-
}
void EncodedMessage::setNestAnnotationsOption(bool b) { nestAnnotations = b; }
void EncodedMessage::populate(qpid::types::Variant::Map& map) const
{
- //decode application properties
- if (applicationProperties) {
- qpid::amqp::Decoder decoder(applicationProperties.data, applicationProperties.size);
- decoder.readMap(map);
- }
- //add in 'x-amqp-' prefixed values
- if (!!firstAcquirer) {
- map["x-amqp-first-acquirer"] = firstAcquirer.get();
- }
- if (!!deliveryCount) {
- map["x-amqp-delivery-count"] = deliveryCount.get();
- }
- if (to) {
- map["x-amqp-to"] = to.str();
- }
- if (!!absoluteExpiryTime) {
- map["x-amqp-absolute-expiry-time"] = absoluteExpiryTime.get();
- }
- if (!!creationTime) {
- map["x-amqp-creation-time"] = creationTime.get();
- }
- if (groupId) {
- map["x-amqp-group-id"] = groupId.str();
- }
- if (!!groupSequence) {
- map["x-amqp-qroup-sequence"] = groupSequence.get();
- }
- if (replyToGroupId) {
- map["x-amqp-reply-to-group-id"] = replyToGroupId.str();
- }
- //add in any annotations
- if (deliveryAnnotations) {
- qpid::amqp::Decoder decoder(deliveryAnnotations.data, deliveryAnnotations.size);
- if (nestAnnotations) {
- map["x-amqp-delivery-annotations"] = decoder.readMap();
- } else {
+ try {
+ //decode application properties
+ if (applicationProperties) {
+ qpid::amqp::Decoder decoder(applicationProperties.data, applicationProperties.size);
decoder.readMap(map);
}
- }
- if (messageAnnotations) {
- qpid::amqp::Decoder decoder(messageAnnotations.data, messageAnnotations.size);
- if (nestAnnotations) {
- map["x-amqp-message-annotations"] = decoder.readMap();
- } else {
- decoder.readMap(map);
+ //add in 'x-amqp-' prefixed values
+ if (!!firstAcquirer) {
+ map["x-amqp-first-acquirer"] = firstAcquirer.get();
+ }
+ if (!!deliveryCount) {
+ map["x-amqp-delivery-count"] = deliveryCount.get();
+ }
+ if (to) {
+ map["x-amqp-to"] = to.str();
+ }
+ if (!!absoluteExpiryTime) {
+ map["x-amqp-absolute-expiry-time"] = absoluteExpiryTime.get();
+ }
+ if (!!creationTime) {
+ map["x-amqp-creation-time"] = creationTime.get();
+ }
+ if (groupId) {
+ map["x-amqp-group-id"] = groupId.str();
+ }
+ if (!!groupSequence) {
+ map["x-amqp-qroup-sequence"] = groupSequence.get();
}
+ if (replyToGroupId) {
+ map["x-amqp-reply-to-group-id"] = replyToGroupId.str();
+ }
+ //add in any annotations
+ if (deliveryAnnotations) {
+ qpid::amqp::Decoder decoder(deliveryAnnotations.data, deliveryAnnotations.size);
+ if (nestAnnotations) {
+ map["x-amqp-delivery-annotations"] = decoder.readMap();
+ } else {
+ decoder.readMap(map);
+ }
+ }
+ if (messageAnnotations) {
+ qpid::amqp::Decoder decoder(messageAnnotations.data, messageAnnotations.size);
+ if (nestAnnotations) {
+ map["x-amqp-message-annotations"] = decoder.readMap();
+ } else {
+ decoder.readMap(map);
+ }
+ }
+ } catch (const qpid::Exception& e) {
+ throw FetchError(e.what());
}
}
qpid::amqp::CharSequence EncodedMessage::getBareMessage() const
@@ -169,7 +178,15 @@ qpid::amqp::CharSequence EncodedMessage::getBareMessage() const
void EncodedMessage::getReplyTo(qpid::messaging::Address& a) const
{
- a = qpid::messaging::Address(replyTo.str());
+ std::string rt = replyTo.str();
+ std::string::size_type i = rt.find('/');
+ if (i != std::string::npos && i > 0 && rt.find('/', i+1) == std::string::npos) {
+ //handle <name>/<subject> special case
+ a.setName(rt.substr(0, i));
+ a.setSubject(rt.substr(i+1));
+ } else {
+ a.setName(rt);
+ }
}
void EncodedMessage::getSubject(std::string& s) const
{
@@ -193,35 +210,39 @@ void EncodedMessage::getCorrelationId(std::string& s) const
}
void EncodedMessage::getBody(std::string& raw, qpid::types::Variant& c) const
{
- if (!content.isVoid()) {
- c = content;//integer types, floats, bool etc
- //TODO: populate raw data?
- } else {
- if (bodyType.empty()
- || bodyType == qpid::amqp::typecodes::BINARY_NAME
- || bodyType == qpid::types::encodings::UTF8
- || bodyType == qpid::types::encodings::ASCII)
- {
- c = std::string(body.data, body.size);
- c.setEncoding(bodyType);
- } else if (bodyType == qpid::amqp::typecodes::LIST_NAME) {
- qpid::amqp::ListBuilder builder;
- qpid::amqp::Decoder decoder(body.data, body.size);
- decoder.read(builder);
- c = builder.getList();
- raw.assign(body.data, body.size);
- } else if (bodyType == qpid::amqp::typecodes::MAP_NAME) {
- qpid::amqp::DataBuilder builder = qpid::amqp::DataBuilder(qpid::types::Variant::Map());
- qpid::amqp::Decoder decoder(body.data, body.size);
- decoder.read(builder);
- c = builder.getValue().asMap();
- raw.assign(body.data, body.size);
- } else if (bodyType == qpid::amqp::typecodes::UUID_NAME) {
- if (body.size == qpid::types::Uuid::SIZE) c = qpid::types::Uuid(body.data);
- raw.assign(body.data, body.size);
- } else if (bodyType == qpid::amqp::typecodes::ARRAY_NAME) {
- raw.assign(body.data, body.size);
+ try {
+ if (!content.isVoid()) {
+ c = content;//integer types, floats, bool etc
+ //TODO: populate raw data?
+ } else {
+ if (bodyType.empty()
+ || bodyType == qpid::amqp::typecodes::BINARY_NAME
+ || bodyType == qpid::types::encodings::UTF8
+ || bodyType == qpid::types::encodings::ASCII)
+ {
+ c = std::string(body.data, body.size);
+ c.setEncoding(bodyType);
+ } else if (bodyType == qpid::amqp::typecodes::LIST_NAME) {
+ qpid::amqp::ListBuilder builder;
+ qpid::amqp::Decoder decoder(body.data, body.size);
+ decoder.read(builder);
+ c = builder.getList();
+ raw.assign(body.data, body.size);
+ } else if (bodyType == qpid::amqp::typecodes::MAP_NAME) {
+ qpid::amqp::DataBuilder builder = qpid::amqp::DataBuilder(qpid::types::Variant::Map());
+ qpid::amqp::Decoder decoder(body.data, body.size);
+ decoder.read(builder);
+ c = builder.getValue().asMap();
+ raw.assign(body.data, body.size);
+ } else if (bodyType == qpid::amqp::typecodes::UUID_NAME) {
+ if (body.size == qpid::types::Uuid::SIZE) c = qpid::types::Uuid(body.data);
+ raw.assign(body.data, body.size);
+ } else if (bodyType == qpid::amqp::typecodes::ARRAY_NAME) {
+ raw.assign(body.data, body.size);
+ }
}
+ } catch (const qpid::Exception& e) {
+ throw FetchError(e.what());
}
}
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
index 473c120e27..2a45ccee44 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
@@ -123,11 +123,6 @@ Address ReceiverContext::getAddress() const
return address;
}
-bool ReceiverContext::isClosed() const
-{
- return false;//TODO
-}
-
void ReceiverContext::reset(pn_session_t* session)
{
receiver = pn_receiver(session, name.c_str());
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h
index fb8ea0d336..c68ea10ba3 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h
+++ b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h
@@ -55,7 +55,6 @@ class ReceiverContext
void close();
const std::string& getName() const;
const std::string& getSource() const;
- bool isClosed() const;
void configure();
void verify();
Address getAddress() const;
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ReceiverHandle.cpp b/qpid/cpp/src/qpid/messaging/amqp/ReceiverHandle.cpp
index 177f47896b..bd7082079c 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ReceiverHandle.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/ReceiverHandle.cpp
@@ -100,7 +100,7 @@ qpid::messaging::Session ReceiverHandle::getSession() const
bool ReceiverHandle::isClosed() const
{
- return receiver->isClosed();
+ return connection->isClosed(session, receiver);
}
Address ReceiverHandle::getAddress() const
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
index 94851da273..6eed7b43d6 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
@@ -21,6 +21,8 @@
#include "qpid/messaging/amqp/SenderContext.h"
#include "qpid/messaging/amqp/EncodedMessage.h"
#include "qpid/messaging/AddressImpl.h"
+#include "qpid/messaging/exceptions.h"
+#include "qpid/Exception.h"
#include "qpid/amqp/descriptors.h"
#include "qpid/amqp/MapHandler.h"
#include "qpid/amqp/MessageEncoder.h"
@@ -42,7 +44,7 @@ SenderContext::SenderContext(pn_session_t* session, const std::string& n, const
: name(n),
address(a),
helper(address),
- sender(pn_sender(session, n.c_str())), capacity(1000), unreliable(helper.isUnreliable()) {}
+ sender(pn_sender(session, n.c_str())), capacity(50), unreliable(helper.isUnreliable()) {}
SenderContext::~SenderContext()
{
@@ -435,59 +437,63 @@ void SenderContext::Delivery::reset()
void SenderContext::Delivery::encode(const qpid::messaging::MessageImpl& msg, const qpid::messaging::Address& address)
{
- boost::shared_ptr<const EncodedMessage> original = msg.getEncoded();
-
- if (original && !changedSubject(msg, address)) { //still have the content as received, send at least the bare message unaltered
- //do we need to alter the header? are durable, priority, ttl, first-acquirer, delivery-count different from what was received?
- if (original->hasHeaderChanged(msg)) {
- //since as yet have no annotations, just write the revised header then the rest of the message as received
- encoded.resize(16/*max header size*/ + original->getBareMessage().size);
- qpid::amqp::MessageEncoder encoder(encoded.getData(), encoded.getSize());
+ try {
+ boost::shared_ptr<const EncodedMessage> original = msg.getEncoded();
+
+ if (original && !changedSubject(msg, address)) { //still have the content as received, send at least the bare message unaltered
+ //do we need to alter the header? are durable, priority, ttl, first-acquirer, delivery-count different from what was received?
+ if (original->hasHeaderChanged(msg)) {
+ //since as yet have no annotations, just write the revised header then the rest of the message as received
+ encoded.resize(16/*max header size*/ + original->getBareMessage().size);
+ qpid::amqp::MessageEncoder encoder(encoded.getData(), encoded.getSize());
+ HeaderAdapter header(msg);
+ encoder.writeHeader(header);
+ ::memcpy(encoded.getData() + encoder.getPosition(), original->getBareMessage().data, original->getBareMessage().size);
+ } else {
+ //since as yet have no annotations, if the header hasn't
+ //changed and we still have the original bare message, can
+ //send the entire content as is
+ encoded.resize(original->getSize());
+ ::memcpy(encoded.getData(), original->getData(), original->getSize());
+ }
+ } else {
HeaderAdapter header(msg);
+ PropertiesAdapter properties(msg, address.getSubject());
+ ApplicationPropertiesAdapter applicationProperties(msg.getHeaders());
+ //compute size:
+ size_t contentSize = qpid::amqp::MessageEncoder::getEncodedSize(header)
+ + qpid::amqp::MessageEncoder::getEncodedSize(properties)
+ + qpid::amqp::MessageEncoder::getEncodedSize(applicationProperties);
+ if (msg.getContent().isVoid()) {
+ contentSize += qpid::amqp::MessageEncoder::getEncodedSizeForContent(msg.getBytes());
+ } else {
+ contentSize += qpid::amqp::MessageEncoder::getEncodedSizeForValue(msg.getContent()) + 3/*descriptor*/;
+ }
+ encoded.resize(contentSize);
+ QPID_LOG(debug, "Sending message, buffer is " << encoded.getSize() << " bytes")
+ qpid::amqp::MessageEncoder encoder(encoded.getData(), encoded.getSize());
+ //write header:
encoder.writeHeader(header);
- ::memcpy(encoded.getData() + encoder.getPosition(), original->getBareMessage().data, original->getBareMessage().size);
- } else {
- //since as yet have no annotations, if the header hasn't
- //changed and we still have the original bare message, can
- //send the entire content as is
- encoded.resize(original->getSize());
- ::memcpy(encoded.getData(), original->getData(), original->getSize());
- }
- } else {
- HeaderAdapter header(msg);
- PropertiesAdapter properties(msg, address.getSubject());
- ApplicationPropertiesAdapter applicationProperties(msg.getHeaders());
- //compute size:
- size_t contentSize = qpid::amqp::MessageEncoder::getEncodedSize(header)
- + qpid::amqp::MessageEncoder::getEncodedSize(properties)
- + qpid::amqp::MessageEncoder::getEncodedSize(applicationProperties);
- if (msg.getContent().isVoid()) {
- contentSize += qpid::amqp::MessageEncoder::getEncodedSizeForContent(msg.getBytes());
- } else {
- contentSize += qpid::amqp::MessageEncoder::getEncodedSizeForValue(msg.getContent()) + 3/*descriptor*/;
- }
- encoded.resize(contentSize);
- QPID_LOG(debug, "Sending message, buffer is " << encoded.getSize() << " bytes")
- qpid::amqp::MessageEncoder encoder(encoded.getData(), encoded.getSize());
- //write header:
- encoder.writeHeader(header);
- //write delivery-annotations, write message-annotations (none yet supported)
- //write properties
- encoder.writeProperties(properties);
- //write application-properties
- encoder.writeApplicationProperties(applicationProperties);
- //write body
- if (!msg.getContent().isVoid()) {
- //write as AmqpValue
- encoder.writeValue(msg.getContent(), &qpid::amqp::message::AMQP_VALUE);
- } else if (msg.getBytes().size()) {
- encoder.writeBinary(msg.getBytes(), &qpid::amqp::message::DATA);//structured content not yet directly supported
- }
- if (encoder.getPosition() < encoded.getSize()) {
- QPID_LOG(debug, "Trimming buffer from " << encoded.getSize() << " to " << encoder.getPosition());
- encoded.trim(encoder.getPosition());
+ //write delivery-annotations, write message-annotations (none yet supported)
+ //write properties
+ encoder.writeProperties(properties);
+ //write application-properties
+ encoder.writeApplicationProperties(applicationProperties);
+ //write body
+ if (!msg.getContent().isVoid()) {
+ //write as AmqpValue
+ encoder.writeValue(msg.getContent(), &qpid::amqp::message::AMQP_VALUE);
+ } else if (msg.getBytes().size()) {
+ encoder.writeBinary(msg.getBytes(), &qpid::amqp::message::DATA);//structured content not yet directly supported
+ }
+ if (encoder.getPosition() < encoded.getSize()) {
+ QPID_LOG(debug, "Trimming buffer from " << encoded.getSize() << " to " << encoder.getPosition());
+ encoded.trim(encoder.getPosition());
+ }
+ //write footer (no annotations yet supported)
}
- //write footer (no annotations yet supported)
+ } catch (const qpid::Exception& e) {
+ throw SendError(e.what());
}
}
void SenderContext::Delivery::send(pn_link_t* sender, bool unreliable)
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
index 8f2a7d15d8..e13ccdbc36 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
@@ -140,6 +140,23 @@ void SessionContext::acknowledge(const qpid::framing::SequenceNumber& id, bool c
}
}
+void SessionContext::nack(const qpid::framing::SequenceNumber& id, bool reject)
+{
+ DeliveryMap::iterator i = unacked.find(id);
+ if (i != unacked.end()) {
+ if (reject) {
+ QPID_LOG(debug, "rejecting message with id=" << id);
+ pn_delivery_update(i->second, PN_REJECTED);
+ } else {
+ QPID_LOG(debug, "releasing message with id=" << id);
+ pn_delivery_update(i->second, PN_MODIFIED);
+ pn_disposition_set_failed(pn_delivery_local(i->second), true);
+ }
+ pn_delivery_settle(i->second);
+ unacked.erase(i);
+ }
+}
+
bool SessionContext::settled()
{
bool result = true;
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.h b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.h
index 5d68f6d8de..75a67a7d15 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.h
+++ b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.h
@@ -79,6 +79,7 @@ class SessionContext
void acknowledge();
void acknowledge(const qpid::framing::SequenceNumber& id, bool cummulative);
void acknowledge(DeliveryMap::iterator begin, DeliveryMap::iterator end);
+ void nack(const qpid::framing::SequenceNumber& id, bool reject);
};
}}} // namespace qpid::messaging::amqp
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SessionHandle.cpp b/qpid/cpp/src/qpid/messaging/amqp/SessionHandle.cpp
index 45635e4ced..50fe4ef30e 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SessionHandle.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/SessionHandle.cpp
@@ -57,18 +57,17 @@ void SessionHandle::acknowledge(bool /*sync*/)
void SessionHandle::acknowledge(qpid::messaging::Message& msg, bool cumulative)
{
- //TODO: handle cumulative
connection->acknowledge(session, &msg, cumulative);
}
-void SessionHandle::reject(qpid::messaging::Message&)
+void SessionHandle::reject(qpid::messaging::Message& msg)
{
-
+ connection->nack(session, msg, true);
}
-void SessionHandle::release(qpid::messaging::Message&)
+void SessionHandle::release(qpid::messaging::Message& msg)
{
-
+ connection->nack(session, msg, false);
}
void SessionHandle::close()
diff --git a/qpid/cpp/src/tests/MessageTest.cpp b/qpid/cpp/src/tests/MessageTest.cpp
index 666a2c6297..28f8b0c2b8 100644
--- a/qpid/cpp/src/tests/MessageTest.cpp
+++ b/qpid/cpp/src/tests/MessageTest.cpp
@@ -65,7 +65,7 @@ QPID_AUTO_TEST_CASE(testEncodeDecode)
msg = registry.decode(buffer);
BOOST_CHECK_EQUAL(routingKey, msg.getRoutingKey());
- BOOST_CHECK_EQUAL((uint64_t) data.size(), msg.getContentSize());
+ BOOST_CHECK_EQUAL((uint64_t) data.size(), msg.getContent().size());
BOOST_CHECK_EQUAL(data, msg.getContent());
//BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
BOOST_CHECK_EQUAL(string("xyz"), msg.getPropertyAsString("abc"));
diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp
index 5cc595c56f..323d7e8231 100644
--- a/qpid/cpp/src/tests/MessagingSessionTests.cpp
+++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp
@@ -397,6 +397,14 @@ QPID_AUTO_TEST_CASE(testBrowse)
receive(browser1, 10);
Receiver browser2 = fix.session.createReceiver(fix.queue + "; {mode:browse}");
receive(browser2, 10);
+ Receiver releaser1 = fix.session.createReceiver(fix.queue);
+ Message m1 = releaser1.fetch(messaging::Duration::SECOND*5);
+ BOOST_CHECK(!m1.getRedelivered());
+ fix.session.release(m1);
+ Receiver releaser2 = fix.session.createReceiver(fix.queue);
+ Message m2 = releaser2.fetch(messaging::Duration::SECOND*5);
+ BOOST_CHECK(m2.getRedelivered());
+ fix.session.release(m2);
Receiver consumer = fix.session.createReceiver(fix.queue);
receive(consumer, 10);
fix.session.acknowledge();
@@ -738,6 +746,7 @@ QPID_AUTO_TEST_CASE(testRelease)
Message m2 = receiver.fetch(Duration::SECOND * 1);
BOOST_CHECK_EQUAL(m1.getContent(), out.getContent());
BOOST_CHECK_EQUAL(m1.getContent(), m2.getContent());
+ BOOST_CHECK(m2.getRedelivered());
fix.session.acknowledge(true);
}
diff --git a/qpid/cpp/src/tests/QueueFlowLimitTest.cpp b/qpid/cpp/src/tests/QueueFlowLimitTest.cpp
index d305ca452b..7b0a776062 100644
--- a/qpid/cpp/src/tests/QueueFlowLimitTest.cpp
+++ b/qpid/cpp/src/tests/QueueFlowLimitTest.cpp
@@ -77,8 +77,14 @@ public:
Message createMessage(uint32_t size)
{
static uint32_t seqNum;
- Message msg = MessageUtils::createMessage(qpid::types::Variant::Map(), std::string (size, 'x'));
- msg.setSequence(++seqNum);
+ //Need to compute what data size is required to make a given
+ //overall size (use one byte of content in test message to ensure
+ //content frame is added)
+ Message test = MessageUtils::createMessage(qpid::types::Variant::Map(), std::string("x"));
+ size_t min = test.getMessageSize() - 1;
+ if (min > size) throw qpid::Exception("Can't create message that small!");
+ Message msg = MessageUtils::createMessage(qpid::types::Variant::Map(), std::string (size - min, 'x'));
+ msg.setSequence(++seqNum);//this doesn't affect message size
return msg;
}
}
@@ -100,18 +106,18 @@ QPID_AUTO_TEST_CASE(testFlowCount)
std::deque<Message> msgs;
for (size_t i = 0; i < 6; i++) {
- msgs.push_back(createMessage(10));
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
BOOST_CHECK(!flow->isFlowControlActive());
}
BOOST_CHECK(!flow->isFlowControlActive()); // 6 on queue
- msgs.push_back(createMessage(10));
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
BOOST_CHECK(!flow->isFlowControlActive()); // 7 on queue
- msgs.push_back(createMessage(10));
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
BOOST_CHECK(flow->isFlowControlActive()); // 8 on queue, ON
- msgs.push_back(createMessage(10));
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
BOOST_CHECK(flow->isFlowControlActive()); // 9 on queue, no change to flow control
@@ -136,69 +142,69 @@ QPID_AUTO_TEST_CASE(testFlowCount)
QPID_AUTO_TEST_CASE(testFlowSize)
{
FieldTable args;
- args.setUInt64(QueueFlowLimit::flowStopSizeKey, 70);
- args.setUInt64(QueueFlowLimit::flowResumeSizeKey, 50);
+ args.setUInt64(QueueFlowLimit::flowStopSizeKey, 700);
+ args.setUInt64(QueueFlowLimit::flowResumeSizeKey, 460);
std::auto_ptr<TestFlow> flow(TestFlow::createTestFlow(args));
BOOST_CHECK_EQUAL((uint32_t) 0, flow->getFlowStopCount());
BOOST_CHECK_EQUAL((uint32_t) 0, flow->getFlowResumeCount());
- BOOST_CHECK_EQUAL((uint32_t) 70, flow->getFlowStopSize());
- BOOST_CHECK_EQUAL((uint32_t) 50, flow->getFlowResumeSize());
+ BOOST_CHECK_EQUAL((uint32_t) 700, flow->getFlowStopSize());
+ BOOST_CHECK_EQUAL((uint32_t) 460, flow->getFlowResumeSize());
BOOST_CHECK(!flow->isFlowControlActive());
BOOST_CHECK(flow->monitorFlowControl());
std::deque<Message> msgs;
for (size_t i = 0; i < 6; i++) {
- msgs.push_back(createMessage(10));
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
BOOST_CHECK(!flow->isFlowControlActive());
}
- BOOST_CHECK(!flow->isFlowControlActive()); // 60 on queue
+ BOOST_CHECK(!flow->isFlowControlActive()); // 600 on queue
BOOST_CHECK_EQUAL(6u, flow->getFlowCount());
- BOOST_CHECK_EQUAL(60u, flow->getFlowSize());
+ BOOST_CHECK_EQUAL(600u, flow->getFlowSize());
- Message msg_9 = createMessage(9);
- flow->enqueued(msg_9);
- BOOST_CHECK(!flow->isFlowControlActive()); // 69 on queue
- Message tinyMsg_1 = createMessage(1);
+ Message msg_50 = createMessage(50);
+ flow->enqueued(msg_50);
+ BOOST_CHECK(!flow->isFlowControlActive()); // 650 on queue
+ Message tinyMsg_1 = createMessage(40);
flow->enqueued(tinyMsg_1);
- BOOST_CHECK(!flow->isFlowControlActive()); // 70 on queue
+ BOOST_CHECK(!flow->isFlowControlActive()); // 690 on queue
- Message tinyMsg_2 = createMessage(1);
+ Message tinyMsg_2 = createMessage(40);
flow->enqueued(tinyMsg_2);
- BOOST_CHECK(flow->isFlowControlActive()); // 71 on queue, ON
- msgs.push_back(createMessage(10));
+ BOOST_CHECK(flow->isFlowControlActive()); // 730 on queue, ON
+ msgs.push_back(createMessage(100));
flow->enqueued(msgs.back());
- BOOST_CHECK(flow->isFlowControlActive()); // 81 on queue
+ BOOST_CHECK(flow->isFlowControlActive()); // 830 on queue
BOOST_CHECK_EQUAL(10u, flow->getFlowCount());
- BOOST_CHECK_EQUAL(81u, flow->getFlowSize());
+ BOOST_CHECK_EQUAL(830u, flow->getFlowSize());
flow->dequeued(msgs.front());
msgs.pop_front();
- BOOST_CHECK(flow->isFlowControlActive()); // 71 on queue
+ BOOST_CHECK(flow->isFlowControlActive()); // 730 on queue
flow->dequeued(msgs.front());
msgs.pop_front();
- BOOST_CHECK(flow->isFlowControlActive()); // 61 on queue
+ BOOST_CHECK(flow->isFlowControlActive()); // 630 on queue
flow->dequeued(msgs.front());
msgs.pop_front();
- BOOST_CHECK(flow->isFlowControlActive()); // 51 on queue
+ BOOST_CHECK(flow->isFlowControlActive()); // 530 on queue
flow->dequeued(tinyMsg_1);
- BOOST_CHECK(flow->isFlowControlActive()); // 50 on queue
+ BOOST_CHECK(flow->isFlowControlActive()); // 490 on queue
flow->dequeued(tinyMsg_2);
- BOOST_CHECK(!flow->isFlowControlActive()); // 49 on queue, OFF
+ BOOST_CHECK(!flow->isFlowControlActive()); // 450 on queue, OFF
- flow->dequeued(msg_9);
- BOOST_CHECK(!flow->isFlowControlActive()); // 40 on queue
+ flow->dequeued(msg_50);
+ BOOST_CHECK(!flow->isFlowControlActive()); // 400 on queue
flow->dequeued(msgs.front());
msgs.pop_front();
- BOOST_CHECK(!flow->isFlowControlActive()); // 30 on queue
+ BOOST_CHECK(!flow->isFlowControlActive()); // 300 on queue
flow->dequeued(msgs.front());
msgs.pop_front();
- BOOST_CHECK(!flow->isFlowControlActive()); // 20 on queue
+ BOOST_CHECK(!flow->isFlowControlActive()); // 200 on queue
BOOST_CHECK_EQUAL(2u, flow->getFlowCount());
- BOOST_CHECK_EQUAL(20u, flow->getFlowSize());
+ BOOST_CHECK_EQUAL(200u, flow->getFlowSize());
}
QPID_AUTO_TEST_CASE(testFlowArgs)
@@ -227,13 +233,13 @@ QPID_AUTO_TEST_CASE(testFlowCombo)
FieldTable args;
args.setInt(QueueFlowLimit::flowStopCountKey, 10);
args.setInt(QueueFlowLimit::flowResumeCountKey, 5);
- args.setUInt64(QueueFlowLimit::flowStopSizeKey, 200);
- args.setUInt64(QueueFlowLimit::flowResumeSizeKey, 100);
+ args.setUInt64(QueueFlowLimit::flowStopSizeKey, 2000);
+ args.setUInt64(QueueFlowLimit::flowResumeSizeKey, 1000);
- std::deque<Message> msgs_1;
- std::deque<Message> msgs_10;
std::deque<Message> msgs_50;
std::deque<Message> msgs_100;
+ std::deque<Message> msgs_500;
+ std::deque<Message> msgs_1000;
Message msg;
@@ -243,104 +249,104 @@ QPID_AUTO_TEST_CASE(testFlowCombo)
// verify flow control comes ON when only count passes its stop point.
for (size_t i = 0; i < 10; i++) {
- msgs_10.push_back(createMessage(10));
- flow->enqueued(msgs_10.back());
+ msgs_100.push_back(createMessage(100));
+ flow->enqueued(msgs_100.back());
BOOST_CHECK(!flow->isFlowControlActive());
}
- // count:10 size:100
+ // count:10 size:1000
- msgs_1.push_back(createMessage(1));
- flow->enqueued(msgs_1.back()); // count:11 size: 101 ->ON
+ msgs_50.push_back(createMessage(50));
+ flow->enqueued(msgs_50.back()); // count:11 size: 1050 ->ON
BOOST_CHECK(flow->isFlowControlActive());
for (size_t i = 0; i < 6; i++) {
- flow->dequeued(msgs_10.front());
- msgs_10.pop_front();
+ flow->dequeued(msgs_100.front());
+ msgs_100.pop_front();
BOOST_CHECK(flow->isFlowControlActive());
}
- // count:5 size: 41
+ // count:5 size: 450
- flow->dequeued(msgs_1.front()); // count: 4 size: 40 ->OFF
- msgs_1.pop_front();
+ flow->dequeued(msgs_50.front()); // count: 4 size: 400 ->OFF
+ msgs_50.pop_front();
BOOST_CHECK(!flow->isFlowControlActive());
for (size_t i = 0; i < 4; i++) {
- flow->dequeued(msgs_10.front());
- msgs_10.pop_front();
+ flow->dequeued(msgs_100.front());
+ msgs_100.pop_front();
BOOST_CHECK(!flow->isFlowControlActive());
}
// count:0 size:0
// verify flow control comes ON when only size passes its stop point.
- msgs_100.push_back(createMessage(100));
- flow->enqueued(msgs_100.back()); // count:1 size: 100
+ msgs_1000.push_back(createMessage(1000));
+ flow->enqueued(msgs_1000.back()); // count:1 size: 1000
BOOST_CHECK(!flow->isFlowControlActive());
- msgs_50.push_back(createMessage(50));
- flow->enqueued(msgs_50.back()); // count:2 size: 150
+ msgs_500.push_back(createMessage(500));
+ flow->enqueued(msgs_500.back()); // count:2 size: 1500
BOOST_CHECK(!flow->isFlowControlActive());
- msgs_50.push_back(createMessage(50));
- flow->enqueued(msgs_50.back()); // count:3 size: 200
+ msgs_500.push_back(createMessage(500));
+ flow->enqueued(msgs_500.back()); // count:3 size: 2000
BOOST_CHECK(!flow->isFlowControlActive());
- msgs_1.push_back(createMessage(1));
- flow->enqueued(msgs_1.back()); // count:4 size: 201 ->ON
+ msgs_50.push_back(createMessage(50));
+ flow->enqueued(msgs_50.back()); // count:4 size: 2050 ->ON
BOOST_CHECK(flow->isFlowControlActive());
- flow->dequeued(msgs_100.front()); // count:3 size:101
- msgs_100.pop_front();
+ flow->dequeued(msgs_1000.front()); // count:3 size:1050
+ msgs_1000.pop_front();
BOOST_CHECK(flow->isFlowControlActive());
- flow->dequeued(msgs_1.front()); // count:2 size:100
- msgs_1.pop_front();
+ flow->dequeued(msgs_50.front()); // count:2 size:1000
+ msgs_50.pop_front();
BOOST_CHECK(flow->isFlowControlActive());
- flow->dequeued(msgs_50.front()); // count:1 size:50 ->OFF
- msgs_50.pop_front();
+ flow->dequeued(msgs_500.front()); // count:1 size:500 ->OFF
+ msgs_500.pop_front();
BOOST_CHECK(!flow->isFlowControlActive());
// verify flow control remains ON until both thresholds drop below their
// resume point.
for (size_t i = 0; i < 8; i++) {
- msgs_10.push_back(createMessage(10));
- flow->enqueued(msgs_10.back());
+ msgs_100.push_back(createMessage(100));
+ flow->enqueued(msgs_100.back());
BOOST_CHECK(!flow->isFlowControlActive());
}
- // count:9 size:130
+ // count:9 size:1300
- msgs_10.push_back(createMessage(10));
- flow->enqueued(msgs_10.back()); // count:10 size: 140
+ msgs_100.push_back(createMessage(100));
+ flow->enqueued(msgs_100.back()); // count:10 size: 1400
BOOST_CHECK(!flow->isFlowControlActive());
- msgs_1.push_back(createMessage(1));
- flow->enqueued(msgs_1.back()); // count:11 size: 141 ->ON
+ msgs_50.push_back(createMessage(50));
+ flow->enqueued(msgs_50.back()); // count:11 size: 1450 ->ON
BOOST_CHECK(flow->isFlowControlActive());
- msgs_100.push_back(createMessage(100));
- flow->enqueued(msgs_100.back()); // count:12 size: 241 (both thresholds crossed)
+ msgs_1000.push_back(createMessage(1000));
+ flow->enqueued(msgs_1000.back()); // count:12 size: 2450 (both thresholds crossed)
BOOST_CHECK(flow->isFlowControlActive());
- // at this point: 9@10 + 1@50 + 1@100 + 1@1 == 12@241
+ // at this point: 9@100 + 1@500 + 1@1000 + 1@50 == 12@2450
- flow->dequeued(msgs_50.front()); // count:11 size:191
- msgs_50.pop_front();
+ flow->dequeued(msgs_500.front()); // count:11 size:1950
+ msgs_500.pop_front();
BOOST_CHECK(flow->isFlowControlActive());
for (size_t i = 0; i < 9; i++) {
- flow->dequeued(msgs_10.front());
- msgs_10.pop_front();
+ flow->dequeued(msgs_100.front());
+ msgs_100.pop_front();
BOOST_CHECK(flow->isFlowControlActive());
}
- // count:2 size:101
- flow->dequeued(msgs_1.front()); // count:1 size:100
- msgs_1.pop_front();
+ // count:2 size:1050
+ flow->dequeued(msgs_50.front()); // count:1 size:1000
+ msgs_50.pop_front();
BOOST_CHECK(flow->isFlowControlActive()); // still active due to size
- flow->dequeued(msgs_100.front()); // count:0 size:0 ->OFF
- msgs_100.pop_front();
+ flow->dequeued(msgs_1000.front()); // count:0 size:0 ->OFF
+ msgs_1000.pop_front();
BOOST_CHECK(!flow->isFlowControlActive());
}
diff --git a/qpid/cpp/src/tests/QueueOptionsTest.cpp b/qpid/cpp/src/tests/QueueOptionsTest.cpp
index f2fbaba2c1..bdb83d7d22 100644
--- a/qpid/cpp/src/tests/QueueOptionsTest.cpp
+++ b/qpid/cpp/src/tests/QueueOptionsTest.cpp
@@ -63,16 +63,9 @@ QPID_AUTO_TEST_CASE(testFlags)
{
QueueOptions ft;
- ft.setPersistLastNode();
ft.setOrdering(LVQ);
-
- BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strPersistLastNode));
BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strLastValueQueue));
-
- ft.clearPersistLastNode();
ft.setOrdering(FIFO);
-
- BOOST_CHECK(!ft.isSet(QueueOptions::strPersistLastNode));
BOOST_CHECK(!ft.isSet(QueueOptions::strLastValueQueue));
}
@@ -87,16 +80,6 @@ QPID_AUTO_TEST_CASE(testSetOrdering)
}
-QPID_AUTO_TEST_CASE(testClearPersistLastNode)
-{
- //ensure clear works even if not preceded by the setting on the
- //option
- QueueOptions ft;
- ft.clearPersistLastNode();
- BOOST_CHECK(!ft.isSet(QueueOptions::strPersistLastNode));
-}
-
-
QPID_AUTO_TEST_SUITE_END()
}} // namespace qpid::tests
diff --git a/qpid/cpp/src/tests/QueuePolicyTest.cpp b/qpid/cpp/src/tests/QueuePolicyTest.cpp
index ce1b0addea..f61c283fd4 100644
--- a/qpid/cpp/src/tests/QueuePolicyTest.cpp
+++ b/qpid/cpp/src/tests/QueuePolicyTest.cpp
@@ -69,9 +69,15 @@ QPID_AUTO_TEST_CASE(testRingPolicyCount)
QPID_AUTO_TEST_CASE(testRingPolicySize)
{
- std::string hundredBytes = std::string(100, 'h');
- std::string fourHundredBytes = std::string (400, 'f');
- std::string thousandBytes = std::string(1000, 't');
+ //The message size now includes all headers as well as the content
+ //aka body, so compute the amount of data needed to hit a given
+ //overall size
+ std::string q("my-ring-queue");
+ size_t minMessageSize = 25/*minimum size of headers*/ + q.size()/*routing key length*/ + 4/*default exchange, added by broker*/;
+
+ std::string hundredBytes = std::string(100 - minMessageSize, 'h');
+ std::string fourHundredBytes = std::string (400 - minMessageSize, 'f');
+ std::string thousandBytes = std::string(1000 - minMessageSize, 't');
// Ring queue, 500 bytes maxSize
@@ -79,7 +85,6 @@ QPID_AUTO_TEST_CASE(testRingPolicySize)
args.setSizePolicy(RING, 500, 0);
SessionFixture f;
- std::string q("my-ring-queue");
f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
// A. Send messages 0 .. 5, each 100 bytes
diff --git a/qpid/cpp/src/tests/assertions.py b/qpid/cpp/src/tests/assertions.py
new file mode 100644
index 0000000000..b1a06aea83
--- /dev/null
+++ b/qpid/cpp/src/tests/assertions.py
@@ -0,0 +1,141 @@
+#
+# 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.
+#
+
+from qpid.tests.messaging.implementation import *
+from qpid.tests.messaging import VersionTest
+
+class AssertionTests (VersionTest):
+ """
+ Tests for assertions with qpidd
+ """
+ def test_queues_alternate_exchange1(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{properties:{alternate-exchange:amq.fanout}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{properties:{alternate-exchange:amq.fanout}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{properties:{alternate-exchange:amq.topic}}}" % name)
+ assert False, "Expected assertion to fail on alternate-exchange"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_queues_alternate_exchange2(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{x-declare:{alternate-exchange:amq.fanout}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{alternate-exchange:amq.fanout}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{alternate-exchange:amq.topic}}}" % name)
+ assert False, "Expected assertion to fail on alternate-exchange"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_queue_type(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always}" % name)
+ self.ssn.sender("%s; {assert:always, node:{type:queue}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{type:topic}}" % name)
+ assert False, "Expected assertion to fail on type"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_queue_durability(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always}" % name)
+ self.ssn.sender("%s; {assert:always, node:{durable:False}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{durable:True}}" % name)
+ assert False, "Expected assertion to fail on durability"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_queue_options(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{x-declare:{arguments:{foo:bar,'qpid.last_value_queue_key':abc}}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{'qpid.last_value_queue_key':abc}}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{foo:bar}}}}" % name)
+ assert False, "Expected assertion to fail on unrecognised option"
+ except AssertionFailed: None
+ except MessagingError: None
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{'qpid.max_count':10}}}}" % name)
+ assert False, "Expected assertion to fail on unspecified option"
+ except AssertionFailed: None
+ except MessagingError: None
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{'qpid.last_value_key':xyz}}}}" % name)
+ assert False, "Expected assertion to fail on option with different value"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_exchanges_alternate_exchange1(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{type:topic, properties:{alternate-exchange:amq.fanout}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{type:topic, properties:{alternate-exchange:amq.fanout}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{properties:{alternate-exchange:amq.topic}}}" % name)
+ assert False, "Expected assertion to fail on alternate-exchange"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_exchanges_alternate_exchange2(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{type:topic, x-declare:{alternate-exchange:amq.fanout}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{type:topic, x-declare:{alternate-exchange:amq.fanout}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{alternate-exchange:amq.topic}}}" % name)
+ assert False, "Expected assertion to fail on alternate-exchange"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_exchange_type(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{type:topic}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{type:topic}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{type:queue}}" % name)
+ assert False, "Expected assertion to fail on type"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_exchange_durability(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{type:topic}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{durable:False}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{durable:True}}" % name)
+ assert False, "Expected assertion to fail on durability"
+ except AssertionFailed: None
+ except MessagingError: None
+
+ def test_exchange_options(self):
+ name = str(uuid4())
+ self.ssn.sender("%s; {create:always, node:{type:topic, x-declare:{arguments:{foo:bar,'qpid.msg_sequence':True}}}}" % name)
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{'qpid.msg_sequence':True}}}}" % name)
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{foo:bar}}}}" % name)
+ assert False, "Expected assertion to fail on unrecognised option"
+ except AssertionFailed: None
+ except MessagingError: None
+ try:
+ self.ssn.sender("%s; {assert:always, node:{x-declare:{arguments:{'qpid.ive':True}}}}" % name)
+ assert False, "Expected assertion to fail on unspecified option"
+ except AssertionFailed: None
+ except MessagingError: None
+
diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py
index 2786454399..d1f020a945 100644
--- a/qpid/cpp/src/tests/brokertest.py
+++ b/qpid/cpp/src/tests/brokertest.py
@@ -424,7 +424,6 @@ class BrokerTest(TestCase):
ha_lib = os.getenv("HA_LIB")
xml_lib = os.getenv("XML_LIB")
amqp_lib = os.getenv("AMQP_LIB")
- amqpc_lib = os.getenv("AMQPC_LIB")
qpid_config_exec = os.getenv("QPID_CONFIG_EXEC")
qpid_route_exec = os.getenv("QPID_ROUTE_EXEC")
receiver_exec = os.getenv("RECEIVER_EXEC")
diff --git a/qpid/cpp/src/tests/interlink_tests.py b/qpid/cpp/src/tests/interlink_tests.py
index 608d4ac890..c7269ac5e9 100755
--- a/qpid/cpp/src/tests/interlink_tests.py
+++ b/qpid/cpp/src/tests/interlink_tests.py
@@ -46,7 +46,6 @@ class AmqpBrokerTest(BrokerTest):
"""
def setUp(self):
BrokerTest.setUp(self)
- os.putenv("QPID_LOAD_MODULE", BrokerTest.amqpc_lib)
self.port_holder = HaPort(self)
self.broker = self.amqp_broker(port_holder=self.port_holder)
self.default_config = Config(self.broker)
diff --git a/qpid/cpp/src/tests/legacystore/CMakeLists.txt b/qpid/cpp/src/tests/legacystore/CMakeLists.txt
index 6cfaa7ec17..0dec2caab8 100644
--- a/qpid/cpp/src/tests/legacystore/CMakeLists.txt
+++ b/qpid/cpp/src/tests/legacystore/CMakeLists.txt
@@ -70,48 +70,119 @@ set (qpid_test_boost_libs
# womp on each other's store directory.
#
-# define_selftest
+# define_legacystore_test
# macro to accept the name of a single source file and to create a
# unit test executable that runs the source.
#
-MACRO (define_selftest theSourceFile)
+MACRO (define_legacystore_test theSourceFile)
add_executable (legacystore_${theSourceFile}
- unit_test
${theSourceFile}
+ unit_test
${platform_test_additions})
target_link_libraries (legacystore_${theSourceFile}
${qpid_test_boost_libs}
- qpidmessaging qpidbroker qmfconsole legacystore)
-get_property(ls_include TARGET legacystore_${theSourceFile} PROPERTY INCLUDE_DIRECTORIES)
-list(APPEND ls_include ${abs_top_srcdir}/src/qpid/legacystore)
-list(APPEND ls_include ${abs_top_srcdir}/src/tests)
-set_target_properties (legacystore_${theSourceFile} PROPERTIES
- INCLUDE_DIRECTORIES "${ls_include}"
- COMPILE_DEFINITIONS _IN_QPID_BROKER)
+ qpidmessaging qpidtypes qpidbroker qpidcommon legacystore_shared)
+set_target_properties (legacystore_${theSourceFile} PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
remember_location(legacystore_${theSourceFile})
-set(test_wrap ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_test${test_script_suffix})
add_test (legacystore_${theSourceFile} ${test_wrap} ${legacystore_${theSourceFile}_LOCATION})
-ENDMACRO (define_selftest)
-
-# add_definitions(-H)
+ENDMACRO (define_legacystore_test)
+
+define_legacystore_test (SimpleTest)
+define_legacystore_test (OrderingTest)
+define_legacystore_test (TransactionalTest)
+define_legacystore_test (TwoPhaseCommitTest)
+
+# Journal tests
+MACRO (define_journal_test mainSourceFile)
+if ("${ARGV1}" STREQUAL "LONG")
+ set (testname "journal_long_${mainSourceFile}")
+else ()
+ set (testname "journal_${mainSourceFile}")
+endif ()
+add_executable (${testname}
+ jrnl/${mainSourceFile}
+ unit_test
+ ${platform_test_additions})
+target_link_libraries (${testname}
+ ${qpid_test_boost_libs}
+ ${clock_gettime_LIB} legacystore_shared)
+if ("${ARGV1}" STREQUAL "LONG")
+ set_target_properties(${testname} PROPERTIES COMPILE_DEFINITIONS LONG_TEST)
+endif ()
+remember_location(${testname})
+add_test (${testname} ${test_wrap} ${${testname}_LOCATION})
+unset (testname)
+ENDMACRO (define_journal_test)
+
+define_journal_test (_ut_time_ns)
+define_journal_test (_ut_jexception)
+define_journal_test (_ut_jerrno)
+define_journal_test (_ut_rec_hdr)
+define_journal_test (_ut_jinf)
+define_journal_test (_ut_jdir)
+define_journal_test (_ut_enq_map)
+define_journal_test (_ut_txn_map)
+define_journal_test (_ut_lpmgr)
+define_journal_test (_st_basic)
+define_journal_test (_st_basic_txn)
+define_journal_test (_st_read)
+define_journal_test (_st_read_txn)
+define_journal_test (_st_auto_expand)
+define_journal_test (_ut_lpmgr LONG)
+define_journal_test (_st_basic LONG)
+define_journal_test (_st_read LONG)
+
+add_executable(jtt
+ jrnl/jtt/args.cpp
+ jrnl/jtt/data_src.cpp
+ jrnl/jtt/jrnl_init_params.cpp
+ jrnl/jtt/jrnl_instance.cpp
+ jrnl/jtt/main.cpp
+ jrnl/jtt/read_arg.cpp
+ jrnl/jtt/test_case.cpp
+ jrnl/jtt/test_case_result.cpp
+ jrnl/jtt/test_case_result_agregation.cpp
+ jrnl/jtt/test_case_set.cpp
+ jrnl/jtt/test_mgr.cpp)
+
+target_link_libraries (jtt
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${clock_gettime_LIB} legacystore_shared)
+
+add_test(journal_jtt ${CMAKE_CURRENT_BINARY_DIR}/jtt -c ${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt/jtt.csv)
+
+add_executable (jtt__ut
+ jrnl/jtt/_ut_data_src.cpp
+ jrnl/jtt/_ut_jrnl_init_params.cpp
+ jrnl/jtt/_ut_read_arg.cpp
+ jrnl/jtt/_ut_jrnl_instance.cpp
+ jrnl/jtt/_ut_test_case.cpp
+ jrnl/jtt/_ut_test_case_result.cpp
+ jrnl/jtt/_ut_test_case_result_agregation.cpp
+ jrnl/jtt/_ut_test_case_set.cpp
+ jrnl/jtt/args.cpp
+ jrnl/jtt/data_src.cpp
+ jrnl/jtt/jrnl_init_params.cpp
+ jrnl/jtt/jrnl_instance.cpp
+ jrnl/jtt/read_arg.cpp
+ jrnl/jtt/test_case.cpp
+ jrnl/jtt/test_case_set.cpp
+ jrnl/jtt/test_case_result.cpp
+ jrnl/jtt/test_case_result_agregation.cpp
+ unit_test.cpp)
+
+target_link_libraries (jtt__ut
+ ${qpid_test_boost_libs}
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${clock_gettime_LIB} legacystore_shared)
-define_selftest (SimpleTest)
-define_selftest (OrderingTest)
-define_selftest (TransactionalTest)
-define_selftest (TwoPhaseCommitTest)
+add_test(NAME journal_jtt_ut WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt COMMAND ${CMAKE_CURRENT_BINARY_DIR}/jtt__ut)
#
# Other test programs
#
-# This should ideally be done as part of the test run, but I don't know a way
-# to get these arguments and the working directory set like Makefile.am does,
-# and have that run during the test pass.
-if (PYTHON_EXECUTABLE)
- set (python_bld ${CMAKE_CURRENT_BINARY_DIR}/python)
- execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install --prefix=${pythoon_bld} --install-lib=${python_bld} --install-scripts=${python_bld}/commands
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../python)
-endif (PYTHON_EXECUTABLE)
+add_test (legacystore_python_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix})
endif (BUILD_LEGACYSTORE)
diff --git a/qpid/cpp/src/tests/legacystore/OrderingTest.cpp b/qpid/cpp/src/tests/legacystore/OrderingTest.cpp
index 92a09f0c60..74a9db1c73 100644
--- a/qpid/cpp/src/tests/legacystore/OrderingTest.cpp
+++ b/qpid/cpp/src/tests/legacystore/OrderingTest.cpp
@@ -20,16 +20,18 @@
*/
#include "unit_test.h"
+#include "MessageUtils.h"
+#include "qpid/broker/Queue.h"
+#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
+#include "qpid/framing/AMQHeaderBody.h"
#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
-#include "MessageUtils.h"
-#include <qpid/broker/Queue.h>
-#include <qpid/broker/RecoveryManagerImpl.h>
-#include <qpid/framing/AMQHeaderBody.h>
#include "qpid/log/Logger.h"
#include "qpid/sys/Timer.h"
+#include <iostream>
+
using namespace qpid;
using namespace qpid::broker;
using namespace qpid::framing;
@@ -48,7 +50,7 @@ QPID_AUTO_TEST_SUITE(OrderingTest)
const std::string test_filename("OrderingTest");
const char* tdp = getenv("TMP_DATA_DIR");
-const std::string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/OrderingTest");
+const std::string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/OrderingTest");
// === Helper fns ===
@@ -118,7 +120,8 @@ void restart()
sys::Timer t;
DtxManager mgr(t);
mgr.setStore (store.get());
- RecoveryManagerImpl recoveryMgr(queues, exchanges, links, mgr, br.getProtocolRegistry());
+ RecoveredObjects ro;
+ RecoveryManagerImpl recoveryMgr(queues, exchanges, links, mgr, br.getProtocolRegistry(), ro);
store->recover(recoveryMgr);
queue = queues.find(name);
diff --git a/qpid/cpp/src/tests/legacystore/SimpleTest.cpp b/qpid/cpp/src/tests/legacystore/SimpleTest.cpp
index a49333d876..c769bdeb75 100644
--- a/qpid/cpp/src/tests/legacystore/SimpleTest.cpp
+++ b/qpid/cpp/src/tests/legacystore/SimpleTest.cpp
@@ -20,21 +20,23 @@
*/
#include "unit_test.h"
+#include "MessageUtils.h"
+#include "qpid/broker/DirectExchange.h"
+#include "qpid/broker/Queue.h"
+#include "qpid/broker/QueueSettings.h"
+#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
+#include "qpid/framing/AMQHeaderBody.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/FieldValue.h"
#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
-#include "tests/legacystore/MessageUtils.h"
#include "qpid/legacystore/StoreException.h"
-#include "qpid/broker/DirectExchange.h"
-#include <qpid/broker/Queue.h>
-#include <qpid/broker/QueueSettings.h>
-#include <qpid/broker/RecoveryManagerImpl.h>
-#include <qpid/framing/AMQHeaderBody.h>
-#include <qpid/framing/FieldTable.h>
-#include <qpid/framing/FieldValue.h>
#include "qpid/log/Logger.h"
#include "qpid/sys/Timer.h"
+#include <iostream>
+
qpid::broker::Broker::Options opts;
qpid::broker::Broker br(opts);
@@ -57,15 +59,15 @@ QPID_AUTO_TEST_SUITE(SimpleTest)
const string test_filename("SimpleTest");
const char* tdp = getenv("TMP_DATA_DIR");
-const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/SimpleTest");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/SimpleTest");
// === Helper fns ===
-struct DummyHandler : OutputHandler
+struct DummyHandler : FrameHandler
{
std::vector<AMQFrame> frames;
- virtual void send(AMQFrame& frame){
+ virtual void handle(AMQFrame& frame){
frames.push_back(frame);
}
};
@@ -75,7 +77,8 @@ void recover(MessageStoreImpl& store, QueueRegistry& queues, ExchangeRegistry& e
sys::Timer t;
DtxManager mgr(t);
mgr.setStore (&store);
- RecoveryManagerImpl recovery(queues, exchanges, links, mgr, br.getProtocolRegistry());
+ RecoveredObjects ro;
+ RecoveryManagerImpl recovery(queues, exchanges, links, mgr, br.getProtocolRegistry(), ro);
store.recover(recovery);
}
@@ -232,8 +235,8 @@ QPID_AUTO_TEST_CASE(QueueCreateWithSettings)
recover(store, registry);
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
- BOOST_CHECK_EQUAL(settings.maxDepth.getCount(), 202);
- BOOST_CHECK_EQUAL(settings.maxDepth.getSize(), 1003);
+ BOOST_CHECK_EQUAL(settings.maxDepth.getCount(), 202u);
+ BOOST_CHECK_EQUAL(settings.maxDepth.getSize(), 1003u);
BOOST_CHECK_EQUAL(settings.maxDepth.getCount(), queue->getSettings().maxDepth.getCount());
BOOST_CHECK_EQUAL(settings.maxDepth.getSize(), queue->getSettings().maxDepth.getSize());
}
@@ -307,7 +310,7 @@ QPID_AUTO_TEST_CASE(Enqueue)
BOOST_CHECK_EQUAL(routingKey, msg.getRoutingKey());
BOOST_CHECK_EQUAL(messageId, MessageUtils::getMessageId(msg));
BOOST_CHECK_EQUAL(std::string("xyz"), msg.getAnnotation("abc"));
- BOOST_CHECK_EQUAL((u_int64_t) 14, msg.getContentSize());
+ BOOST_CHECK_EQUAL((u_int64_t) 14, msg.getContent().size());
DummyHandler handler;
MessageUtils::deliver(msg, handler, 100);
diff --git a/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp b/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp
index 2d3f6f922c..d1bc34d5a7 100644
--- a/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp
+++ b/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp
@@ -20,18 +20,20 @@
*/
#include "unit_test.h"
-
-#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
#include "MessageUtils.h"
-#include "qpid/legacystore/StoreException.h"
+
#include "qpid/broker/Queue.h"
#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
#include "qpid/framing/AMQHeaderBody.h"
+#include "qpid/legacystore/MessageStoreImpl.h"
+#include "qpid/legacystore/StoreException.h"
#include "qpid/log/Statement.h"
#include "qpid/log/Logger.h"
#include "qpid/sys/Timer.h"
+#include <iostream>
+
using namespace mrg::msgstore;
using namespace qpid;
using namespace qpid::broker;
@@ -53,7 +55,7 @@ QPID_AUTO_TEST_SUITE(TransactionalTest)
const string test_filename("TransactionalTest");
const char* tdp = getenv("TMP_DATA_DIR");
-const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TransactionalTest");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/TransactionalTest");
// Test txn context which has special setCompleteFailure() method which prevents entire "txn complete" process from hapenning
class TestTxnCtxt : public TxnCtxt
@@ -141,7 +143,8 @@ void restart()
sys::Timer t;
DtxManager mgr(t);
mgr.setStore (store.get());
- RecoveryManagerImpl recovery(*queues, exchanges, links, mgr, br.getProtocolRegistry());
+ RecoveredObjects ro;
+ RecoveryManagerImpl recovery(*queues, exchanges, links, mgr, br.getProtocolRegistry(), ro);
store->recover(recovery);
queueA = queues->find(nameA);
diff --git a/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp b/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp
index 92e49df9e3..25bb9dc607 100644
--- a/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp
+++ b/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp
@@ -20,18 +20,20 @@
*/
#include "unit_test.h"
-
-#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
#include "MessageUtils.h"
+
#include "qpid/broker/Queue.h"
#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
#include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/log/Statement.h"
+#include "qpid/legacystore/MessageStoreImpl.h"
#include "qpid/legacystore/TxnCtxt.h"
#include "qpid/log/Logger.h"
+#include "qpid/log/Statement.h"
#include "qpid/sys/Timer.h"
+#include <iostream>
+
using namespace mrg::msgstore;
using namespace qpid;
using namespace qpid::broker;
@@ -54,7 +56,7 @@ QPID_AUTO_TEST_SUITE(TwoPhaseCommitTest)
const string test_filename("TwoPhaseCommitTest");
const char* tdp = getenv("TMP_DATA_DIR");
-string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TwoPhaseCommitTest");
+string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/TwoPhaseCommitTest");
// === Helper fns ===
@@ -386,7 +388,8 @@ class TwoPhaseCommitTest
links = std::auto_ptr<LinkRegistry>(new LinkRegistry);
dtxmgr = std::auto_ptr<DtxManager>(new DtxManager(t));
dtxmgr->setStore (store.get());
- RecoveryManagerImpl recovery(*queues, exchanges, *links, *dtxmgr, br.getProtocolRegistry());
+ RecoveredObjects ro;
+ RecoveryManagerImpl recovery(*queues, exchanges, *links, *dtxmgr, br.getProtocolRegistry(), ro);
store->recover(recovery);
queueA = queues->find(nameA);
diff --git a/qpid/cpp/src/tests/legacystore/federation/Makefile.am b/qpid/cpp/src/tests/legacystore/federation/Makefile.am
new file mode 100644
index 0000000000..c48e861a65
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/federation/Makefile.am
@@ -0,0 +1,46 @@
+#
+# 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.
+#
+
+
+abs_srcdir=@abs_srcdir@
+
+TMP_DATA_DIR=$(abs_srcdir)/../tmp_data_dir
+
+TESTS = \
+ run_federation_sys_tests
+
+LONG_TESTS = \
+ run_long_federation_sys_tests
+
+EXTRA_DIST = \
+ federation_tests_env.sh \
+ run_federation_sys_tests \
+ run_long_federation_sys_tests
+
+TESTS_ENVIRONMENT = \
+ QPID_DIR=$(QPID_DIR) \
+ QPID_BLD=$(QPID_BLD) \
+ TMP_DATA_DIR=$(TMP_DATA_DIR) \
+ abs_srcdir=$(abs_srcdir)
+
+check-long: all
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
+
+# END
+
diff --git a/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh b/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh
new file mode 100755
index 0000000000..bf75056444
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh
@@ -0,0 +1,313 @@
+#
+# 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.
+#
+
+
+# --- Function definitions ---
+
+func_check_required_env ()
+#-------------------------
+# Check that EITHER:
+# QPID_DIR is set (for running against svn QPID)
+# OR
+# QPID_PREFIX is set (for running against installed QPID
+# Will exit with error code 1 if neither of these is defined.
+# Params: None
+# Returns: 0 if env vars ok, 1 otherwise
+{
+ if test -z "${QPID_DIR}" -a -z "${QPID_PREFIX}"; then
+ # Try to find qpidd in the normal installed location
+ if test -x /usr/sbin/qpidd; then
+ QPID_PREFIX=/usr
+ else
+ echo "ERROR: Could not find installed Qpid"
+ echo "Either of the following must be set in the environment for this script to run:"
+ echo " QPID_DIR for running against a Qpid svn build"
+ echo " QPID_PREFIX for running against an installed Qpid"
+ return 1
+ fi
+ fi
+ return 0
+}
+
+
+func_check_clustering ()
+#-----------------------
+# Check openAIS/corosync is running and user has correct privileges
+# Params: None
+# Returns: 0 if openAIS/corosync is running, 1 otherwise
+# Sets env var COROSYNC to 1 if corosync is running, not set otherwise
+{
+ # Check either aisexec or corosync is running as root
+ cluster_prog=`ps -u root | grep 'aisexec\|corosync'`
+ test -n "$cluster_prog" || NODAEMON="Neither aisexec nor corosync is running as root"
+ if test -z "$NODAEMON"; then
+ # Test for corosync running
+ echo $cluster_prog | grep "aisexec" > /dev/null || COROSYNC=1
+ if test -n "$COROSYNC"; then
+ # Corosync auth test
+ user=`whoami`
+ ls /etc/corosync/uidgid.d | grep $user > /dev/null || NOAUTH="You are not authorized to use corosync."
+ else
+ # OpenAis auth test
+ id -nG | grep '\<ais\>' >/dev/null || NOAUTH="You are not a member of the ais group."
+ fi
+ fi
+
+ if test -n "$NODAEMON" -o -n "$NOAUTH"; then
+ cat <<EOF
+
+ ========== WARNING: NOT RUNNING CLUSTER TESTS ============
+
+ Cluster tests will not be run because:
+
+ $NODAEMON
+ $NOAUTH
+
+ ==========================================================
+
+EOF
+ return 1
+ fi
+ CLUSTERING_ENABLED=1
+ return 0
+}
+
+
+func_check_qpid_python ()
+#------------------------
+# Check that Qpid python environment is ok
+# Params: None
+# Returns: 0 if Python environment is ok; 1 otherwise
+{
+ if ! python -c "import qpid" ; then
+ cat <<EOF
+
+ =========== WARNING: PYTHON TESTS DISABLED ==============
+
+ Unable to load python qpid module - skipping python tests.
+
+ PYTHONPATH=${PYTHONPATH}
+
+ ===========================================================
+
+EOF
+ return 1
+ fi
+ return 0
+}
+
+func_set_python_env()
+#--------------------
+# Set up the python path
+# Params: None
+# Returns: Nothing
+{
+ if test "${QPID_DIR}" -a -d "${QPID_DIR}" ; then
+ QPID_PYTHON=${QPID_DIR}/python
+ QPID_TOOLS=${QPID_DIR}/tools/src/py
+ QMF_LIB=${QPID_DIR}/extras/qmf/src/py
+ export PYTHONPATH=${QPID_PYTHON}:${QMF_LIB}:${QPID_TOOLS}:$PYTHONPATH
+ fi
+}
+
+func_set_env ()
+#--------------
+# Set up the environment based on value of ${QPID_DIR}: if ${QPID_DIR} exists, assume a svn checkout,
+# otherwise set up for an installed or prefix test.
+# Params: None
+# Returns: Nothing
+{
+ if test "${QPID_DIR}" -a -d "${QPID_DIR}" ; then
+ # QPID_DIR is defined for source tree builds by the --with-qpid-checkout configure option.
+ # QPID_BLD is defined as the build directory, either $QPID_DIR/cpp or separately specified with
+ # the --with-qpid-build option for VPATH builds.
+
+ # Check QPID_BLD is also set
+ if test -z ${QPID_BLD}; then
+ QPID_BLD="${QPID_DIR}/cpp"
+ fi
+ source $QPID_BLD/src/tests/test_env.sh
+# CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test"
+# PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME"
+ FEDERATION_SYS_TESTS_FAIL="${QPID_DIR}/cpp/src/tests/federation_sys_tests.fail"
+ if test -z ${STORE_LIB}; then
+ STORE_LIB="../../lib/.libs/msgstore.so"
+ fi
+# export STORE_ENABLE=1
+ else
+ # Set up the environment based on value of ${QPID_PREFIX} for testing against an installed qpid
+ # Alternatively, make sure ${QPID_BIN_DIR}, ${QPID_SBIN_DIR}, ${QPID_LIB_DIR} and ${QPID_LIBEXEC_DIR} are set for
+ # the installed location.
+ if test "${QPID_PREFIX}" -a -d "${QPID_PREFIX}" ; then
+ QPID_BIN_DIR=${QPID_PREFIX}/bin
+ QPID_SBIN_DIR=${QPID_PREFIX}/sbin
+ QPID_LIB_DIR=${QPID_PREFIX}/lib
+ QPID_LIBEXEC_DIR=${QPID_PREFIX}/libexec
+ export PATH="$QPID_BIN_DIR:$QPID_SBIN_DIR:$QPID_LIBEXEC_DIR/qpid/tests:$PATH"
+ fi
+
+ # These four env vars must be set prior to calling this script
+ func_checkpaths QPID_BIN_DIR QPID_SBIN_DIR QPID_LIB_DIR QPID_LIBEXEC_DIR
+
+ # Paths and dirs
+ export PYTHON_DIR="${QPID_BIN_DIR}"
+ export PYTHONPATH="${QPID_LIB_DIR}/python:${QPID_LIBEXEC_DIR}/qpid/tests:${QPID_LIB_DIR}/python2.4:${QPID_LIB_DIR}/python2.4/site-packages:${PYTHONPATH}"
+ # Libraries
+ export CLUSTER_LIB="${QPID_LIB_DIR}/qpid/daemon/cluster.so"
+ export ACL_LIB="${QPID_LIB_DIR}/qpid/daemon/acl.so"
+ export TEST_STORE_LIB="${QPID_LIB_DIR}/qpid/tests/test_store.so"
+
+ # Executables
+# CPP_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/cluster_test"
+# PYTHON_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/$PYTHON_TESTNAME"
+ export QPIDD_EXEC="${QPID_SBIN_DIR}/qpidd"
+ export QPID_CONFIG_EXEC="${QPID_BIN_DIR}/qpid-config"
+ export QPID_ROUTE_EXEC="${QPID_BIN_DIR}/qpid-route"
+ export QPID_CLUSTER_EXEC="${QPID_BIN_DIR}/qpid-cluster"
+# export RECEIVER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/receiver"
+# export SENDER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/sender"
+ export QPID_PYTHON_TEST="${QPID_BIN_DIR}/qpid-python-test"
+
+ # Data
+ FEDERATION_SYS_TESTS_FAIL="${QPID_LIBEXEC_DIR}/qpid/tests/federation_sys_tests.fail"
+ fi
+}
+
+
+func_mk_data_dir ()
+#------------------
+# Create a data dir at ${TMP_DATA_DIR} if not present, clear it otherwise.
+# Set TMP_DATA_DIR if it is not set.
+# Params: None
+# Returns: Nothing
+{
+ if test -z "${TMP_DATA_DIR}"; then
+ TMP_DATA_DIR=/tmp/federation_sys_tests
+ echo "TMP_DATA_DIR not set; using ${TMP_DATA_DIR}"
+ fi
+
+ # Delete old cluster test dirs if they exist
+ if test -d "${TMP_DATA_DIR}" ; then
+ rm -rf "${TMP_DATA_DIR}/cluster"
+ fi
+ mkdir -p "${TMP_DATA_DIR}/cluster"
+ export TMP_DATA_DIR
+}
+
+
+func_checkvar ()
+#---------------
+# Check that an environment var is set (ie non-zero length)
+# Params: $1 - env var to be checked
+# Returns: 0 = env var is set (ie non-zero length)
+# 1 = env var is not set
+{
+ local loc_VAR=$1
+ if test -z ${!loc_VAR}; then
+ echo "WARNING: environment variable ${loc_VAR} not set."
+ return 1
+ fi
+ return 0
+}
+
+
+func_checkpaths ()
+#-----------------
+# Check a list of paths (each can contain ':'-separated sub-list) is set and valid (ie each path exists as a dir)
+# Params: $@ - List of path env vars to be checked
+# Returns: Nothing
+{
+ local loc_PATHS=$@
+ for path in ${loc_PATHS}; do
+ func_checkvar ${path}
+ if test $? == 0; then
+ local temp_IFS=${IFS}
+ IFS=":"
+ local pl=${!path}
+ for p in ${pl[@]}; do
+ if test ! -d ${p}; then
+ echo "WARNING: Directory ${p} in var ${path} not found."
+ fi
+ done
+ IFS=${temp_IFS}
+ fi
+ done
+}
+
+
+func_checklibs ()
+#----------------
+# Check that a list of libs is set and valid (ie each lib exists as an executable file)
+# Params: $@ - List of lib values to be checked
+# Returns: Nothing
+{
+ local loc_LIBS=$@
+ for lib in ${loc_LIBS[@]}; do
+ func_checkvar ${lib}
+ if test $? == 0; then
+ if test ! -x ${!lib}; then
+ echo "WARNING: Library ${lib}=${!lib} not found."
+ fi
+ fi
+ done
+}
+
+
+func_checkexecs ()
+#-----------------
+# Check that a list of executable is set and valid (ie each exec exists as an executable file)
+# Params: $@ - List of exec values to be checked
+# Returns: Nothing
+{
+ local loc_EXECS=$@
+ for exec in ${loc_EXECS[@]}; do
+ func_checkvar ${exec}
+ if test $? == 0; then
+ if test ! -x ${!exec}; then
+ echo "WARNING: Executable ${exec}=${!exec} not found or is not executable."
+ fi
+ fi
+ done
+}
+
+
+#--- Start of script ---
+
+func_set_python_env
+func_check_required_env || exit 1 # Cannot run, exit with error
+func_check_qpid_python || exit 1 # Cannot run, exit with error
+func_check_clustering # Warning
+
+PYTHON_TESTNAME=federation_sys.py
+func_set_env
+func_mk_data_dir
+
+# Check expected environment vars are set
+func_checkpaths PYTHON_DIR PYTHONPATH TMP_DATA_DIR
+func_checklibs CLUSTER_LIB STORE_LIB
+func_checkexecs QPIDD_EXEC QPID_CONFIG_EXEC QPID_ROUTE_EXEC QPID_PYTHON_TEST
+
+FAILING_PYTHON_TESTS="${abs_srcdir}/../failing_python_tests.txt"
+if test -z $1; then
+ FEDERATION_SYS_TEST="${QPID_PYTHON_TEST} -m cluster_tests -I ${FEDERATION_SYS_TESTS_FAIL}"
+else
+ FEDERATION_SYS_TEST="${QPID_PYTHON_TEST} -m cluster_tests -I ${FEDERATION_SYS_TESTS_FAIL} cluster_tests.LongTests.*"
+ LONG_TEST=1
+fi
+
diff --git a/qpid/cpp/src/tests/legacystore/federation/run_federation_sys_tests b/qpid/cpp/src/tests/legacystore/federation/run_federation_sys_tests
new file mode 100755
index 0000000000..dff5f12770
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/federation/run_federation_sys_tests
@@ -0,0 +1,96 @@
+#!/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.
+#
+
+
+# Run the federation tests.
+source ${abs_srcdir}/federation_tests_env.sh
+
+MODULENAME=federation_sys
+
+# Test for long test
+if [[ "$1" == "LONG_TEST" ]]; then
+ USE_LONG_TEST=1
+ shift # get rid of this param so it is not treated as a test name
+fi
+
+trap stop_brokers INT TERM QUIT
+
+MODULES="--load-module ${STORE_LIB} --jfile-size 12 --num-jfiles 4"
+CLUSTER_MODULE="--load-module ${CLUSTER_LIB} "
+if [ -z ${USE_LONG_TEST} ]; then
+ SKIPTESTS="-i federation_sys.A_Long* -i federation_sys.B_Long* -i federation_sys.E_Long* -i federation_sys.F_Long*"
+fi
+if [ -z ${CLUSTERING_ENABLED} ]; then
+ SKIPTESTS="${SKIPTESTS} -i federation_sys.C_* -i federation_sys.D_* -i federation_sys.G_* -i federation_sys.H_*"
+elif [ -z ${USE_LONG_TEST} ]; then
+ SKIPTESTS="${SKIPTESTS} -i federation_sys.C_Long* -i federation_sys.D_Long* -i federation_sys.G_Long* -i federation_sys.H_Long*"
+fi
+
+start_brokers() {
+ clean_or_create_dir() {
+ if [ -n "$1" -a -d $1 ]; then
+ rm -rf $1/*
+ else
+ mkdir -p $1
+ fi
+ }
+ start_broker() {
+ clean_or_create_dir $1
+ ${QPIDD_EXEC} --daemon --port 0 --auth no --data-dir $1 $2 > qpidd.port
+ PORT=`cat qpidd.port`
+ eval "$3=${PORT}"
+ }
+ start_broker ${TMP_DATA_DIR}/local "${MODULES} --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.local" LOCAL_PORT
+ start_broker ${TMP_DATA_DIR}/remote "${MODULES} --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.remote" REMOTE_PORT
+ if [ -n "$CLUSTERING_ENABLED" ]; then
+ start_broker ${TMP_DATA_DIR}/cluster/c1.1 "${MODULES} ${CLUSTER_MODULE} --cluster-name test-cluster-1 --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.cluster1.1" CLUSTER_C1_1
+ start_broker ${TMP_DATA_DIR}/cluster/c1.2 "${MODULES} ${CLUSTER_MODULE} --cluster-name test-cluster-1 --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.cluster1.2" CLUSTER_C1_2
+ start_broker ${TMP_DATA_DIR}/cluster/c2.1 "${MODULES} ${CLUSTER_MODULE} --cluster-name test-cluster-2 --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.cluster2.1" CLUSTER_C2_1
+ start_broker ${TMP_DATA_DIR}/cluster/c2.2 "${MODULES} ${CLUSTER_MODULE} --cluster-name test-cluster-2 --log-enable info+ --log-to-file ${TMP_DATA_DIR}/qpidd.log.cluster2.2" CLUSTER_C2_2
+ fi
+ rm qpidd.port
+}
+
+stop_brokers() {
+ ${QPIDD_EXEC} -q --port ${LOCAL_PORT}
+ ${QPIDD_EXEC} -q --port ${REMOTE_PORT}
+ if [ -n "${CLUSTERING_ENABLED}" ]; then
+ ${QPID_CLUSTER_EXEC} --all-stop --force localhost:${CLUSTER_C1_1}
+ ${QPID_CLUSTER_EXEC} --all-stop --force localhost:${CLUSTER_C2_1}
+ fi
+}
+
+if test -d ${PYTHON_DIR} ; then
+ start_brokers
+ if [ -z ${CLUSTERING_ENABLED} ]; then
+ echo "Running federation tests using brokers on local port ${LOCAL_PORT}, remote port ${REMOTE_PORT} (NOTE: clustering is DISABLED)"
+ else
+ echo "Running federation tests using brokers on local port ${LOCAL_PORT}, remote port ${REMOTE_PORT}, local cluster nodes ${CLUSTER_C1_1} ${CLUSTER_C1_2}, remote cluster nodes ${CLUSTER_C2_1} ${CLUSTER_C2_2}"
+ fi
+ if [ -z ${USE_LONG_TEST} ]; then
+ echo "NOTE: To run a full set of federation system tests, use \"make check-long\"."
+ fi
+ ${QPID_PYTHON_TEST} -m ${MODULENAME} ${SKIPTESTS} -b localhost:$REMOTE_PORT -Dlocal-port=$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dlocal-cluster-ports="$CLUSTER_C1_1 $CLUSTER_C1_2" -Dremote-cluster-ports="$CLUSTER_C2_1 $CLUSTER_C2_2" $@
+ RETCODE=$?
+ stop_brokers
+ if test x$RETCODE != x0; then
+ echo "FAIL federation tests"; exit 1;
+ fi
+fi
diff --git a/qpid/cpp/src/tests/legacystore/federation/run_long_federation_sys_tests b/qpid/cpp/src/tests/legacystore/federation/run_long_federation_sys_tests
new file mode 100755
index 0000000000..d2b8eec32a
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/federation/run_long_federation_sys_tests
@@ -0,0 +1,24 @@
+#! /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.
+#
+
+
+# Run the federation system tests (long version).
+
+./run_federation_sys_tests LONG_TEST $@
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_auto_expand.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_st_auto_expand.cpp
new file mode 100644
index 0000000000..fb5c1f1742
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_auto_expand.cpp
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(journal_auto_expand)
+
+const string test_filename("_st_auto_expand");
+
+#include "_st_helper_fns.h"
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(no_ae_threshold)
+{
+ string test_name = get_test_name(test_filename, "no_ae_threshold");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+ unsigned m;
+
+ // Fill journal to just below threshold
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES,
+ DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE, LARGE_MSG_REC_SIZE_DBLKS);
+ for (m=0; m<t; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ // This enqueue should exceed the threshold
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false, RHM_IORES_ENQCAPTHRESH);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(no_ae_threshold_dequeue_some)
+{
+ string test_name = get_test_name(test_filename, "no_ae_threshold_dequeue_some");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+ unsigned m;
+
+ // Fill journal to just below threshold
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES,
+ DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE, LARGE_MSG_REC_SIZE_DBLKS);
+ for (m=0; m<t; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ // This enqueue should exceed the threshold
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false, RHM_IORES_ENQCAPTHRESH);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+
+ // Dequeue 25 msgs
+ #define NUM_MSGS_DEQ 25
+ for (m=0; m<NUM_MSGS_DEQ; m++)
+ deq_msg(jc, m, m+t);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(t-NUM_MSGS_DEQ));
+
+ // Check we can still enqueue and dequeue
+ for (m=t+NUM_MSGS_DEQ; m<t+NUM_MSGS_DEQ+NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ for (m=t+NUM_MSGS_DEQ; m<t+NUM_MSGS_DEQ+NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS_DEQ+NUM_MSGS);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(no_ae_threshold_dequeue_all)
+{
+ string test_name = get_test_name(test_filename, "no_ae_threshold_dequeue_all");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+ unsigned m;
+
+ // Fill journal to just below threshold
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES,
+ DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE, LARGE_MSG_REC_SIZE_DBLKS);
+ for (m=0; m<t; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ // This enqueue should exceed the threshold
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false, RHM_IORES_ENQCAPTHRESH);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), t);
+
+ // Dequeue all msgs
+ for (m=0; m<t; m++)
+ deq_msg(jc, m, m+t);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+
+ // Check we can still enqueue and dequeue
+ for (m=2*t; m<2*t + NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ for (m=2*t; m<2*t + NUM_MSGS; m++)
+ deq_msg(jc, m, m+2*t+NUM_MSGS);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_basic.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_st_basic.cpp
new file mode 100644
index 0000000000..4aa6d2e29f
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_basic.cpp
@@ -0,0 +1,558 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(journal_basic)
+
+const string test_filename("_st_basic");
+
+#include "_st_helper_fns.h"
+
+// === Test suite ===
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(instantiation)
+{
+ string test_name = get_test_name(test_filename, "instantiation");
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ BOOST_CHECK_EQUAL(jc.is_ready(), false);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(initialization)
+{
+ string test_name = get_test_name(test_filename, "initialization");
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ BOOST_CHECK_EQUAL(jc.is_ready(), false);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ BOOST_CHECK_EQUAL(jc.is_ready(), true);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_block");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS);
+
+ // Again...
+ for (int m=2*NUM_MSGS; m<3*NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ for (int m=2*NUM_MSGS; m<3*NUM_MSGS; m++)
+ deq_msg(jc, m, m+3*NUM_MSGS);
+
+ // Disjoint rids
+ for (int m=10*NUM_MSGS; m<11*NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ for (int m=10*NUM_MSGS; m<11*NUM_MSGS; m++)
+ deq_msg(jc, m, m+11*NUM_MSGS);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_interleaved");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<2*NUM_MSGS; m+=2)
+ {
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ deq_msg(jc, m, m+1);
+ }
+
+ // Again...
+ for (int m=2*NUM_MSGS; m<4*NUM_MSGS; m+=2)
+ {
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ deq_msg(jc, m, m+1);
+ }
+
+ // Disjoint rids
+ for (int m=10*NUM_MSGS; m<12*NUM_MSGS; m+=2)
+ {
+ BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
+ deq_msg(jc, m, m+1);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_interleaved_file_rollover)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_interleaved_file_rollover");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ unsigned n = num_msgs_to_full(NUM_TEST_JFILES, TEST_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ 16*MSG_REC_SIZE_DBLKS, true);
+ for (unsigned m=0; m<3*2*n; m+=2) // overwrite files 3 times
+ {
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+ jc.stop(true);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(empty_recover)
+{
+ string test_name = get_test_name(test_filename, "empty_recover");
+ try
+ {
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ BOOST_CHECK_EQUAL(jc.is_ready(), false);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), false);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ BOOST_CHECK_EQUAL(jc.is_ready(), true);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), false);
+ }
+ {
+ u_int64_t hrid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ BOOST_CHECK_EQUAL(jc.is_ready(), false);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), false);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(jc.is_ready(), true);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), true);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(0));
+ }
+ {
+ u_int64_t hrid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ BOOST_CHECK_EQUAL(jc.is_ready(), false);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), false);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(jc.is_ready(), true);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), true);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(0));
+ jc.recover_complete();
+ BOOST_CHECK_EQUAL(jc.is_ready(), true);
+ BOOST_CHECK_EQUAL(jc.is_read_only(), false);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_recover_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_recover_dequeue_block");
+ try
+ {
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ }
+ {
+ u_int64_t hrid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
+ jc.recover_complete();
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_recover_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_recover_dequeue_interleaved");
+ try
+ {
+ string msg;
+ u_int64_t hrid;
+
+ for (int m=0; m<2*NUM_MSGS; m+=2)
+ {
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ if (m == 0)
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS); // First time only
+ else
+ {
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(m - 1));
+ jc.recover_complete();
+ }
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ }
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(m));
+ jc.recover_complete();
+ deq_msg(jc, m, m+1);
+ }
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(header_flags)
+{
+ string test_name = get_test_name(test_filename, "header_flags");
+ try
+ {
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ // Transient msgs - should not recover
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), true);
+ // Persistent msgs
+ for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ // Transient extern msgs - should not recover
+ for (int m=NUM_MSGS*2; m<NUM_MSGS*3; m++)
+ enq_extern_msg(jc, m, MSG_SIZE, true);
+ // Persistnet extern msgs
+ for (int m=NUM_MSGS*3; m<NUM_MSGS*4; m++)
+ enq_extern_msg(jc, m, MSG_SIZE, false);
+ }
+ {
+ string msg;
+ u_int64_t hrid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ // Recover non-transient msgs
+ for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
+ {
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_MESSAGE(transientFlag == false, "Transient message recovered.");
+ BOOST_CHECK_MESSAGE(externalFlag == false, "External flag incorrect.");
+ BOOST_CHECK_MESSAGE(create_msg(msg, m, MSG_SIZE).compare(rmsg) == 0,
+ "Non-transient message corrupt during recover.");
+ }
+ // Recover non-transient extern msgs
+ for (int m=NUM_MSGS*3; m<NUM_MSGS*4; m++)
+ {
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_MESSAGE(transientFlag == false, "Transient message recovered.");
+ BOOST_CHECK_MESSAGE(externalFlag == true, "External flag incorrect.");
+ BOOST_CHECK_MESSAGE(rmsg.size() == 0, "External message returned non-zero size.");
+ }
+ jc.recover_complete();
+ // Read recovered non-transient msgs
+ for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
+ {
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_MESSAGE(transientFlag == false, "Transient message recovered.");
+ BOOST_CHECK_MESSAGE(externalFlag == false, "External flag incorrect.");
+ BOOST_CHECK_MESSAGE(create_msg(msg, m, MSG_SIZE).compare(rmsg) == 0,
+ "Non-transient message corrupt during recover.");
+ }
+ // Read recovered non-transient extern msgs
+ for (int m=NUM_MSGS*3; m<NUM_MSGS*4; m++)
+ {
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_MESSAGE(transientFlag == false, "Transient message recovered.");
+ BOOST_CHECK_MESSAGE(externalFlag == true, "External flag incorrect.");
+ BOOST_CHECK_MESSAGE(rmsg.size() == 0, "External message returned non-zero size.");
+ }
+ // Dequeue recovered messages
+ for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
+ deq_msg(jc, m, m+3*NUM_MSGS);
+ for (int m=NUM_MSGS*3; m<NUM_MSGS*4; m++)
+ deq_msg(jc, m, m+2*NUM_MSGS);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(double_dequeue)
+{
+ string test_name = get_test_name(test_filename, "double_dequeue");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
+ deq_msg(jc, 0, 1);
+ try{ deq_msg(jc, 0, 2); BOOST_ERROR("Did not throw exception on second dequeue."); }
+ catch (const jexception& e){ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_WMGR_DEQRIDNOTENQ); }
+ enq_msg(jc, 2, create_msg(msg, 1, MSG_SIZE), false);
+ deq_msg(jc, 2, 3);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(journal_overflow)
+{
+ string test_name = get_test_name(test_filename, "journal_overflow");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+ unsigned m;
+
+ // Fill journal to just below threshold
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ MSG_REC_SIZE_DBLKS);
+ u_int32_t d = num_dequeues_rem(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE);
+ for (m=0; m<t; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ // This enqueue should exceed the threshold
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false, RHM_IORES_ENQCAPTHRESH);
+
+ // Dequeue as many msgs as possible except first
+ for (m=1; m<=d; m++)
+ deq_msg(jc, m, m+t);
+ deq_msg(jc, d+1, d+2, RHM_IORES_FULL);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(file_cycle_block)
+{
+ string test_name = get_test_name(test_filename, "file_cycle_block");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+
+ // 5 cycles of enqueue/dequeue blocks of half threshold exception size
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ LARGE_MSG_REC_SIZE_DBLKS)/2;
+ for (unsigned i=0; i<5; i++)
+ {
+ for (unsigned m=2*i*t; m<(2*i+1)*t; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ for (unsigned m=2*i*t; m<(2*i+1)*t; m++)
+ deq_msg(jc, m, m+t);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(file_cycle_interleaved)
+{
+ string test_name = get_test_name(test_filename, "file_cycle_interleaved");
+ try
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+
+ // 5 cycles of enqueue/dequeue blocks of half threshold exception size
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ LARGE_MSG_REC_SIZE_DBLKS)/2;
+ for (unsigned m=0; m<5*2*t; m+=2)
+ {
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_file_cycle_block)
+{
+ string test_name = get_test_name(test_filename, "recover_file_cycle_block");
+ try
+ {
+ string msg;
+ u_int64_t hrid;
+
+ // 5 cycles of enqueue/dequeue blocks of half threshold exception size
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ LARGE_MSG_REC_SIZE_DBLKS)/2;
+ for (unsigned i=0; i<5; i++)
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ if (i)
+ {
+ jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(2*i*t - 1));
+ jc.recover_complete();
+ }
+ else
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+
+ for (unsigned m=2*i*t; m<(2*i+1)*t; m++)
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ for (unsigned m=2*i*t; m<(2*i+1)*t; m++)
+ deq_msg(jc, m, m+t);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_file_cycle_interleaved)
+{
+ string test_name = get_test_name(test_filename, "recover_file_cycle_interleaved");
+ try
+ {
+ string msg;
+ u_int64_t hrid;
+
+ // 5 cycles of enqueue/dequeue blocks of half threshold exception size
+ u_int32_t t = num_msgs_to_threshold(NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
+ LARGE_MSG_REC_SIZE_DBLKS)/2;
+ for (unsigned i=0; i<5; i++)
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ if (i)
+ {
+ jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(2*i*t - 1));
+ jc.recover_complete();
+ }
+ else
+ jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
+
+ for (unsigned m=2*i*t; m<2*(i+1)*t; m+=2)
+ {
+ enq_msg(jc, m, create_msg(msg, m, LARGE_MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#endif
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_basic_txn.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_st_basic_txn.cpp
new file mode 100644
index 0000000000..aa2d31c2ae
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_basic_txn.cpp
@@ -0,0 +1,239 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(journal_basic_txn)
+
+const string test_filename("_st_basic_txn");
+
+#include "_st_helper_fns.h"
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(enqueue_commit_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_commit_dequeue_block");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 0, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(m));
+ txn_commit(jc, NUM_MSGS, xid);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS+1);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_abort_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_abort_dequeue_block");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 0, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(m));
+ txn_abort(jc, NUM_MSGS, xid);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ try
+ {
+ deq_msg(jc, m, m+NUM_MSGS+1);
+ BOOST_ERROR("Expected dequeue to fail with exception JERR_WMGR_DEQRIDNOTENQ.");
+ }
+ catch (const jexception& e) { if (e.err_code() != jerrno::JERR_WMGR_DEQRIDNOTENQ) throw; }
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_commit_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_commit_dequeue_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, m, XID_SIZE);
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, 3*m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(3*m));
+ txn_commit(jc, 3*m+1, xid);
+ deq_msg(jc, 3*m, 3*m+2);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_abort_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_abort_dequeue_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, m, XID_SIZE);
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, 3*m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(3*m));
+ txn_abort(jc, 3*m+1, xid);
+ try
+ {
+ deq_msg(jc, 2*m, 2*m+2);
+ BOOST_ERROR("Expected dequeue to fail with exception JERR_WMGR_DEQRIDNOTENQ.");
+ }
+ catch (const jexception& e) { if (e.err_code() != jerrno::JERR_WMGR_DEQRIDNOTENQ) throw; }
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_commit_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_commit_block");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 0, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(m));
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_txn_msg(jc, m, m+NUM_MSGS, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ txn_commit(jc, 2*NUM_MSGS, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_abort_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_abort_block");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 0, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(m));
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_txn_msg(jc, m, m+NUM_MSGS, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ txn_abort(jc, 2*NUM_MSGS, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_commit_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_commit_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, m, XID_SIZE);
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, 3*m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(3*m));
+ deq_txn_msg(jc, 3*m, 3*m+1, xid);
+ txn_commit(jc, 3*m+2, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_dequeue_abort_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_dequeue_abort_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, m, XID_SIZE);
+ BOOST_CHECK_EQUAL(enq_txn_msg(jc, 3*m, create_msg(msg, m, MSG_SIZE), xid, false), u_int64_t(3*m));
+ deq_txn_msg(jc, 3*m, 3*m+1, xid);
+ txn_abort(jc, 3*m+2, xid);
+ BOOST_CHECK_EQUAL(jc.get_enq_cnt(), u_int32_t(0));
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_helper_fns.h b/qpid/cpp/src/tests/legacystore/jrnl/_st_helper_fns.h
new file mode 100644
index 0000000000..923065dd11
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_helper_fns.h
@@ -0,0 +1,882 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+// NOTE: This file is included in _st_*.cpp files inside the QPID_AUTO_TEST_SUITE()
+// definition.
+
+#define MAX_AIO_SLEEPS 500
+#define AIO_SLEEP_TIME 1000
+#define NUM_TEST_JFILES 4
+#define NUM_DEFAULT_JFILES 8
+#define JRNL_DEFAULT_FSIZE 24 // Multiples of JRNL_RMGR_PAGE_SIZE
+#define TEST_JFSIZE_SBLKS 128
+#define DEFAULT_JFSIZE_SBLKS (JRNL_DEFAULT_FSIZE * JRNL_RMGR_PAGE_SIZE)
+#define NUM_MSGS 5
+#define MSG_REC_SIZE_DBLKS 2
+#define MSG_SIZE (MSG_REC_SIZE_DBLKS * JRNL_DBLK_SIZE) - sizeof(enq_hdr) - sizeof(rec_tail)
+#define LARGE_MSG_REC_SIZE_DBLKS (JRNL_SBLK_SIZE * JRNL_RMGR_PAGE_SIZE)
+#define LARGE_MSG_SIZE (LARGE_MSG_REC_SIZE_DBLKS * JRNL_DBLK_SIZE) - sizeof(enq_hdr) - sizeof(rec_tail)
+#define XID_SIZE 64
+
+#define XLARGE_MSG_RATIO (1.0 * LARGE_MSG_REC_SIZE / JRNL_DBLK_SIZE / JRNL_SBLK_SIZE / JRNL_RMGR_PAGE_SIZE)
+#define XLARGE_MSG_THRESHOLD (int)(JRNL_DEFAULT_FSIZE * NUM_DEFAULT_JFILES * JRNL_ENQ_THRESHOLD / 100 / LARGE_MSG_RATIO)
+
+#define NUM_JFILES 4
+#define JFSIZE_SBLKS 128
+
+const char* tdp = getenv("TMP_DATA_DIR");
+const string test_dir(tdp && strlen(tdp) > 0 ? string(tdp) + "/" + test_filename : "/var/tmp/jrnl_test");
+
+class test_dtok : public data_tok
+{
+private:
+ bool flag;
+public:
+ test_dtok() : data_tok(), flag(false) {}
+ virtual ~test_dtok() {}
+ bool done() { if (flag || _wstate == NONE) return true; else { flag = true; return false; } }
+};
+
+class test_jrnl_cb : public aio_callback {
+ virtual void wr_aio_cb(std::vector<data_tok*>& dtokl)
+ {
+ for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
+ {
+ test_dtok* dtp = static_cast<test_dtok*>(*i);
+ if (dtp->done())
+ delete dtp;
+ }
+ }
+ virtual void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
+};
+
+class test_jrnl : public jcntl
+{
+test_jrnl_cb* cb;
+
+public:
+ test_jrnl(const std::string& jid, const std::string& jdir, const std::string& base_filename, test_jrnl_cb& cb0) :
+ jcntl(jid, jdir, base_filename),
+ cb(&cb0) {}
+ virtual ~test_jrnl() {}
+ void initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
+ const u_int32_t jfsize_sblks)
+ {
+ jcntl::initialize(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE,
+ cb);
+ _jdir.create_dir();
+ }
+ void recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t jfsize_sblks,
+ vector<string>* txn_list, u_int64_t& highest_rid)
+ { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, cb,
+ txn_list, highest_rid); }
+};
+
+/*
+* This class is for testing recover functionality by maintaining an internal lfid-pfid map, then creating physical
+* journal file stubs (just the fhdr section of the journal) and jinf file. This allows the recover functionality (which
+* analyzes these components to determine recover order).
+*
+* First set up a map or "blueprint" of what the journal should look like for recovery, then have the class create the
+* physical files. The jinf object under test then reads and analyzes the created journal, and it's analysis is checked
+* against what is expected.
+*
+* General usage pattern:
+* 1. Create instance of lfid_pfid_map.
+* 2. Call lfid_pfid_map::journal_create() to simulate initial journal creation.
+* 3. (optional) Call lfid_pfid_map::journal_insert() one or more times to simulate the addition of journal files.
+* 4. Call lfid_pfid_map::write_journal() to create dummy journal files (files containing only file headers)
+* 5. Create and initialize the jinf object under test
+* 6. Call jinf::analyze() to determine the pfid order - and thus also first and last lids
+* 7. Call lfid_pfid_map::check_analysis() to check the conclusions of the analysis
+* 8. Call lfid_pfid_map::destroy_journal() to delete the journal files and reset the lfid_pfid_map object.
+* 9. (optional) Back to step 2 for more tests
+*
+* See the individual methods below for more details.
+*/
+class lfid_pfid_map
+{
+ public:
+ typedef pair<u_int16_t, file_hdr> lppair; // Used for loading the map
+ typedef multimap<u_int16_t, file_hdr> lpmap; // Stores the journal "plan" before it is created on-disk
+ typedef lpmap::const_iterator lpmap_citr; // General purpose iterator
+ typedef pair<lpmap_citr, lpmap_citr> lpmap_range; // Range of values returned by multimap's equal_range() fn
+
+ private:
+ string _jid; // Journal id
+ string _base_filename; // Base filename
+ lpmap _map; // Stores the journal "blueprint" before it is created on-disk
+ u_int16_t _num_used_files; // number of files which contain jorunals
+ u_int16_t _oldest_lfid; // lfid where owi flips; always 0 if !_full
+ u_int16_t _last_pfid; // last pfid (ie last file added)
+
+ public:
+ lfid_pfid_map(const string& jid, const string& base_filename) :
+ _jid(jid), _base_filename(base_filename), _num_used_files(0), _oldest_lfid(0), _last_pfid(0)
+ {}
+ virtual ~lfid_pfid_map() {}
+
+ // Mainly used for debugging
+ void print()
+ {
+ int cnt = 0;
+ for (lpmap_citr i=_map.begin(); i!=_map.end(); i++, cnt++)
+ {
+ const file_hdr fh = i->second;
+ cout << " " << cnt << ": owi=" << (fh.get_owi()?"t":"f") << hex << " frid=0x" << fh._rid;
+ cout << " pfid=0x" << fh._pfid << " lfid=0x" << fh._lfid << " fro=0x" << fh._fro << dec << endl;
+ }
+ }
+
+ std::size_t size()
+ {
+ return _map.size();
+ }
+
+ /*
+ * Method journal_create(): Used to simulate the initial creation of a journal before file insertions
+ * take place.
+ *
+ * num_jfiles: The initial journal file count.
+ * num_used_jfiles: If this number is less than num_jfiles, it indicates a clean journal that has not yet
+ * completed its first rotation, and some files are empty (ie all null). The first
+ * num_used_jfiles will contain file headers, the remainder will be blank.
+ * oldest_lfid: The lfid (==pfid, see note 1 below) at which the owi flag flips. During normal operation,
+ * each time the journal rotates back to file 0, a flag (called the overwrite indicator or owi)
+ * is flipped. This flag is saved in the file header. During recovery, if scanning from logical
+ * file 0 upwards, the file at which this flag reverses from its value in file 0 is the file
+ * that was to have been overwritten next, and is thus the "oldest" file. Recovery analysis must
+ * start with this file. oldest_lfid sets the file at which this flag will flip value for the
+ * simulated recovery analysis. Note that this will be ignored if num_used_jfiles < num_jfiles,
+ * as it is not possible for an overwrite to have occurred if not all the files have been used.
+ * first_owi: Sets the value of the owi flag in file 0. If set to false, then the flip will be found with
+ * a true flag (and visa versa).
+ *
+ * NOTES:
+ * 1. By definition, the lfids and pfids coincide for a journal containing no inserted files. Thus pfid == lfid
+ * for all journals created after using initial_journal_create() alone.
+ * 2. By definition, if a journal is not full (num_used_jfiles < num_jfiles), then all owi flags for those files
+ * that are used must be the same. It is not possible for an overwrite situation to arise if a journal is not
+ * full.
+ * 3. This function acts on map _map only, and does not create any test files. Call write_journal() to do that.
+ * 4. This function must be called on a clean test object or on one where the previous test data has been
+ * cleared by calling journal_destroy(). Running this function more than once on existing data will
+ * result in invalid journals which cannot be recovered.
+ */
+ void journal_create(const u_int16_t num_jfiles, // Total number of files
+ const u_int16_t num_used_jfiles, // Number of used files, rest empty at end
+ const u_int16_t oldest_lfid = 0, // Fid where owi reverses
+ const u_int16_t bad_lfid = 0, // Fid where owi reverses again (must be > oldest_lifd),
+ // used for testing bad owi detection
+ const bool first_owi = false) // Value of first owi flag (ie pfid=0)
+ {
+ const bool full = num_used_jfiles == num_jfiles;
+ bool owi = first_owi;
+ _oldest_lfid = full ? oldest_lfid : 0;
+ for (u_int16_t lfid = 0; lfid < num_jfiles; lfid++)
+ {
+ const u_int16_t pfid = lfid;
+ file_hdr fh;
+ if (pfid < num_used_jfiles)
+ {
+ _num_used_files = num_used_jfiles;
+ /*
+ * Invert the owi flag from its current value (initially given by first_owi param) only if:
+ * 1. The journal is full (ie all files are used)
+ * AND
+ * 2. oldest_lfid param is non-zero (this is default, but lfid 0 being inverted is logically
+ * inconsistent with first_owi parameter being present)
+ * AND
+ * 3. Either:
+ * * current lfid == oldest_lfid (ie we are preparing the oldest lfid)
+ * OR
+ * * current lfid == bad_lfid AND bad_lfid > oldest (ie we are past the oldest and preparing the
+ * bad lfid)
+ */
+ if (full && oldest_lfid > 0 &&
+ (lfid == oldest_lfid || (bad_lfid > oldest_lfid && lfid == bad_lfid)))
+ owi = !owi;
+ const u_int64_t frid = u_int64_t(random());
+ init_fhdr(fh, frid, pfid, lfid, owi);
+ }
+ _map.insert(lppair(lfid, fh));
+ }
+ }
+
+ /*
+ * Method journal_insert(): Used to simulate the insertion of journal files into an existing journal.
+ *
+ * after_lfid: The logical file id (lfid) after which the new file is to be inserted.
+ * num_files: The number of files to be inserted.
+ * adjust_lids: Flag indicating that the lids of files _following_ the inserted files are to be adjusted upwards
+ * by the number of inserted files. Not doing so simulates a recovery immediately after insertion
+ * but before the following files are overwritten with their new lids. If this is set false, then:
+ * a) after_lfid MUST be the most recent file (_oldest_lfid-1 ie last lfid before owi changes).
+ * b) This call must be the last insert call.
+ *
+ * NOTES:
+ * 1. It is not possible to insert before lfid/pfid 0; thus these are always coincidental. This operation is
+ * logically equivalent to inserting after the last lfid, which is possible.
+ * 2. It is not possible to insert into a journal that is not full. Doing so will result in an unrecoverable
+ * journal (one that is logically inconsistent that can never occur in reality).
+ * 3. If a journal is stopped/interrupted immediately after a file insertion, there could be duplicate lids in
+ * play at recovery, as the following file lids in their headers are only overwritten when the file is
+ * eventually written to during normal operation. The owi flags, however, are used to determine which of the
+ * ambiguous lids are the inserted files.
+ * 4. This function acts on map _map only, and does not create any test files. Call write_journal() to do that.
+ */
+ void journal_insert(const u_int16_t after_lfid, // Insert files after this lfid
+ const u_int16_t num_files = 1, // Number of files to insert
+ const bool adjust_lids = true) // Adjust lids following inserted files
+ {
+ if (num_files == 0) return;
+ _num_used_files += num_files;
+ const u_int16_t num_jfiles_before_append = _map.size();
+ lpmap_citr i = _map.find(after_lfid);
+ if (i == _map.end()) BOOST_FAIL("Unable to find lfid=" << after_lfid << " in map.");
+ const file_hdr fh_before = (*i).second;
+
+ // Move overlapping lids (if req'd)
+ if (adjust_lids && after_lfid < num_jfiles_before_append - 1)
+ {
+ for (u_int16_t lfid = num_jfiles_before_append - 1; lfid > after_lfid; lfid--)
+ {
+ lpmap_citr itr = _map.find(lfid);
+ if (itr == _map.end()) BOOST_FAIL("Unable to find lfid=" << after_lfid << " in map.");
+ file_hdr fh = itr->second;
+ _map.erase(lfid);
+ fh._lfid += num_files;
+ if (lfid == _oldest_lfid)
+ _oldest_lfid += num_files;
+ _map.insert(lppair(fh._lfid, fh));
+ }
+ }
+
+ // Add new file headers
+ u_int16_t pfid = num_jfiles_before_append;
+ u_int16_t lfid = after_lfid + 1;
+ while (pfid < num_jfiles_before_append + num_files)
+ {
+ const u_int64_t frid = u_int64_t(random());
+ const size_t fro = 0x200;
+ const file_hdr fh(RHM_JDAT_FILE_MAGIC, RHM_JDAT_VERSION, frid, pfid, lfid, fro, fh_before.get_owi(),
+ true);
+ _map.insert(lppair(lfid, fh));
+ _last_pfid = pfid;
+ pfid++;
+ lfid++;
+ }
+ }
+
+ /*
+ * Get the list of pfids in the map in order of lfid. The pfids are appended to the supplied vector. Only
+ * as many headers as are in the map are appended.
+ * NOTE: will clear any contents from supplied vector before appending pfid list.
+ */
+ void get_pfid_list(vector<u_int16_t>& pfid_list)
+ {
+ pfid_list.clear();
+ for (lpmap_citr i = _map.begin(); i != _map.end(); i++)
+ pfid_list.push_back(i->second._pfid);
+ }
+
+ /*
+ * Get the list of lfids in the map. The lfids are appended to the supplied vector in the order they appear
+ * in the map (which is not necessarily the natural or sorted order).
+ * NOTE: will clear any contents from supplied vector before appending lfid list.
+ */
+ void get_lfid_list(vector<u_int16_t>& lfid_list)
+ {
+ lfid_list.clear();
+ lfid_list.assign(_map.size(), 0);
+ for (lpmap_citr i = _map.begin(); i != _map.end(); i++)
+ lfid_list[i->second._pfid] = i->first;
+ }
+
+ /*
+ * Method check_analysis(): Used to check the result of the test jinf object analysis by comparing the pfid order
+ * array it produces against the internal map.
+ *
+ * ji: A ref to the jinf object under test.
+ */
+ void check_analysis(jinf& ji) // jinf object under test after analyze() has been called
+ {
+ BOOST_CHECK_EQUAL(ji.get_first_pfid(), get_first_pfid());
+ BOOST_CHECK_EQUAL(ji.get_last_pfid(), get_last_pfid());
+
+ jinf::pfid_list& pfidl = ji.get_pfid_list();
+ const u_int16_t num_jfiles = _map.size();
+ const bool all_used = _num_used_files == num_jfiles;
+ BOOST_CHECK_EQUAL(pfidl.size(), _num_used_files);
+
+ const u_int16_t lfid_start = all_used ? _oldest_lfid : 0;
+ // Because a simulated failure would leave lfid dups in map and last_fid would not exist in map in this
+ // case, we must find lfid_stop via pfid instead. Search for pfid == num_files.
+ lpmap_citr itr = _map.begin();
+ while (itr != _map.end() && itr->second._pfid != _num_used_files - 1) itr++;
+ if (itr == _map.end())
+ BOOST_FAIL("check(): Unable to find pfid=" << (_num_used_files - 1) << " in map.");
+ const u_int16_t lfid_stop = itr->second._lfid;
+
+ std::size_t fidl_index = 0;
+ for (u_int16_t lfid_cnt = lfid_start; lfid_cnt < lfid_stop; lfid_cnt++, fidl_index++)
+ {
+ const u_int16_t lfid = lfid_cnt % num_jfiles;
+ lpmap_citr itr = _map.find(lfid);
+ if (itr == _map.end())
+ BOOST_FAIL("check(): Unable to find lfid=" << lfid << " in map.");
+ BOOST_CHECK_EQUAL(itr->second._pfid, pfidl[fidl_index]);
+ }
+ }
+
+ /*
+ * Method get_pfid(): Look up a pfid from a known lfid.
+ */
+ u_int16_t get_pfid(const u_int16_t lfid, const bool initial_owi = false)
+ {
+ switch (_map.count(lfid))
+ {
+ case 1:
+ return _map.find(lfid)->second._pfid;
+ case 2:
+ for (lpmap_citr itr = _map.lower_bound(lfid); itr != _map.upper_bound(lfid); itr++)
+ {
+ if (itr->second.get_owi() != initial_owi)
+ return itr->second._pfid;
+ }
+ default:;
+ }
+ BOOST_FAIL("get_pfid(): lfid=" << lfid << " not found in map.");
+ return 0xffff;
+ }
+
+ /*
+ * Method get_first_pfid(): Look up the first (oldest, or next-to-be-overwritten) pfid in the analysis sequence.
+ */
+ u_int16_t get_first_pfid()
+ {
+ return get_pfid(_oldest_lfid);
+ }
+
+ /*
+ * Method get_last_pfid(): Look up the last (newest, or most recently written) pfid in the analysis sequence.
+ */
+ u_int16_t get_last_pfid()
+ {
+ u_int16_t flfid = 0;
+ if (_num_used_files == _map.size()) // journal full?
+ {
+ if (_oldest_lfid)
+ {
+ // if failed insert, cycle past duplicate lids
+ while (_map.count(_oldest_lfid) == 2)
+ _oldest_lfid++;
+ while (_map.find(_oldest_lfid) != _map.end() && _map.find(_oldest_lfid)->second.get_owi() == false)
+ _oldest_lfid++;
+ flfid = _oldest_lfid - 1;
+ }
+ else
+ flfid = _map.size() - 1;
+ }
+ else
+ flfid = _num_used_files - 1;
+ return get_pfid(flfid, true);
+ }
+
+ /*
+ * Method write_journal(): Used to create the dummy journal files from the built-up map created by calling
+ * initial_journal_create() and optionally journal_append() one or more times. Since the jinf object reads the
+ * jinf file and the file headers only, the create object creates a dummy journal file containing only a file
+ * header (512 bytes each) and a single jinf file which contains the journal metadata required for recovery
+ * analysis.
+ */
+ void write_journal(const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t fsize_sblks = JFSIZE_SBLKS)
+ {
+ create_jinf(ae, ae_max_jfiles);
+ u_int16_t pfid = 0;
+ for (lpmap_citr itr = _map.begin(); itr != _map.end(); itr++, pfid++)
+ {
+ if (itr->second._pfid == 0 && itr->second._magic == 0) // empty header, use pfid counter instead
+ create_journal_file(pfid, itr->second, _base_filename, fsize_sblks);
+ else
+ create_journal_file(itr->second._pfid, itr->second, _base_filename, fsize_sblks);
+ }
+ }
+
+ /*
+ * Method destroy_journal(): Destroy the files created by create_journal() and reset the lfid_pfid_map test
+ * object. A new test may be started using the same lfid_pfid_map test object once this call has been made.
+ */
+ void destroy_journal()
+ {
+ for (u_int16_t pfid = 0; pfid < _map.size(); pfid++)
+ {
+ string fn = create_journal_filename(pfid, _base_filename);
+ BOOST_WARN_MESSAGE(::unlink(fn.c_str()) == 0, "destroy_journal(): Failed to remove file " << fn);
+ }
+ clean_journal_info_file(_base_filename);
+ _map.clear();
+ _num_used_files = 0;
+ _oldest_lfid = 0;
+ _last_pfid = 0;
+ }
+
+ /*
+ * Method create_new_jinf(): This static call creates a default jinf file only. This is used to test the read
+ * constructor of a jinf test object which reads a jinf file at instantiation.
+ */
+ static void create_new_jinf(const string jid, const string base_filename, const bool ae)
+ {
+ if (jdir::exists(test_dir))
+ jdir::delete_dir(test_dir);
+ create_jinf(NUM_JFILES, ae, (ae ? 5 * NUM_JFILES : 0), jid, base_filename);
+ }
+
+ /*
+ * Method clean_journal_info_file(): This static method deletes only a jinf file without harming any other
+ * journal file or its directory. This is used to clear those tests which rely only on the existence of a
+ * jinf file.
+ */
+ static void clean_journal_info_file(const string base_filename)
+ {
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ BOOST_WARN_MESSAGE(::unlink(fn.str().c_str()) == 0, "clean_journal_info_file(): Failed to remove file " <<
+ fn.str());
+ }
+
+ static string create_journal_filename(const u_int16_t pfid, const string base_filename)
+ {
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << ".";
+ fn << setfill('0') << hex << setw(4) << pfid << "." << JRNL_DATA_EXTENSION;
+ return fn.str();
+ }
+
+ private:
+ static void init_fhdr(file_hdr& fh,
+ const u_int64_t frid,
+ const u_int16_t pfid,
+ const u_int16_t lfid,
+ const bool owi,
+ const bool no_enq = false)
+ {
+ fh._magic = RHM_JDAT_FILE_MAGIC;
+ fh._version = RHM_JDAT_VERSION;
+#if defined(JRNL_BIG_ENDIAN)
+ fh._eflag = RHM_BENDIAN_FLAG;
+#else
+ fh._eflag = RHM_LENDIAN_FLAG;
+#endif
+ fh._uflag = owi ? rec_hdr::HDR_OVERWRITE_INDICATOR_MASK : 0;
+ fh._rid = frid;
+ fh._pfid = pfid;
+ fh._lfid = lfid;
+ fh._fro = no_enq ? 0 : 0x200;
+ timespec ts;
+ ::clock_gettime(CLOCK_REALTIME, &ts);
+ fh._ts_sec = ts.tv_sec;
+ fh._ts_nsec = ts.tv_nsec;
+ }
+
+ void create_jinf(const bool ae, const u_int16_t ae_max_jfiles)
+ {
+ if (jdir::exists(test_dir))
+ jdir::delete_dir(test_dir);
+ create_jinf(_map.size(), ae, ae_max_jfiles, _jid, _base_filename);
+ }
+
+ static void create_jinf(u_int16_t num_files, const bool ae, const u_int16_t ae_max_jfiles, const string jid,
+ const string base_filename)
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ timespec ts;
+ ::clock_gettime(CLOCK_REALTIME, &ts);
+ jinf ji(jid, test_dir, base_filename, num_files, ae, ae_max_jfiles, JFSIZE_SBLKS, JRNL_WMGR_DEF_PAGE_SIZE,
+ JRNL_WMGR_DEF_PAGES, ts);
+ ji.write();
+ }
+
+ static void create_journal_file(const u_int16_t pfid,
+ const file_hdr& fh,
+ const string base_filename,
+ const u_int32_t fsize_sblks = JFSIZE_SBLKS,
+ const char fill_char = 0)
+ {
+ const std::string filename = create_journal_filename(pfid, base_filename);
+ ofstream of(filename.c_str(), ofstream::out | ofstream::trunc);
+ if (!of.good())
+ BOOST_FAIL("Unable to open test journal file \"" << filename << "\" for writing.");
+
+ write_file_header(filename, of, fh, fill_char);
+ write_file_body(of, fsize_sblks, fill_char);
+
+ of.close();
+ if (of.fail() || of.bad())
+ BOOST_FAIL("Error closing test journal file \"" << filename << "\".");
+ }
+
+ static void write_file_header(const std::string& filename,
+ ofstream& of,
+ const file_hdr& fh,
+ const char fill_char)
+ {
+ // write file header
+ u_int32_t cnt = sizeof(file_hdr);
+ of.write((const char*)&fh, cnt);
+ if (of.fail() || of.bad())
+ BOOST_FAIL("Error writing file header to test journal file \"" << filename << "\".");
+
+ // fill remaining sblk with fill char
+ while (cnt++ < JRNL_DBLK_SIZE * JRNL_SBLK_SIZE)
+ {
+ of.put(fill_char);
+ if (of.fail() || of.bad())
+ BOOST_FAIL("Error writing filler to test journal file \"" << filename << "\".");
+ }
+ }
+
+ static void write_file_body(ofstream& of, const u_int32_t fsize_sblks, const char fill_char)
+ {
+ if (fsize_sblks > 1)
+ {
+ std::vector<char> sblk_buffer(JRNL_DBLK_SIZE * JRNL_SBLK_SIZE, fill_char);
+ u_int32_t fwritten_sblks = 0; // hdr
+ while (fwritten_sblks++ < fsize_sblks)
+ of.write(&sblk_buffer[0], JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
+ }
+ }
+};
+
+const string
+get_test_name(const string& file, const string& test_name)
+{
+ cout << test_filename << "." << test_name << ": " << flush;
+ return file + "." + test_name;
+}
+
+bool
+check_iores(const string& ctxt, const iores ret, const iores exp_ret, test_dtok* dtp)
+{
+ if (ret != exp_ret)
+ {
+ delete dtp;
+ BOOST_FAIL(ctxt << ": Expected " << iores_str(exp_ret) << "; got " << iores_str(ret));
+ }
+ return false;
+}
+
+bool
+handle_jcntl_response(const iores res, jcntl& jc, unsigned& aio_sleep_cnt, const std::string& ctxt, const iores exp_ret,
+ test_dtok* dtp)
+{
+ if (res == RHM_IORES_PAGE_AIOWAIT)
+ {
+ if (++aio_sleep_cnt <= MAX_AIO_SLEEPS)
+ {
+ jc.get_wr_events(0); // *** GEV2
+ usleep(AIO_SLEEP_TIME);
+ }
+ else
+ return check_iores(ctxt, res, exp_ret, dtp);
+ }
+ else
+ return check_iores(ctxt, res, exp_ret, dtp);
+ return true;
+}
+
+u_int64_t
+enq_msg(jcntl& jc,
+ const u_int64_t rid,
+ const string& msg,
+ const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "enq_msg(" << rid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.enqueue_data_record(msg.c_str(), msg.size(), msg.size(), dtp, transient);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+enq_extern_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "enq_extern_msg(" << rid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.enqueue_extern_data_record(msg_size, dtp, transient);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+enq_txn_msg(jcntl& jc, const u_int64_t rid, const string& msg, const string& xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "enq_txn_msg(" << rid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.enqueue_txn_data_record(msg.c_str(), msg.size(), msg.size(), dtp, xid,
+ transient);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+enq_extern_txn_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const string& xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "enq_extern_txn_msg(" << rid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.enqueue_extern_txn_data_record(msg_size, dtp, xid, transient);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+deq_msg(jcntl& jc, const u_int64_t drid, const u_int64_t rid, const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "deq_msg(" << drid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_dequeue_rid(drid);
+ dtp->set_external_rid(true);
+ dtp->set_wstate(data_tok::ENQ);
+ try
+ {
+ iores res = jc.dequeue_data_record(dtp);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+deq_txn_msg(jcntl& jc, const u_int64_t drid, const u_int64_t rid, const string& xid,
+ const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ ostringstream ctxt;
+ ctxt << "deq_txn_msg(" << drid << ")";
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_dequeue_rid(drid);
+ dtp->set_external_rid(true);
+ dtp->set_wstate(data_tok::ENQ);
+ try
+ {
+ iores res = jc.dequeue_txn_data_record(dtp, xid);
+ check_iores(ctxt.str(), res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+txn_abort(jcntl& jc, const u_int64_t rid, const string& xid, const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.txn_abort(dtp, xid);
+ check_iores("txn_abort", res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+u_int64_t
+txn_commit(jcntl& jc, const u_int64_t rid, const string& xid, const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_rid(rid);
+ dtp->set_external_rid(true);
+ try
+ {
+ iores res = jc.txn_commit(dtp, xid);
+ check_iores("txn_commit", res, exp_ret, dtp);
+ u_int64_t dtok_rid = dtp->rid();
+ if (dtp->done()) delete dtp;
+ return dtok_rid;
+ }
+ catch (exception& e) { delete dtp; throw; }
+}
+
+void
+read_msg(jcntl& jc, string& msg, string& xid, bool& transient, bool& external, const iores exp_ret = RHM_IORES_SUCCESS)
+{
+ void* mp = 0;
+ std::size_t msize = 0;
+ void* xp = 0;
+ std::size_t xsize = 0;
+ test_dtok* dtp = new test_dtok;
+ BOOST_CHECK_MESSAGE(dtp != 0, "Data token allocation failed (dtp == 0).");
+ dtp->set_wstate(data_tok::ENQ);
+
+ unsigned aio_sleep_cnt = 0;
+ try
+ {
+ iores res = jc.read_data_record(&mp, msize, &xp, xsize, transient, external, dtp);
+ while (handle_jcntl_response(res, jc, aio_sleep_cnt, "read_msg", exp_ret, dtp))
+ res = jc.read_data_record(&mp, msize, &xp, xsize, transient, external, dtp);
+ }
+ catch (exception& e) { delete dtp; throw; }
+
+ if (mp)
+ msg.assign((char*)mp, msize);
+ if (xp)
+ {
+ xid.assign((char*)xp, xsize);
+ std::free(xp);
+ xp = 0;
+ }
+ else if (mp)
+ {
+ std::free(mp);
+ mp = 0;
+ }
+ delete dtp;
+}
+
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty journal with or without
+ * corresponding dequeues (controlled by include_deq) without a threshold - ie until the journal is full. Assumes
+ * that dequeue records fit into one dblk.
+ */
+u_int32_t
+num_msgs_to_full(const u_int16_t num_files, const u_int32_t file_size_dblks, const u_int32_t msg_rec_size_dblks,
+ bool include_deq)
+{
+ u_int32_t rec_size_dblks = msg_rec_size_dblks;
+ if (include_deq)
+ rec_size_dblks++;
+ return u_int32_t(::floor(1.0 * num_files * file_size_dblks / rec_size_dblks));
+}
+
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty journal before the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
+u_int32_t
+num_msgs_to_threshold(const u_int16_t num_files, const u_int32_t file_size_dblks, const u_int32_t msg_rec_size_dblks)
+{
+ return u_int32_t(::floor(1.0 * num_files * file_size_dblks * JRNL_ENQ_THRESHOLD / msg_rec_size_dblks / 100));
+}
+
+/*
+ * Returns the amount of space reserved in dblks (== num dequeues assuming dequeue size of 1 dblk) for the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
+u_int32_t
+num_dequeues_rem(const u_int16_t num_files, const u_int32_t file_size_dblks)
+{
+ /*
+ * Fraction of journal remaining after threshold is used --------------+
+ * Total no. dblks in journal ------+ |
+ * | |
+ * +------------+------------+ +-----------------+---------------------+
+ */
+ return u_int32_t(::ceil(num_files * file_size_dblks * (1.0 - (1.0 * JRNL_ENQ_THRESHOLD / 100))));
+}
+
+string&
+create_msg(string& s, const int msg_num, const int len)
+{
+ ostringstream oss;
+ oss << "MSG_" << setfill('0') << setw(6) << msg_num << "_";
+ for (int i=12; i<=len; i++)
+ oss << (char)('0' + i%10);
+ s.assign(oss.str());
+ return s;
+}
+
+string&
+create_xid(string& s, const int msg_num, const int len)
+{
+ ostringstream oss;
+ oss << "XID_" << setfill('0') << setw(6) << msg_num << "_";
+ for (int i=11; i<len; i++)
+ oss << (char)('a' + i%26);
+ s.assign(oss.str());
+ return s;
+}
+
+long
+get_seed()
+{
+ timespec ts;
+ if (::clock_gettime(CLOCK_REALTIME, &ts))
+ BOOST_FAIL("Unable to read clock to generate seed.");
+ long tenths = ts.tv_nsec / 100000000;
+ return long(10 * ts.tv_sec + tenths); // time in tenths of a second
+}
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_read.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_st_read.cpp
new file mode 100644
index 0000000000..ff2c39e14c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_read.cpp
@@ -0,0 +1,460 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(journal_read)
+
+const string test_filename("_st_read");
+
+#include "_st_helper_fns.h"
+
+// === Test suite ===
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(empty_read)
+{
+ string test_name = get_test_name(test_filename, "empty_read");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_read_dequeue_block");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_read_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_read_dequeue_interleaved");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<500*NUM_MSGS; m+=2)
+ {
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ deq_msg(jc, m, m+1);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_recovered_read_dequeue)
+{
+ string test_name = get_test_name(test_filename, "enqueue_recovered_read_dequeue");
+ try
+ {
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ }
+ {
+ string msg;
+ u_int64_t hrid;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
+ jc.recover_complete();
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(multi_page_enqueue_recovered_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "multi_page_enqueue_recovered_read_dequeue_block");
+ try
+ {
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS*125; m++)
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ }
+ {
+ string msg;
+ u_int64_t hrid;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS*125 - 1));
+ jc.recover_complete();
+ for (int m=0; m<NUM_MSGS*125; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS*125; m++)
+ deq_msg(jc, m, m+NUM_MSGS*125);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_recover_read_recovered_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_recover_read_recovered_read_dequeue_block");
+ try
+ {
+ {
+ string msg;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ }
+ {
+ string msg;
+ u_int64_t hrid;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ {
+ string msg;
+ u_int64_t hrid;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
+ BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ jc.recover_complete();
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(delayed_read)
+{
+ string test_name = get_test_name(test_filename, "delayed_read");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ unsigned m;
+ for (m=0; m<2*NUM_MSGS; m+=2)
+ {
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(msg, rmsg);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(cache_cycled_delayed_read)
+{
+ string test_name = get_test_name(test_filename, "cache_cycled_delayed_read");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ unsigned m;
+ unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, 16*MSG_REC_SIZE_DBLKS, true);
+ for (m=0; m<2*2*n + 20; m+=2) // fill read buffer twice + 10 msgs
+ {
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(msg, rmsg);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(multi_page_enqueue_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "multi_page_enqueue_read_dequeue_block");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
+ for (int i=0; i<10; i++)
+ {
+ for (int m=0; m<NUM_MSGS*125; m++)
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS*125; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS*125; m++)
+ deq_msg(jc, m, m+NUM_MSGS*125);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(increasing_interval_delayed_read)
+{
+ string test_name = get_test_name(test_filename, "increasing_interval_delayed_read");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, MSG_REC_SIZE_DBLKS, true);
+ unsigned m = 0;
+
+ // Validate read pipeline
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ deq_msg(jc, m, m+1);
+ m += 2;
+
+ // repeat the following multiple times...
+ for (int i=0; i<10; i++)
+ {
+ // Invalidate read pipeline with large write
+ unsigned t = m + (i*n) + 25;
+ for (; m<t; m+=2)
+ {
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ deq_msg(jc, m, m+1);
+ }
+
+ // Revalidate read pipeline
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ jc.flush();
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(msg, rmsg);
+ deq_msg(jc, m, m+1);
+ m += 2;
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#endif
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_st_read_txn.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_st_read_txn.cpp
new file mode 100644
index 0000000000..621777d8d3
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_st_read_txn.cpp
@@ -0,0 +1,353 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(journal_read_txn)
+
+const string test_filename("_st_read_txn");
+
+#include "_st_helper_fns.h"
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(tx_enqueue_commit_block)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_commit_block");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 0, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_commit(jc, NUM_MSGS, xid);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(rxid, xid);
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(tx_enqueue_commit_interleaved)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_commit_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, 2*m, XID_SIZE);
+ enq_txn_msg(jc, 2*m, create_msg(msg, 2*m, MSG_SIZE), xid, false);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_commit(jc, 2*m+1, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, 2*m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(rxid, xid);
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(tx_enqueue_abort_block)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_abort_block");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 1, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_abort(jc, NUM_MSGS, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(tx_enqueue_abort_interleaved)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_abort_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, 2*m, XID_SIZE);
+ enq_txn_msg(jc, 2*m, create_msg(msg, 2*m, MSG_SIZE), xid, false);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_abort(jc, 2*m+1, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(tx_enqueue_commit_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_commit_dequeue_block");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ create_xid(xid, 2, XID_SIZE);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
+ txn_commit(jc, NUM_MSGS, xid);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_msg(jc, m, m+NUM_MSGS+1);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(tx_enqueue_commit_dequeue_interleaved)
+{
+ string test_name = get_test_name(test_filename, "tx_enqueue_commit_dequeue_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ create_xid(xid, 3*m, XID_SIZE);
+ enq_txn_msg(jc, 3*m, create_msg(msg, m, MSG_SIZE), xid, false);
+ txn_commit(jc, 3*m+1, xid);
+ deq_msg(jc, 3*m, 3*m+2);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_tx_dequeue_commit_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_tx_dequeue_commit_block");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ create_xid(xid, 3, XID_SIZE);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_txn_msg(jc, m, m+NUM_MSGS, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_commit(jc, 2*NUM_MSGS, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_tx_dequeue_commit_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_tx_dequeue_commit_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ enq_msg(jc, 3*m, create_msg(msg, 3*m, MSG_SIZE), false);
+ create_xid(xid, 3*m, XID_SIZE);
+ deq_txn_msg(jc, 3*m, 3*m+1, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_commit(jc, 3*m+2, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_tx_dequeue_abort_block)
+{
+ string test_name = get_test_name(test_filename, "enqueue_tx_dequeue_abort_block");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ create_xid(xid, 4, XID_SIZE);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
+ for (int m=0; m<NUM_MSGS; m++)
+ deq_txn_msg(jc, m, m+NUM_MSGS, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_abort(jc, 2*NUM_MSGS, xid);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(rxid.length(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enqueue_tx_dequeue_abort_interleaved)
+{
+ string test_name = get_test_name(test_filename, "enqueue_tx_dequeue_abort_interleaved");
+ try
+ {
+ string msg;
+ string xid;
+ string rmsg;
+ string rxid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ for (int m=0; m<NUM_MSGS; m++)
+ {
+ enq_msg(jc, 3*m, create_msg(msg, 3*m, MSG_SIZE), false);
+ create_xid(xid, 3*m, XID_SIZE);
+ deq_txn_msg(jc, 3*m, 3*m+1, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_TXPENDING);
+ txn_abort(jc, 3*m+2, xid);
+ jc.flush();
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag);
+ read_msg(jc, rmsg, rxid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_enq_map.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_enq_map.cpp
new file mode 100644
index 0000000000..f05dcb824c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_enq_map.cpp
@@ -0,0 +1,320 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <iostream>
+#include "qpid/legacystore/jrnl/enq_map.h"
+#include "qpid/legacystore/jrnl/jerrno.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(enq_map_suite)
+
+const string test_filename("_ut_enq_map");
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ enq_map e1;
+ BOOST_CHECK(e1.empty());
+ BOOST_CHECK_EQUAL(e1.size(), u_int32_t(0));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(insert_get)
+{
+ cout << test_filename << ".insert_get: " << flush;
+ u_int16_t pfid;
+ u_int64_t rid;
+ u_int16_t pfid_start = 0x2000U;
+ u_int64_t rid_begin = 0xffffffff00000000ULL;
+ u_int64_t rid_end = 0xffffffff00000200ULL;
+
+ // insert with no dups
+ u_int64_t rid_incr_1 = 4ULL;
+ enq_map e2;
+ e2.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
+ BOOST_CHECK_EQUAL(e2.insert_pfid(rid, pfid), enq_map::EMAP_OK);
+ BOOST_CHECK(!e2.empty());
+ BOOST_CHECK_EQUAL(e2.size(), u_int32_t(128));
+
+ // get
+ u_int64_t rid_incr_2 = 6ULL;
+ for (u_int64_t rid = rid_begin; rid < rid_end; rid += rid_incr_2)
+ {
+ BOOST_CHECK_EQUAL(e2.is_enqueued(rid), (rid%rid_incr_1 ? false : true));
+ u_int16_t exp_pfid = pfid_start + (u_int16_t)((rid - rid_begin)/rid_incr_1);
+ int16_t ret_fid = e2.get_pfid(rid);
+ if (ret_fid < enq_map::EMAP_OK) // fail
+ {
+ BOOST_CHECK_EQUAL(ret_fid, enq_map::EMAP_RID_NOT_FOUND);
+ BOOST_CHECK(rid%rid_incr_1);
+ }
+ else
+ {
+ BOOST_CHECK_EQUAL(ret_fid, exp_pfid);
+ BOOST_CHECK(rid%rid_incr_1 == 0);
+ }
+ if ((rid + rid_incr_2)%(8 * rid_incr_2) == 0)
+ pfid++;
+ }
+
+ // insert with dups
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_2, pfid++)
+ {
+ int16_t res = e2.insert_pfid(rid, pfid);
+ if (res < enq_map::EMAP_OK) // fail
+ {
+ BOOST_CHECK_EQUAL(res, enq_map::EMAP_DUP_RID);
+ BOOST_CHECK(rid%rid_incr_1 == 0);
+ }
+ else
+ BOOST_CHECK(rid%rid_incr_1);
+ }
+ BOOST_CHECK_EQUAL(e2.size(), u_int32_t(171));
+ e2.clear();
+ BOOST_CHECK(e2.empty());
+ BOOST_CHECK_EQUAL(e2.size(), u_int32_t(0));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(get_remove)
+{
+ cout << test_filename << ".get_remove: " << flush;
+ u_int16_t pfid;
+ u_int64_t rid;
+ u_int16_t pfid_start = 0x3000U;
+ u_int64_t rid_begin = 0xeeeeeeee00000000ULL;
+ u_int64_t rid_end = 0xeeeeeeee00000200ULL;
+
+ u_int64_t rid_incr_1 = 4ULL;
+ u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
+ enq_map e3;
+ e3.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
+ BOOST_CHECK_EQUAL(e3.insert_pfid(rid, pfid), enq_map::EMAP_OK);
+ BOOST_CHECK_EQUAL(e3.size(), num_incr_1);
+
+ u_int64_t rid_incr_2 = 6ULL;
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_2, pfid++)
+ {
+ u_int16_t exp_pfid = pfid_start + (u_int16_t)((rid - rid_begin)/rid_incr_1);
+ int16_t ret_fid = e3.get_remove_pfid(rid);
+ if (ret_fid < enq_map::EMAP_OK) // fail
+ {
+ BOOST_CHECK_EQUAL(ret_fid, enq_map::EMAP_RID_NOT_FOUND);
+ BOOST_CHECK(rid%rid_incr_1);
+ }
+ else
+ {
+ BOOST_CHECK_EQUAL(ret_fid, exp_pfid);
+ BOOST_CHECK(rid%rid_incr_1 == 0);
+ }
+ }
+ BOOST_CHECK_EQUAL(e3.size(), u_int32_t(85));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(lock)
+{
+ cout << test_filename << ".lock: " << flush;
+ u_int16_t pfid;
+ u_int64_t rid;
+ u_int16_t pfid_start = 0x4000U;
+ u_int64_t rid_begin = 0xdddddddd00000000ULL;
+ u_int64_t rid_end = 0xdddddddd00000200ULL;
+
+ // insert, every second entry is locked
+ u_int64_t rid_incr_1 = 4ULL;
+ u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
+ bool locked = false;
+ enq_map e4;
+ e4.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
+ {
+ BOOST_CHECK_EQUAL(e4.insert_pfid(rid, pfid, locked), enq_map::EMAP_OK);
+ locked = !locked;
+ }
+ BOOST_CHECK_EQUAL(e4.size(), num_incr_1);
+
+ // unlock and lock non-existent rids
+ int16_t res = e4.lock(1ULL);
+ if (res < enq_map::EMAP_OK)
+ BOOST_CHECK_EQUAL(res, enq_map::EMAP_RID_NOT_FOUND);
+ else
+ BOOST_ERROR("Failed to detect locking non-existent rid.");
+ res = e4.unlock(2ULL);
+ if (res < enq_map::EMAP_OK)
+ BOOST_CHECK_EQUAL(res, enq_map::EMAP_RID_NOT_FOUND);
+ else
+ BOOST_ERROR("Failed to detect unlocking non-existent rid.");
+
+ // get / unlock
+ for (u_int64_t rid = rid_begin; rid < rid_end; rid += rid_incr_1)
+ {
+ int16_t fid = e4.get_pfid(rid);
+ if (fid < enq_map::EMAP_OK) // fail
+ {
+ BOOST_CHECK_EQUAL(fid, enq_map::EMAP_LOCKED);
+ BOOST_CHECK(rid%(2*rid_incr_1));
+ // unlock, read, then relock
+ BOOST_CHECK_EQUAL(e4.unlock(rid), enq_map::EMAP_OK);
+ BOOST_CHECK(e4.get_pfid(rid) >= enq_map::EMAP_OK);
+ BOOST_CHECK_EQUAL(e4.lock(rid), enq_map::EMAP_OK);
+ fid = e4.get_pfid(rid);
+ if (fid < enq_map::EMAP_OK) // fail
+ BOOST_CHECK_EQUAL(fid, enq_map::EMAP_LOCKED);
+ else
+ BOOST_ERROR("Failed to prevent getting locked record");
+ }
+ }
+
+ // remove all; if locked, use with txn_flag true; should ignore all locked records
+ for (u_int64_t rid = rid_begin; rid < rid_end; rid += rid_incr_1)
+ BOOST_CHECK(e4.get_remove_pfid(rid, true) >= enq_map::EMAP_OK);
+ BOOST_CHECK(e4.empty());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(lists)
+{
+ cout << test_filename << ".lists: " << flush;
+ u_int16_t pfid;
+ u_int64_t rid;
+ u_int16_t pfid_start = 0x5000UL;
+ u_int64_t rid_begin = 0xdddddddd00000000ULL;
+ u_int64_t rid_end = 0xdddddddd00000200ULL;
+
+ // insert, every second entry is locked
+ u_int64_t rid_incr_1 = 4ULL;
+ u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
+ vector<u_int64_t> rid_list;
+ vector<u_int16_t> pfid_list;
+ enq_map e5;
+ e5.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
+ {
+ BOOST_CHECK_EQUAL(e5.insert_pfid(rid, pfid), enq_map::EMAP_OK);
+ rid_list.push_back(rid);
+ pfid_list.push_back(pfid);
+ }
+ BOOST_CHECK_EQUAL(e5.size(), num_incr_1);
+ BOOST_CHECK_EQUAL(rid_list.size(), num_incr_1);
+ BOOST_CHECK_EQUAL(pfid_list.size(), num_incr_1);
+
+ vector<u_int64_t> ret_rid_list;
+ e5.rid_list(ret_rid_list);
+ BOOST_CHECK_EQUAL(ret_rid_list.size(), num_incr_1);
+ for (unsigned i=0; i<ret_rid_list.size(); i++)
+ BOOST_CHECK_EQUAL(rid_list[i], ret_rid_list[i]);
+
+ vector<u_int16_t> ret_pfid_list;
+ e5.pfid_list(ret_pfid_list);
+ BOOST_CHECK_EQUAL(ret_pfid_list.size(), num_incr_1);
+ for (unsigned i=0; i<ret_pfid_list.size(); i++)
+ BOOST_CHECK_EQUAL(pfid_list[i], ret_pfid_list[i]);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enq_count)
+{
+ cout << test_filename << ".enq_count: " << flush;
+
+ enq_map e6;
+
+ // Check the allocation and cleanup as the file size is set both up and down
+ e6.set_num_jfiles(24);
+ e6.set_num_jfiles(0);
+ e6.set_num_jfiles(100);
+ e6.set_num_jfiles(4);
+
+ // Add 100 enqueues to file 1, check that the counts match
+ for (u_int16_t pfid=0; pfid<4; pfid++)
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(0));
+ for (u_int64_t rid=0; rid<100; rid++)
+ BOOST_CHECK_EQUAL(e6.insert_pfid(rid, 1), enq_map::EMAP_OK);
+ for (u_int16_t pfid=0; pfid<4; pfid++)
+ {
+ if (pfid == 1)
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(100));
+ else
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(0));
+ }
+
+ // Now remove 10 from file 1, check that the counts match
+ for (u_int64_t rid=0; rid<100; rid+=10)
+ //e6.Xget_remove_pfid(rid);
+ BOOST_CHECK(e6.get_remove_pfid(rid) >= enq_map::EMAP_OK);
+ for (u_int16_t pfid=0; pfid<4; pfid++)
+ {
+ if (pfid == 1)
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(90));
+ else
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(0));
+ }
+
+ // Now resize the file up and make sure the count in file 1 still exists
+ e6.set_num_jfiles(8);
+ for (u_int16_t pfid=0; pfid<8; pfid++)
+ {
+ if (pfid == 1)
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(90));
+ else
+ BOOST_CHECK_EQUAL(e6.get_enq_cnt(pfid), u_int32_t(0));
+ }
+
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(stress)
+{
+ cout << test_filename << ".stress: " << flush;
+ u_int64_t rid;
+ u_int64_t rid_cnt;
+ u_int64_t rid_begin = 0xffffffff00000000ULL;
+ u_int64_t num_rid = 10;
+
+ enq_map e7;
+ e7.set_num_jfiles(rid_begin + num_rid);
+
+ // insert even rids with no dups
+ for (rid = rid_begin, rid_cnt = u_int64_t(0); rid_cnt < num_rid; rid += 2ULL, rid_cnt++)
+ BOOST_CHECK_EQUAL(e7.insert_pfid(rid, u_int16_t(0)), enq_map::EMAP_OK);
+ BOOST_CHECK_EQUAL(e7.size(), num_rid);
+
+ // insert odd rids with no dups
+ for (rid = rid_begin + 1, rid_cnt = u_int64_t(0); rid_cnt < num_rid; rid += 2ULL, rid_cnt++)
+ BOOST_CHECK_EQUAL(e7.insert_pfid(rid, u_int16_t(0)), enq_map::EMAP_OK);
+ BOOST_CHECK_EQUAL(e7.size(), num_rid * 2);
+
+ // remove even rids
+ for (rid = rid_begin, rid_cnt = u_int64_t(0); rid_cnt < num_rid; rid += 2ULL, rid_cnt++)
+ BOOST_CHECK(e7.get_remove_pfid(rid) >= enq_map::EMAP_OK);
+ BOOST_CHECK_EQUAL(e7.size(), num_rid);
+
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp
new file mode 100644
index 0000000000..842ea5c9ef
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp
@@ -0,0 +1,416 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <cerrno>
+#include <cstring>
+#include <dirent.h>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include "qpid/legacystore/jrnl/file_hdr.h"
+#include "qpid/legacystore/jrnl/jcfg.h"
+#include "qpid/legacystore/jrnl/jdir.h"
+#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/legacystore/jrnl/jexception.h"
+#include <sys/stat.h>
+
+#define NUM_JFILES 4
+#define JFSIZE_SBLKS 128
+
+#define ERRORSTR(e) std::strerror(e) << " (" << e << ")"
+#define NUM_CLEAR_OPS 20
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jdir_suite)
+
+const string test_filename("_ut_jdir");
+const char* tdp = getenv("TMP_DATA_DIR");
+const string test_dir(tdp && strlen(tdp) > 0 ? string(tdp) + "/_ut_jdir" : "/var/tmp/_ut_jdir");
+
+// === Helper functions ===
+
+void create_file(const char* filename, mode_t fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+{
+ ofstream of(filename, ofstream::out | ofstream::trunc);
+ if (!of.good())
+ BOOST_FAIL("Unable to open file " << filename << " for writing.");
+ of.write(filename, std::strlen(filename));
+ of.close();
+ ::chmod(filename, fmode);
+}
+
+void create_file(const string filename, mode_t fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+{
+ create_file(filename.c_str(), fmode);
+}
+
+void create_jdat_file(const char* dirname, const char* base_filename, u_int32_t fid,
+ u_int64_t first_rid)
+{
+ stringstream fn;
+ fn << dirname << "/" << base_filename << ".";
+ fn << setfill('0') << hex << setw(4) << fid << ".jdat";
+ file_hdr fh(RHM_JDAT_FILE_MAGIC, RHM_JDAT_VERSION, 0, first_rid, fid, 0x200, true);
+ ofstream of(fn.str().c_str(), ofstream::out | ofstream::trunc);
+ if (!of.good())
+ BOOST_FAIL("Unable to open journal data file " << fn << " for writing.");
+ of.write((const char*)&fh, sizeof(file_hdr));
+ of.close();
+}
+
+void create_jinf_file(const char* dirname, const char* base_filename)
+{
+ timespec ts;
+ ::clock_gettime(CLOCK_REALTIME, &ts);
+ jinf ji("test journal id", dirname, base_filename, NUM_JFILES, false, 0, JFSIZE_SBLKS,
+ JRNL_WMGR_DEF_PAGE_SIZE, JRNL_WMGR_DEF_PAGES, ts);
+ ji.write();
+}
+
+void create_jrnl_fileset(const char* dirname, const char* base_filename)
+{
+ create_jinf_file(dirname, base_filename);
+ for (u_int32_t fid = 0; fid < NUM_JFILES; fid++)
+ {
+ u_int64_t rid = 0x12340000 + (fid * 0x25);
+ create_jdat_file(dirname, base_filename, fid, rid);
+ }
+}
+
+unsigned count_dir_contents(const char* dirname, bool incl_files, bool incl_dirs = true)
+{
+ struct dirent* entry;
+ struct stat s;
+ unsigned file_cnt = 0;
+ unsigned dir_cnt = 0;
+ unsigned other_cnt = 0;
+ DIR* dir = ::opendir(dirname);
+ if (!dir)
+ BOOST_FAIL("Unable to open directory " << dirname);
+ while ((entry = ::readdir(dir)) != NULL)
+ {
+ // Ignore . and ..
+ if (std::strcmp(entry->d_name, ".") != 0 && std::strcmp(entry->d_name, "..") != 0)
+ {
+ stringstream fn;
+ fn << dirname << "/" << entry->d_name;
+ if (::stat(fn.str().c_str(), &s))
+ BOOST_FAIL("Unable to stat dir entry " << entry->d_name << "; err=" <<
+ ERRORSTR(errno));
+ if (S_ISREG(s.st_mode))
+ file_cnt++;
+ else if (S_ISDIR(s.st_mode))
+ dir_cnt++;
+ else
+ other_cnt++;
+ }
+ }
+ ::closedir(dir);
+ if (incl_files)
+ {
+ if (incl_dirs)
+ return file_cnt + dir_cnt;
+ return file_cnt;
+ }
+ else if (incl_dirs)
+ return dir_cnt;
+ return other_cnt;
+}
+
+void check_dir_contents(const char* dirname, const char* base_filename, unsigned num_subdirs,
+ bool jrnl_present)
+{
+ if (jdir::is_dir(dirname))
+ {
+ // Subdir count
+ BOOST_CHECK_EQUAL(count_dir_contents(dirname, false, true), num_subdirs);
+
+ // Journal file count
+ unsigned num_jrnl_files = jrnl_present ? NUM_JFILES + 1 : 0;
+ BOOST_CHECK_EQUAL(count_dir_contents(dirname, true, false), num_jrnl_files);
+
+ // Check journal files are present
+ if (jrnl_present)
+ try { jdir::verify_dir(dirname, base_filename); }
+ catch(const jexception& e) { BOOST_ERROR(e); }
+ for (unsigned subdir_num = 1; subdir_num <= num_subdirs; subdir_num++)
+ {
+ stringstream subdir_name;
+ subdir_name << dirname << "/_" << base_filename << ".bak.";
+ subdir_name << hex << setfill('0') << setw(4) << subdir_num;
+ try { jdir::verify_dir(subdir_name.str().c_str(), base_filename); }
+ catch(const jexception& e) { BOOST_ERROR(e); }
+ }
+ }
+ else
+ BOOST_ERROR(dirname << " is not a directory");
+}
+
+void check_dir_not_existing(const char* dirname)
+{
+ if (jdir::exists(dirname) && jdir::is_dir(dirname))
+ jdir::delete_dir(dirname);
+ if (jdir::exists(dirname))
+ BOOST_FAIL("Unable to remove directory " << dirname);
+}
+
+void check_dir_not_existing(const string dirname)
+{
+ check_dir_not_existing(dirname.c_str());
+}
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ string dir(test_dir + "/A/B/C/D/E/F");
+ string bfn("test_base");
+ jdir dir1(dir, bfn);
+ BOOST_CHECK(dir1.dirname().compare(dir) == 0);
+ BOOST_CHECK(dir1.base_filename().compare(bfn) == 0);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(create_delete_dir)
+{
+ cout << test_filename << ".create_delete_dir: " << flush;
+ // Use instance
+ string dir_A(test_dir + "/A");
+ string dir_Ats(test_dir + "/A/"); // trailing '/'
+ check_dir_not_existing(test_dir + "/A");
+ jdir dir1(dir_A, "test_base");
+ dir1.create_dir();
+ // check all combos of jdir::exists and jdir::is_dir()
+ BOOST_CHECK(jdir::exists(dir_A));
+ BOOST_CHECK(jdir::exists(dir_Ats));
+ BOOST_CHECK(jdir::exists(dir_A.c_str()));
+ BOOST_CHECK(jdir::exists(dir_Ats.c_str()));
+ BOOST_CHECK(jdir::is_dir(dir_A));
+ BOOST_CHECK(jdir::is_dir(dir_Ats));
+ BOOST_CHECK(jdir::is_dir(dir_Ats.c_str()));
+ BOOST_CHECK(jdir::is_dir(dir_Ats.c_str()));
+ // do it a second time when dir exists
+ dir1.create_dir();
+ BOOST_CHECK(jdir::is_dir(dir_A));
+ dir1.delete_dir();
+ BOOST_CHECK(!jdir::exists(dir_A));
+
+ // Use static fn
+ check_dir_not_existing(test_dir + "/B");
+ jdir::create_dir(test_dir + "/B");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/B"));
+ jdir::create_dir(test_dir + "/B");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/B"));
+ jdir::delete_dir(test_dir + "/B");
+ BOOST_CHECK(!jdir::exists(test_dir + "/B"));
+
+ // Non-empty dirs
+ check_dir_not_existing(test_dir + "/C");
+ jdir::create_dir(test_dir + "/C");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/C"));
+ create_file(test_dir + "/C/test_file_1.txt"); // mode 644 (default)
+ create_file(test_dir + "/C/test_file_2.txt", S_IRWXU | S_IRWXG | S_IRWXO); // mode 777
+ create_file(test_dir + "/C/test_file_3.txt", S_IRUSR | S_IRGRP | S_IROTH); // mode 444 (read-only)
+ create_file(test_dir + "/C/test_file_4.txt", 0); // mode 000 (no permissions)
+ BOOST_CHECK(jdir::is_dir(test_dir + "/C"));
+ jdir::create_dir(test_dir + "/C");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/C"));
+ jdir::delete_dir(test_dir + "/C");
+ BOOST_CHECK(!jdir::exists(test_dir + "/C"));
+
+ // Check non-existent dirs fail
+ check_dir_not_existing(test_dir + "/D");
+ try
+ {
+ jdir::is_dir(test_dir + "/D");
+ BOOST_ERROR("jdir::is_dir() failed to throw jexeption for non-existent directory.");
+ }
+ catch(const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_JDIR_STAT);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(create_delete_dir_recursive)
+{
+ cout << test_filename << ".create_delete_dir_recursive: " << flush;
+ // Use instances
+ check_dir_not_existing(test_dir + "/E");
+ jdir dir1(test_dir + "/E/F/G/H", "test_base");
+ dir1.create_dir();
+ BOOST_CHECK(jdir::is_dir(test_dir + "/E/F/G/H"));
+ dir1.delete_dir();
+ BOOST_CHECK(!jdir::exists(test_dir + "/E/F/G/H")); // only H deleted, E/F/G remain
+ BOOST_CHECK(jdir::exists(test_dir + "/E/F/G"));
+ jdir::delete_dir(test_dir + "/E"); // delete remaining dirs
+ BOOST_CHECK(!jdir::exists(test_dir + "/E"));
+
+ check_dir_not_existing(test_dir + "/F");
+ jdir dir2(test_dir + "/F/G/H/I/", "test_base"); // trailing '/'
+ dir2.create_dir();
+ BOOST_CHECK(jdir::is_dir(test_dir + "/F/G/H/I/"));
+ dir2.delete_dir();
+ BOOST_CHECK(!jdir::exists(test_dir + "/F/G/H/I/"));
+ BOOST_CHECK(jdir::exists(test_dir + "/F/G/H/"));
+ jdir::delete_dir(test_dir + "/F");
+ BOOST_CHECK(!jdir::exists(test_dir + "/F"));
+
+ check_dir_not_existing(test_dir + "/G");
+ jdir dir3(test_dir + "/G/H//I//J", "test_base"); // extra '/' in path
+ dir3.create_dir();
+ BOOST_CHECK(jdir::is_dir(test_dir + "/G/H//I//J"));
+ dir3.delete_dir();
+ BOOST_CHECK(!jdir::exists(test_dir + "/G/H//I//J"));
+ BOOST_CHECK(jdir::exists(test_dir + "/G/H//I"));
+ jdir::delete_dir(test_dir + "/F");
+ BOOST_CHECK(!jdir::exists(test_dir + "/F"));
+
+ // Use static fn
+ check_dir_not_existing(test_dir + "/H");
+ jdir::create_dir(test_dir + "/H/I/J/K");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/H/I/J/K"));
+ jdir::delete_dir(test_dir + "/H/I/J/K");
+ BOOST_CHECK(!jdir::exists(test_dir + "/H/I/J/K")); // only J deleted, H/I/J remain
+ BOOST_CHECK(jdir::exists(test_dir + "/H/I/J"));
+ jdir::delete_dir(test_dir + "/H");
+ BOOST_CHECK(!jdir::exists(test_dir + "/H"));
+
+ check_dir_not_existing(test_dir + "/I");
+ jdir::create_dir(test_dir + "/I/J/K/L/"); // trailing '/'
+ BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K/L/"));
+ jdir::delete_dir(test_dir + "/I/J/K/L/");
+ BOOST_CHECK(!jdir::exists(test_dir + "/I/J/K/L/"));
+ BOOST_CHECK(jdir::exists(test_dir + "/I/J/K/"));
+ jdir::delete_dir(test_dir + "/I");
+ BOOST_CHECK(!jdir::exists(test_dir + "/I"));
+
+ check_dir_not_existing(test_dir + "//J");
+ jdir::create_dir(test_dir + "//J//K//L//M"); // extra '/' in path
+ BOOST_CHECK(jdir::is_dir(test_dir + "//J//K//L//M"));
+ jdir::delete_dir(test_dir + "//J//K//L//M");
+ BOOST_CHECK(!jdir::exists(test_dir + "//J//K//L//M"));
+ BOOST_CHECK(jdir::exists(test_dir + "//J//K//L"));
+ jdir::delete_dir(test_dir + "//J");
+ BOOST_CHECK(!jdir::exists(test_dir + "//J"));
+
+ // Non-empty dirs
+ check_dir_not_existing(test_dir + "/K");
+ jdir::create_dir(test_dir + "/K/L/M1/N1");
+ jdir::create_dir(test_dir + "/K/L/M1/N2");
+ jdir::create_dir(test_dir + "/K/L/M1/N3");
+ jdir::create_dir(test_dir + "/K/L/M1/N4");
+ create_file(test_dir + "/K/L/M1/N4/test_file_1.txt"); // mode 644 (default)
+ create_file(test_dir + "/K/L/M1/N4/test_file_2.txt", S_IRWXU | S_IRWXG | S_IRWXO); // mode 777
+ create_file(test_dir + "/K/L/M1/N4/test_file_3.txt", S_IRUSR | S_IRGRP | S_IROTH); // mode 444
+ create_file(test_dir + "/K/L/M1/N4/test_file_4.txt", 0); // mode 000 (no permissions)
+ jdir::create_dir(test_dir + "/K/L/M2");
+ jdir::create_dir(test_dir + "/K/L/M3/N5");
+ jdir::create_dir(test_dir + "/K/L/M3/N6");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N1"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N2"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N3"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N4"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M2"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M3/N5"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M3/N6"));
+ jdir::delete_dir(test_dir + "/K");
+ BOOST_CHECK(!jdir::exists(test_dir + "/K"));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(clear_verify_dir)
+{
+ cout << test_filename << ".clear_verify_dir: " << flush;
+ // Use instances
+ const char* jrnl_dir = "/var/tmp/test_dir_1";
+ const char* bfn = "test_base";
+ check_dir_not_existing(jrnl_dir);
+ jdir test_dir_1(jrnl_dir, bfn);
+ test_dir_1.create_dir();
+ BOOST_CHECK(jdir::is_dir(jrnl_dir));
+ // add journal files, check they exist, then clear them
+ unsigned cnt = 0;
+ while (cnt < NUM_CLEAR_OPS)
+ {
+ create_jrnl_fileset(jrnl_dir, bfn);
+ check_dir_contents(jrnl_dir, bfn, cnt, true);
+ test_dir_1.clear_dir();
+ check_dir_contents(jrnl_dir, bfn, ++cnt, false);
+ }
+ // clean up
+ test_dir_1.delete_dir();
+ BOOST_CHECK(!jdir::exists(jrnl_dir));
+
+ // Non-existent dir with auto-create true
+ jrnl_dir = "/var/tmp/test_dir_2";
+ check_dir_not_existing(jrnl_dir);
+ jdir test_dir_2(jrnl_dir, bfn);
+ // clear dir
+ test_dir_2.clear_dir(); // create flag is true by default
+ check_dir_contents(jrnl_dir, bfn, 0, false);
+ // clear empty dir, should not create subdir
+ test_dir_2.clear_dir(); // create flag is true by default
+ check_dir_contents(jrnl_dir, bfn, 0, false);
+ // clean up
+ test_dir_2.delete_dir();
+ BOOST_CHECK(!jdir::exists(jrnl_dir));
+
+ // non-existent dir with auto-create false
+ jrnl_dir = "/var/tmp/test_dir_3";
+ check_dir_not_existing(jrnl_dir);
+ jdir test_dir_3(jrnl_dir, bfn);
+ try
+ {
+ test_dir_3.clear_dir(false);
+ BOOST_ERROR("jdir::clear_dir(flase) failed to throw jexeption for non-existent directory.");
+ }
+ catch(const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_JDIR_OPENDIR);
+ }
+
+ // Use static fn
+ jrnl_dir = "/var/tmp/test_dir_4";
+ check_dir_not_existing(jrnl_dir);
+ jdir::clear_dir(jrnl_dir, bfn); // should create dir if it does not exist
+ // add journal files, check they exist, then clear them
+ cnt = 0;
+ while (cnt < NUM_CLEAR_OPS)
+ {
+ create_jrnl_fileset(jrnl_dir, bfn);
+ check_dir_contents(jrnl_dir, bfn, cnt, true);
+ jdir::clear_dir(jrnl_dir, bfn);
+ check_dir_contents(jrnl_dir, bfn, ++cnt, false);
+ }
+ // clean up
+ jdir::delete_dir(jrnl_dir);
+ BOOST_CHECK(!jdir::exists(jrnl_dir));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jerrno.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jerrno.cpp
new file mode 100644
index 0000000000..1ae1138355
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jerrno.cpp
@@ -0,0 +1,47 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <cstring>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jerrno.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jerrno_suite)
+using namespace mrg::journal;
+
+const string test_filename("_ut_jerrno");
+
+QPID_AUTO_TEST_CASE(jerrno_val)
+{
+ cout << test_filename << ".jerrno_val: " << flush;
+ const char* m = "JERR__MALLOC";
+ string malloc_msg = string(jerrno::err_msg(jerrno::JERR__MALLOC));
+ BOOST_CHECK(malloc_msg.substr(0, std::strlen(m)).compare(m) == 0);
+ BOOST_CHECK(std::strcmp(jerrno::err_msg(0), "<Unknown error code>") == 0);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jexception.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jexception.cpp
new file mode 100644
index 0000000000..8b9e876aa6
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jexception.cpp
@@ -0,0 +1,346 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <cstring>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/legacystore/jrnl/jexception.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jexception_suite)
+
+const string test_filename("_ut_jexception");
+
+// === Helper functions ===
+
+void throw_exception(const jexception& e, std::size_t what_len, std::size_t ai_len,
+ std::size_t tc_len, std::size_t tf_len)
+{
+ try { throw e; }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(std::strlen(e.what()), what_len);
+ BOOST_CHECK_EQUAL(e.additional_info().size(), ai_len);
+ BOOST_CHECK_EQUAL(e.throwing_class().size(), tc_len);
+ BOOST_CHECK_EQUAL(e.throwing_fn().size(), tf_len);
+ }
+}
+
+void throw_exception(const jexception& e, std::size_t what_len, std::size_t ai_len)
+{
+ throw_exception(e, what_len, ai_len, 0, 0);
+}
+
+void throw_exception(const jexception& e, std::size_t what_len, std::size_t tc_len,
+ std::size_t tf_len)
+{
+ throw_exception(e, what_len, 0, tc_len, tf_len);
+}
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(constructor_1)
+{
+ cout << test_filename << ".constructor_1: " << flush;
+ try
+ {
+ jexception e1;
+ BOOST_CHECK_EQUAL(e1.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e1.additional_info().size() == 0);
+ BOOST_CHECK(e1.throwing_class().size() == 0);
+ BOOST_CHECK(e1.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e1.what()) > 0);
+ throw e1;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e.additional_info().size() == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_2)
+{
+ cout << test_filename << ".constructor_2: " << flush;
+ const u_int32_t err_code = 2;
+ try
+ {
+ jexception e2(err_code);
+ BOOST_CHECK_EQUAL(e2.err_code(), err_code);
+ BOOST_CHECK(e2.additional_info().size() == 0);
+ BOOST_CHECK(e2.throwing_class().size() == 0);
+ BOOST_CHECK(e2.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e2.what()) > 0);
+ throw e2;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().size() == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_3a)
+{
+ cout << test_filename << ".constructor_3a: " << flush;
+ const char* err_msg = "exception3";
+ try
+ {
+ jexception e3(err_msg);
+ BOOST_CHECK_EQUAL(e3.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e3.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e3.throwing_class().size() == 0);
+ BOOST_CHECK(e3.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e3.what()) > 0);
+ throw e3;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_3b)
+{
+ cout << test_filename << ".constructor_3b: " << flush;
+ const string err_msg("exception3");
+ try
+ {
+ jexception e3(err_msg);
+ BOOST_CHECK_EQUAL(e3.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e3.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e3.throwing_class().size() == 0);
+ BOOST_CHECK(e3.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e3.what()) > 0);
+ throw e3;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), (u_int32_t)0);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_4a)
+{
+ cout << test_filename << ".constructor_4a: " << flush;
+ const u_int32_t err_code = 4;
+ const char* err_msg = "exception4";
+ try
+ {
+ jexception e4(err_code, err_msg);
+ BOOST_CHECK_EQUAL(e4.err_code(), err_code);
+ BOOST_CHECK(e4.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e4.throwing_class().size() == 0);
+ BOOST_CHECK(e4.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e4.what()) > 0);
+ throw e4;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_4b)
+{
+ cout << test_filename << ".constructor_4b: " << flush;
+ const u_int32_t err_code = 4;
+ const string err_msg("exception4");
+ try
+ {
+ jexception e4(err_code, err_msg);
+ BOOST_CHECK_EQUAL(e4.err_code(), err_code);
+ BOOST_CHECK(e4.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e4.throwing_class().size() == 0);
+ BOOST_CHECK(e4.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e4.what()) > 0);
+ throw e4;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().size() == 0);
+ BOOST_CHECK(e.throwing_fn().size() == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_5a)
+{
+ cout << test_filename << ".constructor_5a: " << flush;
+ const u_int32_t err_code = 5;
+ const char* err_class = "class5";
+ const char* err_fn = "fn5";
+ try
+ {
+ jexception e5(err_code, err_class, err_fn);
+ BOOST_CHECK_EQUAL(e5.err_code(), err_code);
+ BOOST_CHECK(e5.additional_info().size() == 0);
+ BOOST_CHECK(e5.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e5.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e5.what()) > 0);
+ throw e5;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().size() == 0);
+ BOOST_CHECK(e.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_5b)
+{
+ cout << test_filename << ".constructor_5b: " << flush;
+ const u_int32_t err_code = 5;
+ const string err_class("class5");
+ const string err_fn("fn5");
+ try
+ {
+ jexception e5(err_code, err_class, err_fn);
+ BOOST_CHECK_EQUAL(e5.err_code(), err_code);
+ BOOST_CHECK(e5.additional_info().size() == 0);
+ BOOST_CHECK(e5.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e5.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e5.what()) > 0);
+ throw e5;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().size() == 0);
+ BOOST_CHECK(e.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_6a)
+{
+ cout << test_filename << ".constructor_6a: " << flush;
+ const u_int32_t err_code = 6;
+ const char* err_msg = "exception6";
+ const char* err_class = "class6";
+ const char* err_fn = "fn6";
+ try
+ {
+ jexception e6(err_code, err_msg, err_class, err_fn);
+ BOOST_CHECK_EQUAL(e6.err_code(), err_code);
+ BOOST_CHECK(e6.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e6.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e6.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e6.what()) > 0);
+ throw e6;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_6b)
+{
+ cout << test_filename << ".constructor_6b: " << flush;
+ const u_int32_t err_code = 6;
+ const string err_msg("exception6");
+ const string err_class("class6");
+ const string err_fn("fn6");
+ try
+ {
+ jexception e6(err_code, err_msg, err_class, err_fn);
+ BOOST_CHECK_EQUAL(e6.err_code(), err_code);
+ BOOST_CHECK(e6.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e6.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e6.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e6.what()) > 0);
+ throw e6;
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), err_code);
+ BOOST_CHECK(e.additional_info().compare(err_msg) == 0);
+ BOOST_CHECK(e.throwing_class().compare(err_class) == 0);
+ BOOST_CHECK(e.throwing_fn().compare(err_fn) == 0);
+ BOOST_CHECK(std::strlen(e.what()) > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(msg_scope)
+{
+ cout << test_filename << ".msg_scope: " << flush;
+ try
+ {
+ // These will go out of scope as soon as jexception is thrown...
+ const string msg("Error message");
+ const string cls("class");
+ const string fn("function");
+ throw jexception(100, msg, cls, fn);
+ }
+ catch (const jexception& e)
+ {
+ stringstream ss;
+ ss << e;
+ BOOST_CHECK(ss.str().size() > 0);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp
new file mode 100644
index 0000000000..c6377c2287
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp
@@ -0,0 +1,402 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jinf_suite)
+
+const string test_filename("_ut_jinf");
+
+#include "_st_helper_fns.h"
+
+timespec ts;
+
+QPID_AUTO_TEST_CASE(write_constructor)
+{
+ string test_name = get_test_name(test_filename, "write_constructor");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ ::clock_gettime(CLOCK_REALTIME, &ts);
+ jinf ji(jid, test_dir, base_filename, NUM_JFILES, false, 0, JFSIZE_SBLKS, JRNL_WMGR_DEF_PAGE_SIZE, JRNL_WMGR_DEF_PAGES, ts);
+ BOOST_CHECK_EQUAL(ji.jver(), RHM_JDAT_VERSION);
+ BOOST_CHECK(ji.jid().compare(jid) == 0);
+ BOOST_CHECK(ji.jdir().compare(test_dir) == 0);
+ BOOST_CHECK(ji.base_filename().compare(base_filename) == 0);
+ const timespec this_ts = ji.ts();
+ BOOST_CHECK_EQUAL(this_ts.tv_sec, ts.tv_sec);
+ BOOST_CHECK_EQUAL(this_ts.tv_nsec, ts.tv_nsec);
+ BOOST_CHECK_EQUAL(ji.num_jfiles(), u_int16_t(NUM_JFILES));
+ BOOST_CHECK_EQUAL(ji.is_ae(), false);
+ BOOST_CHECK_EQUAL(ji.ae_max_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(ji.jfsize_sblks(), u_int32_t(JFSIZE_SBLKS));
+ BOOST_CHECK_EQUAL(ji.sblk_size_dblks(), u_int16_t(JRNL_SBLK_SIZE));
+ BOOST_CHECK_EQUAL(ji.dblk_size(), u_int32_t(JRNL_DBLK_SIZE));
+ BOOST_CHECK_EQUAL(ji.wcache_pgsize_sblks(), u_int32_t(JRNL_WMGR_DEF_PAGE_SIZE));
+ BOOST_CHECK_EQUAL(ji.wcache_num_pages(), u_int16_t(JRNL_WMGR_DEF_PAGES));
+ BOOST_CHECK_EQUAL(ji.rcache_pgsize_sblks(), u_int32_t(JRNL_RMGR_PAGE_SIZE));
+ BOOST_CHECK_EQUAL(ji.rcache_num_pages(), u_int16_t(JRNL_RMGR_PAGES));
+ ji.write();
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(read_constructor)
+{
+ string test_name = get_test_name(test_filename, "read_constructor");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map::create_new_jinf(jid, base_filename, false);
+
+ stringstream fn;
+ fn << test_dir << "/" <<base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ BOOST_CHECK_EQUAL(ji.jver(), RHM_JDAT_VERSION);
+ BOOST_CHECK(ji.jid().compare(jid) == 0);
+ BOOST_CHECK(ji.jdir().compare(test_dir) == 0);
+ BOOST_CHECK(ji.base_filename().compare(base_filename) == 0);
+// const timespec this_ts = ji.ts();
+// BOOST_CHECK_EQUAL(this_ts.tv_sec, ts.tv_sec);
+// BOOST_CHECK_EQUAL(this_ts.tv_nsec, ts.tv_nsec);
+ BOOST_CHECK_EQUAL(ji.num_jfiles(), u_int16_t(NUM_JFILES));
+ BOOST_CHECK_EQUAL(ji.is_ae(), false);
+ BOOST_CHECK_EQUAL(ji.ae_max_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(ji.jfsize_sblks(), u_int32_t(JFSIZE_SBLKS));
+ BOOST_CHECK_EQUAL(ji.sblk_size_dblks(), u_int16_t(JRNL_SBLK_SIZE));
+ BOOST_CHECK_EQUAL(ji.dblk_size(), u_int32_t(JRNL_DBLK_SIZE));
+ BOOST_CHECK_EQUAL(ji.wcache_pgsize_sblks(), u_int32_t(JRNL_WMGR_DEF_PAGE_SIZE));
+ BOOST_CHECK_EQUAL(ji.wcache_num_pages(), u_int16_t(JRNL_WMGR_DEF_PAGES));
+ BOOST_CHECK_EQUAL(ji.rcache_pgsize_sblks(), u_int32_t(JRNL_RMGR_PAGE_SIZE));
+ BOOST_CHECK_EQUAL(ji.rcache_num_pages(), u_int16_t(JRNL_RMGR_PAGES));
+
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(set_functions)
+{
+ string test_name = get_test_name(test_filename, "set_functions");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map::create_new_jinf(jid, base_filename, false);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+
+ ji.set_jdir("abc123");
+ BOOST_CHECK(ji.jdir().compare("abc123") == 0);
+ ji.set_jdir(test_dir);
+ BOOST_CHECK(ji.jdir().compare(test_dir) == 0);
+ ji.incr_num_jfiles();
+ BOOST_CHECK_EQUAL(ji.num_jfiles(), u_int16_t(NUM_JFILES+1));
+ ji.incr_num_jfiles();
+ BOOST_CHECK_EQUAL(ji.num_jfiles(), u_int16_t(NUM_JFILES+2));
+
+ lfid_pfid_map::clean_journal_info_file(test_dir);
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(validate)
+{
+ string test_name = get_test_name(test_filename, "validate");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map::create_new_jinf(jid, base_filename, false);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), true);
+ // TODO: Check validation picks up conflict, but need to be friend to jinf to do it
+
+ lfid_pfid_map::clean_journal_info_file(test_dir);
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_empty_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_empty_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+
+ lfid_pfid_map m(jid, base_filename);
+ m.journal_create(NUM_JFILES, 0, 0);
+ m.write_journal(false, 0);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try { ji.analyze(); }
+ catch (const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_JINF_JDATEMPTY)
+ BOOST_ERROR("Failed to throw expected exception jerrno::JERR_JINF_JDATEMPTY");
+ }
+
+ m.destroy_journal();
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_part_full_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_part_full_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t num_files = 1; num_files < NUM_JFILES; num_files++)
+ {
+ m.journal_create(NUM_JFILES, num_files, 0);
+ m.write_journal(false, 0);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ ji.analyze();
+ m.check_analysis(ji);
+
+ m.destroy_journal();
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_full_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_full_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t file_num = 0; file_num < NUM_JFILES; file_num++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, file_num);
+ m.write_journal(false, 0);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ ji.analyze();
+ m.check_analysis(ji);
+
+ m.destroy_journal();
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_single_appended_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_single_appended_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t oldest_lid = 0; oldest_lid < NUM_JFILES; oldest_lid++)
+ for (u_int16_t after_lid = 0; after_lid < NUM_JFILES; after_lid++)
+ for (u_int16_t num_files = 1; num_files <= 5; num_files++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, oldest_lid);
+ m.journal_insert(after_lid, num_files);
+ m.write_journal(true, 16);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ ji.analyze();
+ m.check_analysis(ji);
+
+ m.destroy_journal();
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_multi_appended_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_multi_appended_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ ::srand48(1);
+
+ for (u_int16_t num_appends = 1; num_appends <= 2*NUM_JFILES; num_appends++)
+ {
+ const u_int16_t oldest_lid = u_int16_t(NUM_JFILES * ::drand48());
+ m.journal_create(NUM_JFILES, NUM_JFILES, oldest_lid);
+ for (u_int16_t a = 0; a < num_appends; a++)
+ {
+ const u_int16_t num_files = u_int16_t(1 + (NUM_JFILES * ::drand48()));
+ const u_int16_t after_lid = u_int16_t(m.size() * ::drand48());
+ m.journal_insert(after_lid, num_files);
+ }
+ m.write_journal(true, 24);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ ji.analyze();
+ m.check_analysis(ji);
+
+ m.destroy_journal();
+ }
+
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_multi_appended_then_failed_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_multi_appended_then_failed_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ ::srand48(1);
+
+ // As this test relies on repeatable but random sequences, use many iterations for coverage
+ for (int c = 1; c <= 100; c++)
+ {
+ for (u_int16_t num_appends = 1; num_appends <= 2*NUM_JFILES; num_appends++)
+ {
+ u_int16_t oldest_lid = u_int16_t(NUM_JFILES * ::drand48());
+ m.journal_create(NUM_JFILES, NUM_JFILES, oldest_lid);
+ for (u_int16_t a = 0; a < num_appends-1; a++)
+ {
+ const u_int16_t num_files = u_int16_t(1 + (NUM_JFILES * ::drand48()));
+ const u_int16_t after_lid = u_int16_t(m.size() * ::drand48());
+ m.journal_insert(after_lid, num_files);
+ if (after_lid < oldest_lid)
+ oldest_lid += num_files;
+ }
+ const u_int16_t num_files = u_int16_t(1 + (NUM_JFILES * ::drand48()));
+ const u_int16_t after_lid = oldest_lid == 0 ? m.size() - 1 : oldest_lid - 1;
+ m.journal_insert(after_lid, num_files, false);
+ m.write_journal(true, 32);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ ji.analyze();
+ m.check_analysis(ji);
+
+ m.destroy_journal();
+ }
+ }
+
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_inconsistent_jdat_file_size_in_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_inconsistent_jdat_file_size_in_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ ::srand48(1);
+
+ for (u_int16_t pfid = 1; pfid < NUM_JFILES; pfid++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, 0);
+ m.write_journal(false, 0);
+
+ const std::string filename = m.create_journal_filename(pfid, base_filename);
+ std::ofstream of(filename.c_str(), ofstream::out | ofstream::app);
+ if (!of.good())
+ BOOST_FAIL("Unable to open test journal file \"" << filename << "\" for writing.");
+ std::size_t expand_size = std::size_t(10 * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE * ::drand48());
+ std::vector<char> sblk_buffer(expand_size, 0);
+ of.write(&sblk_buffer[0], expand_size);
+ of.close();
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular journal file size in file \"" << filename << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_owi_in_non_ae_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_owi_in_non_ae_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t oldest_file = 1; oldest_file < NUM_DEFAULT_JFILES-1; oldest_file++)
+ {
+ for (u_int16_t bad_owi_file = oldest_file + 1; bad_owi_file < NUM_DEFAULT_JFILES; bad_owi_file++)
+ {
+ m.journal_create(NUM_DEFAULT_JFILES, NUM_DEFAULT_JFILES, oldest_file, bad_owi_file);
+ m.write_journal(false, 0);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular OWI flag in non-ae journal file \"" << fn << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_owi_in_ae_min_size_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_owi_in_ae_min_size_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t oldest_file = 1; oldest_file < NUM_JFILES-1; oldest_file++)
+ {
+ for (u_int16_t bad_owi_file = oldest_file + 1; bad_owi_file < NUM_JFILES; bad_owi_file++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, oldest_file, bad_owi_file);
+ m.write_journal(true, 16);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular OWI flag in min-sized ae journal file \"" << fn << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_lpmgr.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_lpmgr.cpp
new file mode 100644
index 0000000000..2dc20ffa7c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_lpmgr.cpp
@@ -0,0 +1,886 @@
+/*
+ *
+ * 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 "../unit_test.h"
+#include <cmath>
+#include <iostream>
+#include "qpid/legacystore/jrnl/jcntl.h"
+#include "qpid/legacystore/jrnl/lpmgr.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(arr_cnt_suite)
+
+const string test_filename("_ut_lpmgr");
+
+#include "_st_helper_fns.h"
+
+// === Helper functions and definitions ===
+
+typedef vector<u_int16_t> flist;
+typedef flist::const_iterator flist_citr;
+
+class lpmgr_test_helper
+{
+ lpmgr_test_helper() {}
+ virtual ~lpmgr_test_helper() {}
+
+public:
+ static void check_pfids_lfids(const lpmgr& lm, const u_int16_t pfids[], const u_int16_t lfids[],
+ const size_t pfid_lfid_size)
+ {
+ vector<u_int16_t> res;
+ lm.get_pfid_list(res);
+ vectors_equal(lm, pfids, pfid_lfid_size, res, true);
+ lm.get_lfid_list(res);
+ vectors_equal(lm, lfids, pfid_lfid_size, res, false);
+ }
+
+ static void check_pfids_lfids(const lpmgr& lm, const flist& pfids, const flist lfids)
+ {
+ vector<u_int16_t> res;
+ lm.get_pfid_list(res);
+ vectors_equal(lm, pfids, res, true);
+ lm.get_lfid_list(res);
+ vectors_equal(lm, lfids, res, false);
+ }
+
+ static void check_linear_pfids_lfids(const lpmgr& lm, const size_t pfid_lfid_size)
+ {
+ vector<u_int16_t> res;
+ lm.get_pfid_list(res);
+ linear_vectors_equal(lm, pfid_lfid_size, res, true);
+ lm.get_lfid_list(res);
+ linear_vectors_equal(lm, pfid_lfid_size, res, false);
+ }
+
+ static void rcvdat_init(rcvdat& rd, const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
+ const u_int16_t pfids[])
+ {
+ rd.reset(num_jfiles, ae, ae_max_jfiles);
+ load_vector(pfids, num_jfiles, rd._fid_list);
+ rd._jempty = false;
+ rd._lfid = pfids[num_jfiles - 1];
+ rd._eo = 100 * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE;
+ }
+
+ static void rcvdat_init(rcvdat& rd, const flist& pfidl, const bool ae, const u_int16_t ae_max_jfiles)
+ {
+ const u_int16_t num_jfiles = pfidl.size();
+ rd.reset(num_jfiles, ae, ae_max_jfiles);
+ load_vector(pfidl, rd._fid_list);
+ rd._jempty = false;
+ rd._lfid = pfidl[num_jfiles - 1];
+ rd._eo = 100 * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE;
+ }
+
+ static void initialize(lpmgr& lm, test_jrnl& jc, const u_int16_t num_jfiles, const bool ae,
+ const u_int16_t ae_max_jfiles)
+ {
+ lm.initialize(num_jfiles, ae, ae_max_jfiles, &jc, &jc.new_fcntl);
+ BOOST_CHECK_EQUAL(lm.is_init(), true);
+ BOOST_CHECK_EQUAL(lm.is_ae(), ae);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), ae_max_jfiles);
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles);
+ if (num_jfiles)
+ check_linear_pfids_lfids(lm, num_jfiles);
+ else
+ BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+ }
+
+ // version which sets up the lfid_pfid_map for later manipulation by insert tests
+ static void initialize(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const u_int16_t num_jfiles, const bool ae,
+ const u_int16_t ae_max_jfiles)
+ {
+ lfm.journal_create(num_jfiles, num_jfiles);
+ initialize(lm, jc, num_jfiles, ae, ae_max_jfiles);
+ }
+
+ static void prepare_recover(lfid_pfid_map& lfm, const u_int16_t size)
+ {
+ if (size < 4) BOOST_FAIL("prepare_recover(): size parameter (" << size << ") too small.");
+ lfm.journal_create(4, 4); // initial journal of size 4
+ u_int16_t s = 4; // cumulative size
+ while (s < size)
+ {
+ const u_int16_t ins_posn = u_int16_t(s * ::drand48()); // this insert posn
+ if (3.0 * ::drand48() > 1.0 || size - s < 2) // 2:1 chance of single insert when >= 2 still to insert
+ {
+ lfm.journal_insert(ins_posn); // single insert
+ s++;
+ }
+ else
+ {
+ // multiple insert, either 2 - 5
+ const u_int16_t max_ins_size = size - s >5 ? 5 : size - s;
+ const u_int16_t ins_size = 2 + u_int16_t((max_ins_size - 2) * ::drand48()); // this insert size
+ lfm.journal_insert(ins_posn, ins_size);
+ s += ins_size;
+ }
+ }
+ }
+
+ static void recover(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const bool ae, const u_int16_t ae_max_jfiles)
+ {
+ flist pfidl;
+ flist lfidl;
+ rcvdat rd;
+ const u_int16_t num_jfiles = lfm.size();
+
+ lfm.get_pfid_list(pfidl);
+ lfm.get_lfid_list(lfidl);
+ lm.finalize(); // clear all file handles before erasing old journal files
+ lfm.write_journal(ae, ae_max_jfiles, JFSIZE_SBLKS);
+
+ lpmgr_test_helper::rcvdat_init(rd, pfidl, ae, ae_max_jfiles);
+ lm.recover(rd, &jc, &jc.new_fcntl);
+ BOOST_CHECK_EQUAL(lm.is_init(), true);
+ BOOST_CHECK_EQUAL(lm.is_ae(), ae);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), ae_max_jfiles);
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles);
+ if (num_jfiles)
+ check_pfids_lfids(lm, pfidl, lfidl);
+ else
+ BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+ }
+
+ static void finalize(lpmgr& lm)
+ {
+ lm.finalize();
+ BOOST_CHECK_EQUAL(lm.is_init(), false);
+ BOOST_CHECK_EQUAL(lm.is_ae(), false);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+ vector<u_int16_t> res;
+ lm.get_pfid_list(res);
+ BOOST_CHECK_EQUAL(res.size(), u_int16_t(0));
+ lm.get_lfid_list(res);
+ BOOST_CHECK_EQUAL(res.size(), u_int16_t(0));
+ }
+
+ static void insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const u_int16_t after_lfid, const u_int16_t incr = 1)
+ {
+ flist pfidl;
+ flist lfidl;
+ const u_int16_t num_jfiles = lm.num_jfiles();
+ lfm.journal_insert(after_lfid, incr);
+ lfm.get_pfid_list(pfidl);
+ lfm.get_lfid_list(lfidl);
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, incr);
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles + incr);
+ lpmgr_test_helper::check_pfids_lfids(lm, pfidl, lfidl);
+ }
+
+ static void check_ae_max_jfiles(lpmgr& lm, const u_int16_t num_jfiles, const u_int16_t ae_max_jfiles)
+ {
+ bool legal = ae_max_jfiles > num_jfiles || ae_max_jfiles == 0;
+
+ lm.set_ae(false);
+ BOOST_CHECK(!lm.is_ae());
+ if (legal)
+ {
+ lm.set_ae_max_jfiles(ae_max_jfiles);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), ae_max_jfiles);
+ lm.set_ae(true);
+ BOOST_CHECK(lm.is_ae());
+ BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), ae_max_jfiles
+ ? ae_max_jfiles - num_jfiles
+ : JRNL_MAX_NUM_FILES - num_jfiles);
+ }
+ else
+ {
+ lm.set_ae_max_jfiles(ae_max_jfiles);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), ae_max_jfiles);
+ try
+ {
+ lm.set_ae(true); // should raise exception
+ BOOST_ERROR("Auto-expand enabled with out-of-range ae_max_jfiles");
+ }
+ catch (const jexception& e) { BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_LFMGR_BADAEFNUMLIM); }
+ BOOST_CHECK(!lm.is_ae());
+ BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), 0);
+ }
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), ae_max_jfiles);
+ }
+
+ static void check_multiple_initialization_recover(lfid_pfid_map& lfm, test_jrnl& jc,
+ const u_int16_t num_jfiles_arr[][2], const bool init_flag_0, const bool finalize_flag,
+ const bool init_flag_1)
+ {
+ unsigned i_njf = 0;
+ while (num_jfiles_arr[i_njf][0] && num_jfiles_arr[i_njf][1]) // cycle through each entry in num_jfiles_arr
+ {
+ for (unsigned i1_njf = 0; i1_njf <= 1; i1_njf++) // cycle through the two numbers in each entry of num_jfiles_arr
+ {
+ const u_int16_t num_jfiles_0 = num_jfiles_arr[i_njf][i1_njf == 0]; // first number in pair
+ const u_int16_t num_jfiles_1 = num_jfiles_arr[i_njf][i1_njf != 0]; // second number in pair
+
+ for (unsigned i_ae = 0; i_ae < 4; i_ae++) // cycle through combinations of enabling AE
+ {
+ const bool ae_0 = i_ae & 0x1; // first bit: enable AE on first init
+ const bool ae_1 = i_ae & 0x2; // second bit: enable AE on second init
+ for (unsigned i_aemjf = 0; i_aemjf < 4; i_aemjf++) // cycle through combinations of enabling/disabling ae limit
+ {
+ const u_int16_t ae_max_jfiles_0 = i_aemjf & 0x1 ? 3 * num_jfiles_0 : 0; // max ae files, 0 = disable max
+ const u_int16_t ae_max_jfiles_1 = i_aemjf & 0x2 ? 4 * num_jfiles_1 : 0; // max ae files, 0 = disable max
+
+ lpmgr lm; // DUT
+
+ if (init_flag_0)
+ initialize(lm, jc, num_jfiles_0, ae_0, ae_max_jfiles_0);
+ else
+ {
+ prepare_recover(lfm, num_jfiles_0);
+ recover(lfm, lm, jc, ae_1, ae_max_jfiles_0);
+ lfm.destroy_journal();
+ }
+
+ if (finalize_flag) finalize(lm);
+
+ if (init_flag_1)
+ initialize(lm, jc, num_jfiles_1, ae_1, ae_max_jfiles_1);
+ else
+ {
+ prepare_recover(lfm, num_jfiles_1);
+ recover(lfm, lm, jc, ae_1, ae_max_jfiles_1);
+ lfm.destroy_journal();
+ }
+ }
+ }
+ }
+ i_njf++;
+ }
+ }
+
+ static void check_insert(lfid_pfid_map& lfm, lpmgr& lm, test_jrnl& jc, const u_int16_t after_lfid,
+ const u_int16_t incr = 1)
+ {
+ const u_int16_t num_jfiles = lm.num_jfiles();
+ const u_int16_t ae_max_jfiles = lm.ae_max_jfiles();
+ const u_int16_t effective_ae_max_jfiles = ae_max_jfiles ? ae_max_jfiles : JRNL_MAX_NUM_FILES;
+ BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), effective_ae_max_jfiles - num_jfiles);
+ bool legal = lm.is_ae() && num_jfiles + incr <= effective_ae_max_jfiles;
+ if (legal)
+ {
+ insert(lfm, lm, jc, after_lfid, incr);
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles + incr);
+ BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), effective_ae_max_jfiles - num_jfiles - incr);
+ }
+ else
+ {
+ try
+ {
+ insert(lfm, lm, jc, after_lfid, incr);
+ if (lm.is_ae())
+ BOOST_ERROR("lpmgr::insert() succeeded and exceeded limit");
+ else
+ BOOST_ERROR("lpmgr::insert() succeeded with auto-expand disabled");
+ }
+ catch (const jexception& e)
+ {
+ if (lm.is_ae())
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_LFMGR_AEFNUMLIMIT);
+ else
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_LFMGR_AEDISABLED);
+ }
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), num_jfiles);
+ BOOST_CHECK_EQUAL(lm.ae_jfiles_rem(), effective_ae_max_jfiles - num_jfiles);
+ }
+ }
+
+ static void check_limit(lfid_pfid_map& lfm, test_jrnl& jc, const bool ae, const u_int16_t num_jfiles,
+ const u_int16_t ae_max_jfiles)
+ {
+ lpmgr lm;
+
+ for (unsigned i = 0; i < 2; i++)
+ {
+ if (i)
+ initialize(lfm, lm, jc, num_jfiles, ae, ae_max_jfiles);
+ else
+ {
+ prepare_recover(lfm, num_jfiles);
+ recover(lfm, lm, jc, ae, ae_max_jfiles);
+ }
+
+ // use up all available files
+ unsigned j = ae_max_jfiles ? ae_max_jfiles : JRNL_MAX_NUM_FILES;
+ while (ae && j > num_jfiles)
+ {
+ const u_int16_t posn = static_cast<u_int16_t>((lm.num_jfiles() - 1) * ::drand48());
+ const u_int16_t incr = 1 + static_cast<u_int16_t>((lm.ae_jfiles_rem() > 4
+ ? 3 : lm.ae_jfiles_rem() - 1) * ::drand48());
+ check_insert(lfm, lm, jc, posn, incr);
+ j -= incr;
+ }
+ // these should be over the limit or illegal
+ check_insert(lfm, lm, jc, 0);
+ check_insert(lfm, lm, jc, 2, 2);
+ lfm.destroy_journal();
+ }
+ }
+
+private:
+ static void load_vector(const u_int16_t a[], const size_t n, flist& v)
+ {
+ for (size_t i = 0; i < n; i++)
+ v.push_back(a[i]);
+ }
+
+ static void load_vector(const flist& a, flist& b)
+ {
+ for (flist_citr i = a.begin(); i < a.end(); i++)
+ b.push_back(*i);
+ }
+
+ static void vectors_equal(const lpmgr& lm, const u_int16_t a[], const size_t n, const flist& b,
+ const bool pfid_check)
+ {
+ BOOST_CHECK_EQUAL(n, b.size());
+ for (size_t i = 0; i < n; i++)
+ {
+ BOOST_CHECK_EQUAL(a[i], b[i]);
+ fcntl* fp = lm.get_fcntlp(i);
+ BOOST_CHECK_MESSAGE(fp != (void*)0, "Unexpected void pointer returned by lpmgr::get_fcntlp()");
+ if (fp) BOOST_CHECK_EQUAL(pfid_check ? fp->pfid() : fp->lfid(), pfid_check ? a[i] : i);
+ }
+ }
+
+ static void vectors_equal(const lpmgr& lm, const flist& a, const flist& b, const bool pfid_check)
+ {
+ BOOST_CHECK_EQUAL(a.size(), b.size());
+ for (size_t i = 0; i < a.size(); i++)
+ {
+ BOOST_CHECK_EQUAL(a[i], b[i]);
+ fcntl* fp = lm.get_fcntlp(i);
+ BOOST_CHECK_MESSAGE(fp != (void*)0, "Unexpected void pointer returned by lpmgr::get_fcntlp()");
+ if (fp) BOOST_CHECK_EQUAL(pfid_check ? fp->pfid() : fp->lfid(), pfid_check ? a[i] : i);
+ }
+ }
+
+ static void linear_vectors_equal(const lpmgr& lm, const size_t n, const flist& f, const bool pfid_check)
+ {
+ BOOST_CHECK_EQUAL(n, f.size());
+ for (size_t i = 0; i < n; i++)
+ {
+ BOOST_CHECK_EQUAL(i, f[i]);
+ fcntl* fp = lm.get_fcntlp(i);
+ BOOST_CHECK_MESSAGE(fp != (void*)0, "Unexpected void pointer returned by lpmgr::get_fcntlp()");
+ if (fp) BOOST_CHECK_EQUAL(pfid_check ? fp->pfid() : fp->lfid(), i);
+ }
+ }
+};
+
+// === Tests ===
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+/*
+ * Check that after construction, the fcntl array _fcntl_arr is empty and the is_init() function returns false.
+ */
+QPID_AUTO_TEST_CASE(default_constructor)
+{
+ string test_name = get_test_name(test_filename, "default_constructor");
+ try
+ {
+ lpmgr lm;
+ BOOST_CHECK_EQUAL(lm.is_init(), false);
+ BOOST_CHECK_EQUAL(lm.is_ae(), false);
+ BOOST_CHECK_EQUAL(lm.ae_max_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that initialize() correctly creates an ordered fcntl array _fcntl_arr.
+ */
+QPID_AUTO_TEST_CASE(initialize)
+{
+ string test_name = get_test_name(test_filename, "initialize");
+ const u_int16_t num_jfiles = 8;
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, true, 0);
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, true, 5 * num_jfiles);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that recover() correctly sets up the specified pfid list order.
+ */
+QPID_AUTO_TEST_CASE(recover)
+{
+ string test_name = get_test_name(test_filename, "recover");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, 8);
+ lpmgr_test_helper::recover(lfm, lm, jc, false, 0);
+ lfm.destroy_journal();
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, 8);
+ lpmgr_test_helper::recover(lfm, lm, jc, true, 0);
+ lfm.destroy_journal();
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, 8);
+ lpmgr_test_helper::recover(lfm, lm, jc, true, 5 * lfm.size());
+ lfm.destroy_journal();
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that finalize() after an initialize() empties _fcntl_arr and that afterwards is_init() returns false.
+ */
+QPID_AUTO_TEST_CASE(initialize_finalize)
+{
+ string test_name = get_test_name(test_filename, "initialize_finalize");
+ const u_int16_t num_jfiles = 8;
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
+ lpmgr_test_helper::finalize(lm);
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, true, 0);
+ lpmgr_test_helper::finalize(lm);
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lm, jc, num_jfiles, true, 5 * num_jfiles);
+ lpmgr_test_helper::finalize(lm);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that finalize() after a recover() empties _fcntl_arr and that afterwards is_init() returns false.
+ */
+QPID_AUTO_TEST_CASE(recover_finalize)
+{
+ string test_name = get_test_name(test_filename, "recover_finalize");
+ const u_int16_t num_jfiles = 8;
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, num_jfiles);
+ lpmgr_test_helper::recover(lfm, lm, jc, false, 0);
+ lpmgr_test_helper::finalize(lm);
+ lfm.destroy_journal();
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, num_jfiles);
+ lpmgr_test_helper::recover(lfm, lm, jc, true, 0);
+ lpmgr_test_helper::finalize(lm);
+ lfm.destroy_journal();
+ }
+ {
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, num_jfiles);
+ lpmgr_test_helper::recover(lfm, lm, jc, true, 5 * lfm.size());
+ lpmgr_test_helper::finalize(lm);
+ lfm.destroy_journal();
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that 0 and/or null and other extreme/boundary parameters behave as expected.
+ */
+QPID_AUTO_TEST_CASE(zero_null_params)
+{
+ string test_name = get_test_name(test_filename, "zero_null_params");
+ const u_int16_t num_jfiles = 8;
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lfm, lm, jc, num_jfiles, true, 0);
+
+ // Check that inserting 0 files works ok
+ lpmgr_test_helper::insert(lfm, lm, jc, 0, 0);
+ lpmgr_test_helper::insert(lfm, lm, jc, 2, 0);
+ lpmgr_test_helper::insert(lfm, lm, jc, num_jfiles - 1, 0);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that initialize()/recover() works correctly after a previous initialize()/recover() with/without an intervening
+ * finalize().
+ */
+QPID_AUTO_TEST_CASE(multiple_initialization_recover)
+{
+ string test_name = get_test_name(test_filename, "multiple_initialization_recover");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+
+ // Set combinations of value pairs to be used for number of journal files in first and second init
+ u_int16_t num_jfiles_arr[][2] = {{8, 12}, {4, 7}, {0, 0}}; // end with zeros
+ try
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ for (unsigned p = 0; p < 8; p++)
+ {
+ const bool i_0 = p & 0x01; // first bit
+ const bool i_1 = p & 0x02; // second bit
+ const bool f = p & 0x04; // third bit
+ lpmgr_test_helper::check_multiple_initialization_recover(lfm, jc, num_jfiles_arr, i_0, f, i_1);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that insert() works correctly after initialize() and shifts the pfid sequence beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
+ * insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
+ * insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
+ */
+QPID_AUTO_TEST_CASE(initialize_insert)
+{
+ string test_name = get_test_name(test_filename, "initialize_insert");
+ const u_int16_t initial_num_jfiles = 8;
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr lm;
+ lpmgr_test_helper::initialize(lfm, lm, jc, initial_num_jfiles, true, 0);
+
+ lpmgr_test_helper::insert(lfm, lm, jc, 0);
+ lpmgr_test_helper::insert(lfm, lm, jc, 2, 2);
+ lpmgr_test_helper::insert(lfm, lm, jc, 6);
+ lpmgr_test_helper::insert(lfm, lm, jc, 3);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that insert() works correctly after recover() and shifts the pfid sequence beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
+ * insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
+ * insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
+ */
+QPID_AUTO_TEST_CASE(recover_insert)
+{
+ string test_name = get_test_name(test_filename, "recover_insert");
+ const u_int16_t initial_num_jfiles = 4;
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr lm;
+ lpmgr_test_helper::prepare_recover(lfm, initial_num_jfiles);
+ lpmgr_test_helper::recover(lfm, lm, jc, true, 0);
+
+ lpmgr_test_helper::insert(lfm, lm, jc, 0);
+ lpmgr_test_helper::insert(lfm, lm, jc, 2, 2);
+ lpmgr_test_helper::insert(lfm, lm, jc, 6);
+ lpmgr_test_helper::insert(lfm, lm, jc, 3);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that illegal ae parameter combinations are caught and result in an exception being thrown.
+ */
+QPID_AUTO_TEST_CASE(ae_parameters)
+{
+ string test_name = get_test_name(test_filename, "ae_parameters");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ const u_int16_t num_jfiles = 8;
+ lpmgr lm;
+
+ for (unsigned i = 0; i < 2; i++)
+ {
+ if (i)
+ lpmgr_test_helper::initialize(lfm, lm, jc, num_jfiles, false, 0);
+ else
+ {
+ lpmgr_test_helper::prepare_recover(lfm, num_jfiles);
+ lpmgr_test_helper::recover(lfm, lm, jc, false, 0);
+ }
+
+ lpmgr_test_helper::check_ae_max_jfiles(lm, num_jfiles, num_jfiles - 2);
+ lpmgr_test_helper::check_ae_max_jfiles(lm, num_jfiles, 0);
+ lpmgr_test_helper::check_ae_max_jfiles(lm, num_jfiles, 2 * num_jfiles);
+ lpmgr_test_helper::check_ae_max_jfiles(lm, num_jfiles, num_jfiles);
+ lfm.destroy_journal();
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that initialized or recovered journals with auto-expand disabled will not allow either inserts or appends.
+ */
+QPID_AUTO_TEST_CASE(ae_disabled)
+{
+ string test_name = get_test_name(test_filename, "ae_disabled");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr_test_helper::check_limit(lfm, jc, false, 8, 0);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that initialized or recovered journals with auto-expand enabled and a file limit set will enforce the correct
+ * limits on inserts and appends.
+ */
+QPID_AUTO_TEST_CASE(ae_enabled_limit)
+{
+ string test_name = get_test_name(test_filename, "ae_enabled_limit");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr_test_helper::check_limit(lfm, jc, true, 8, 32);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+/*
+ * Check that initialized or recovered journals with auto-expand enabled and no file limit set (0) will allow inserts and
+ * appends up to the file limit JRNL_MAX_NUM_FILES.
+ */
+QPID_AUTO_TEST_CASE(ae_enabled_unlimited)
+{
+ string test_name = get_test_name(test_filename, "ae_enabled_unlimited");
+ ::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
+ try
+ {
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lfid_pfid_map lfm(test_name, test_name);
+ lpmgr_test_helper::check_limit(lfm, jc, true, 8, 0);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "done" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * Tests randomized combinations of initialization/recovery, initial size, number, size and location of inserts.
+ *
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting the seed
+ * value to that required.
+ */
+QPID_AUTO_TEST_CASE(randomized_tests)
+{
+ string test_name = get_test_name(test_filename, "randomized_tests");
+ const long seed = get_seed();
+ // const long seed = 0x2d9b69d32;
+ cout << "seed=0x" << hex << seed << dec << " " << flush;
+ ::srand48(seed);
+
+ lfid_pfid_map lfm(test_name, test_name);
+ flist pfidl;
+ flist lfidl;
+ rcvdat rd;
+ u_int16_t curr_ae_max_jfiles = 0;
+ jdir::create_dir(test_dir); // Check test dir exists; create it if not
+
+ for (int test_num = 0; test_num < 250; test_num++)
+ {
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
+ lpmgr lm;
+ // 50% chance of recovery except first run and if there is still ae space left
+ const bool recover_flag = test_num > 0 &&
+ curr_ae_max_jfiles > lfm.size() &&
+ 2.0 * ::drand48() < 1.0;
+ if (recover_flag)
+ {
+ // Recover from previous iteration
+ lfm.get_pfid_list(pfidl);
+ lfm.get_lfid_list(lfidl);
+ lfm.write_journal(true, curr_ae_max_jfiles, JFSIZE_SBLKS);
+ lpmgr_test_helper::rcvdat_init(rd, pfidl, true, curr_ae_max_jfiles);
+ lm.recover(rd, &jc, &jc.new_fcntl);
+ lpmgr_test_helper::check_pfids_lfids(lm, pfidl, lfidl);
+ }
+ else
+ {
+ // Initialize from scratch
+ const u_int16_t num_jfiles = 4 + u_int16_t(21.0 * ::drand48()); // size: 4 - 25 files
+ curr_ae_max_jfiles = u_int16_t(4 * num_jfiles * ::drand48()); // size: 0 - 100 files
+ if (curr_ae_max_jfiles > JRNL_MAX_NUM_FILES) curr_ae_max_jfiles = JRNL_MAX_NUM_FILES;
+ else if (curr_ae_max_jfiles <= num_jfiles) curr_ae_max_jfiles = 0;
+ lfm.destroy_journal();
+ lfm.journal_create(num_jfiles, num_jfiles);
+ lfm.get_pfid_list(pfidl);
+ lfm.get_lfid_list(lfidl);
+ lm.initialize(num_jfiles, true, curr_ae_max_jfiles, &jc, &jc.new_fcntl);
+ lpmgr_test_helper::check_linear_pfids_lfids(lm, num_jfiles);
+ }
+
+ // Loop to insert pfids
+ const int num_inserts = 1 + int(lfm.size() * ::drand48());
+ for (int i = 0; i < num_inserts; i++)
+ {
+ const u_int16_t size = lm.num_jfiles();
+ const u_int16_t after_lfid = u_int16_t(1.0 * size * ::drand48());
+ const u_int16_t num_jfiles = 1 + u_int16_t(4.0 * ::drand48());
+ const bool legal = lm.ae_max_jfiles()
+ ? size + num_jfiles <= lm.ae_max_jfiles()
+ : size + num_jfiles <= JRNL_MAX_NUM_FILES;
+ if (legal)
+ {
+ lfm.journal_insert(after_lfid, num_jfiles);
+ lfm.get_pfid_list(pfidl);
+ lfm.get_lfid_list(lfidl);
+
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, num_jfiles);
+ lpmgr_test_helper::check_pfids_lfids(lm, pfidl, lfidl);
+ }
+ else
+ {
+ try
+ {
+ lm.insert(after_lfid, &jc, &jc.new_fcntl, num_jfiles);
+ BOOST_FAIL("lpmgr::insert() succeeded and exceeded limit");
+ }
+ catch (const jexception& e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_LFMGR_AEFNUMLIMIT);
+ break; // no more inserts...
+ }
+ }
+ }
+ lm.finalize();
+ BOOST_CHECK_EQUAL(lm.is_init(), false);
+ BOOST_CHECK_EQUAL(lm.num_jfiles(), u_int16_t(0));
+ BOOST_CHECK_EQUAL(lm.get_fcntlp(0), (void*)0);
+ }
+ cout << "done" << endl;
+}
+
+#endif
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp
new file mode 100644
index 0000000000..099e576bbd
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_rec_hdr.cpp
@@ -0,0 +1,438 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <ctime>
+#include <iostream>
+#include "qpid/legacystore/jrnl/deq_hdr.h"
+#include "qpid/legacystore/jrnl/enq_hdr.h"
+#include "qpid/legacystore/jrnl/file_hdr.h"
+#include "qpid/legacystore/jrnl/jcfg.h"
+#include "qpid/legacystore/jrnl/rec_tail.h"
+#include "qpid/legacystore/jrnl/txn_hdr.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(rec_hdr_suite)
+
+const string test_filename("_ut_rec_hdr");
+
+QPID_AUTO_TEST_CASE(hdr_class)
+{
+ cout << test_filename << ".hdr_class: " << flush;
+ rec_hdr h1;
+ BOOST_CHECK_EQUAL(h1._magic, 0UL);
+ BOOST_CHECK_EQUAL(h1._version, 0);
+ BOOST_CHECK_EQUAL(h1._eflag, 0);
+ BOOST_CHECK_EQUAL(h1._uflag, 0);
+ BOOST_CHECK_EQUAL(h1._rid, 0ULL);
+ BOOST_CHECK(!h1.get_owi());
+
+ const u_int32_t magic = 0x89abcdefUL;
+ const u_int16_t uflag = 0x5537;
+ const u_int8_t version = 0xef;
+ const u_int64_t rid = 0x123456789abcdef0ULL;
+ const bool owi = true;
+
+ rec_hdr h2(magic, version, rid, owi);
+ BOOST_CHECK_EQUAL(h2._magic, magic);
+ BOOST_CHECK_EQUAL(h2._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(h2._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(h2._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(h2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(h2._rid, rid);
+ BOOST_CHECK_EQUAL(h2.get_owi(), owi);
+ h2._uflag = uflag;
+ BOOST_CHECK(h2.get_owi());
+ h2.set_owi(true);
+ BOOST_CHECK(h2.get_owi());
+ BOOST_CHECK_EQUAL(h2._uflag, uflag);
+ h2.set_owi(false);
+ BOOST_CHECK(!h2.get_owi());
+ BOOST_CHECK_EQUAL(h2._uflag, (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK));
+ h2.set_owi(true);
+ BOOST_CHECK(h2.get_owi());
+ BOOST_CHECK_EQUAL(h2._uflag, uflag);
+
+ h1.hdr_copy(h2);
+ BOOST_CHECK_EQUAL(h1._magic, magic);
+ BOOST_CHECK_EQUAL(h1._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(h1._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(h1._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(h1._uflag, uflag);
+ BOOST_CHECK_EQUAL(h1._rid, rid);
+ BOOST_CHECK(h1.get_owi());
+ BOOST_CHECK_EQUAL(h1._uflag, uflag);
+
+ h1.reset();
+ BOOST_CHECK_EQUAL(h1._magic, 0UL);
+ BOOST_CHECK_EQUAL(h1._version, 0);
+ BOOST_CHECK_EQUAL(h1._eflag, 0);
+ BOOST_CHECK_EQUAL(h1._uflag, 0);
+ BOOST_CHECK_EQUAL(h1._rid, 0ULL);
+ BOOST_CHECK(!h1.get_owi());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(rec_tail_class)
+{
+ cout << test_filename << ".rec_tail_class: " << flush;
+ const u_int32_t magic = 0xfedcba98;
+ const u_int64_t rid = 0xfedcba9876543210ULL;
+ const u_int32_t xmagic = ~magic;
+
+ {
+ rec_tail rt1;
+ BOOST_CHECK_EQUAL(rt1._xmagic, 0xffffffffUL);
+ BOOST_CHECK_EQUAL(rt1._rid, 0ULL);
+ }
+
+ {
+ rec_tail rt2(magic, rid);
+ BOOST_CHECK_EQUAL(rt2._xmagic, magic);
+ BOOST_CHECK_EQUAL(rt2._rid, rid);
+ }
+
+ {
+ rec_hdr h(magic, RHM_JDAT_VERSION, rid, true);
+ rec_tail rt3(h);
+ BOOST_CHECK_EQUAL(rt3._xmagic, xmagic);
+ BOOST_CHECK_EQUAL(rt3._rid, rid);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(file_hdr_class)
+{
+ cout << test_filename << ".file_hdr_class: " << flush;
+ const u_int32_t magic = 0xfedcba98UL;
+ const u_int8_t version = 0xa5;
+ const u_int16_t uflag = 0x5537;
+ const u_int64_t rid = 0xfedcba9876543210ULL;
+ const u_int16_t pfid = 0xfedcU;
+ const u_int16_t lfid = 0xf0e1U;
+#ifdef JRNL_32_BIT
+ const std::size_t fro = 0xfedcba98UL;
+#else
+ const std::size_t fro = 0xfedcba9876543210ULL;
+#endif
+ timespec ts;
+ const bool owi = true;
+
+ {
+ file_hdr fh1;
+ BOOST_CHECK_EQUAL(fh1._magic, 0UL);
+ BOOST_CHECK_EQUAL(fh1._version, 0);
+ BOOST_CHECK_EQUAL(fh1._eflag, 0);
+ BOOST_CHECK_EQUAL(fh1._uflag, 0);
+ BOOST_CHECK_EQUAL(fh1._rid, 0ULL);
+ BOOST_CHECK_EQUAL(fh1._pfid, 0UL);
+ BOOST_CHECK_EQUAL(fh1._lfid, 0U);
+ BOOST_CHECK_EQUAL(fh1._fro, std::size_t(0));
+ BOOST_CHECK_EQUAL(fh1._ts_sec, std::time_t(0));
+ BOOST_CHECK_EQUAL(fh1._ts_nsec, u_int32_t(0));
+ BOOST_CHECK(!fh1.get_owi());
+ }
+
+ {
+ file_hdr fh2(magic, version, rid, pfid, lfid, fro, owi, false);
+ BOOST_CHECK_EQUAL(fh2._magic, magic);
+ BOOST_CHECK_EQUAL(fh2._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(fh2._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(fh2._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(fh2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(fh2._rid, rid);
+ BOOST_CHECK_EQUAL(fh2._pfid, pfid );
+ BOOST_CHECK_EQUAL(fh2._lfid, lfid);
+ BOOST_CHECK_EQUAL(fh2._fro, fro);
+ BOOST_CHECK_EQUAL(fh2._ts_sec, std::time_t(0));
+ BOOST_CHECK_EQUAL(fh2._ts_nsec, u_int32_t(0));
+ ::clock_gettime(CLOCK_REALTIME, &ts);
+ fh2.set_time(ts);
+ BOOST_CHECK_EQUAL(fh2._ts_sec, ts.tv_sec);
+ BOOST_CHECK_EQUAL(fh2._ts_nsec, u_int32_t(ts.tv_nsec));
+ BOOST_CHECK(fh2.get_owi());
+
+ fh2._uflag = uflag;
+ BOOST_CHECK(fh2.get_owi());
+
+ fh2.set_owi(false);
+ BOOST_CHECK(!fh2.get_owi());
+ BOOST_CHECK_EQUAL(fh2._uflag,
+ (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK));
+
+ fh2.set_owi(true);
+ BOOST_CHECK(fh2.get_owi());
+ BOOST_CHECK_EQUAL(fh2._uflag, uflag);
+ }
+
+ {
+ file_hdr fh3(magic, version, rid, pfid, lfid, fro, owi, true);
+ BOOST_CHECK_EQUAL(fh3._magic, magic);
+ BOOST_CHECK_EQUAL(fh3._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(fh3._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(fh3._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(fh3._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(fh3._rid, rid);
+ BOOST_CHECK_EQUAL(fh3._pfid, pfid);
+ BOOST_CHECK_EQUAL(fh3._lfid, lfid);
+ BOOST_CHECK_EQUAL(fh3._fro, fro);
+ BOOST_CHECK(fh3._ts_sec - ts.tv_sec <= 1); // No more than 1 sec difference
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(enq_hdr_class)
+{
+ cout << test_filename << ".enq_hdr_class: " << flush;
+ const u_int32_t magic = 0xfedcba98UL;
+ const u_int8_t version = 0xa5;
+ const u_int64_t rid = 0xfedcba9876543210ULL;
+ const u_int16_t uflag = 0x5537;
+#ifdef JRNL_32_BIT
+ const std::size_t xidsize = 0xfedcba98UL;
+ const std::size_t dsize = 0x76543210UL;
+#else
+ const std::size_t xidsize = 0xfedcba9876543210ULL;
+ const std::size_t dsize = 0x76543210fedcba98ULL;
+#endif
+ const bool owi = true;
+
+ {
+ enq_hdr eh1;
+ BOOST_CHECK_EQUAL(eh1._magic, 0UL);
+ BOOST_CHECK_EQUAL(eh1._version, 0);
+ BOOST_CHECK_EQUAL(eh1._eflag, 0);
+ BOOST_CHECK_EQUAL(eh1._uflag, 0);
+ BOOST_CHECK_EQUAL(eh1._rid, 0ULL);
+ BOOST_CHECK_EQUAL(eh1._xidsize, std::size_t(0));
+ BOOST_CHECK_EQUAL(eh1._dsize, std::size_t(0));
+ BOOST_CHECK(!eh1.get_owi());
+ }
+
+ {
+ enq_hdr eh2(magic, version, rid, xidsize, dsize, owi, false);
+ BOOST_CHECK_EQUAL(eh2._magic, magic);
+ BOOST_CHECK_EQUAL(eh2._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(eh2._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(eh2._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(eh2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(eh2._rid, rid);
+ BOOST_CHECK_EQUAL(eh2._xidsize, xidsize);
+ BOOST_CHECK_EQUAL(eh2._dsize, dsize);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(!eh2.is_transient());
+ BOOST_CHECK(!eh2.is_external());
+
+ eh2._uflag = uflag;
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+
+ eh2.set_owi(false);
+ BOOST_CHECK(!eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag,
+ (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK));
+
+ eh2.set_owi(true);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag, uflag);
+
+ eh2.set_transient(false);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(!eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag, uflag & ~(const u_int16_t)enq_hdr::ENQ_HDR_TRANSIENT_MASK);
+
+ eh2.set_transient(true);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag, uflag);
+
+ eh2.set_external(false);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(!eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag, uflag & ~(const u_int16_t)enq_hdr::ENQ_HDR_EXTERNAL_MASK);
+
+ eh2.set_external(true);
+ BOOST_CHECK(eh2.get_owi());
+ BOOST_CHECK(eh2.is_transient());
+ BOOST_CHECK(eh2.is_external());
+ BOOST_CHECK_EQUAL(eh2._uflag, uflag);
+ }
+
+ {
+ enq_hdr eh3(magic, version, rid, xidsize, dsize, owi, true);
+ BOOST_CHECK_EQUAL(eh3._magic, magic);
+ BOOST_CHECK_EQUAL(eh3._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(eh3._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(eh3._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(eh3._uflag, (const u_int16_t)enq_hdr::ENQ_HDR_TRANSIENT_MASK |
+ (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(eh3._rid, rid);
+ BOOST_CHECK_EQUAL(eh3._xidsize, xidsize);
+ BOOST_CHECK_EQUAL(eh3._dsize, dsize);
+ BOOST_CHECK(eh3.get_owi());
+ BOOST_CHECK(eh3.is_transient());
+ BOOST_CHECK(!eh3.is_external());
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(deq_hdr_class)
+{
+ cout << test_filename << ".deq_hdr_class: " << flush;
+ const u_int32_t magic = 0xfedcba98UL;
+ const u_int8_t version = 0xa5;
+ const u_int16_t uflag = 0x5537;
+ const u_int64_t rid = 0xfedcba9876543210ULL;
+ const u_int64_t drid = 0x76543210fedcba98ULL;
+#ifdef JRNL_32_BIT
+ const std::size_t xidsize = 0xfedcba98UL;
+#else
+ const std::size_t xidsize = 0xfedcba9876543210ULL;
+#endif
+ const bool owi = true;
+
+ {
+ deq_hdr dh1;
+ BOOST_CHECK_EQUAL(dh1._magic, 0UL);
+ BOOST_CHECK_EQUAL(dh1._version, 0);
+ BOOST_CHECK_EQUAL(dh1._eflag, 0);
+ BOOST_CHECK_EQUAL(dh1._uflag, 0);
+ BOOST_CHECK_EQUAL(dh1._rid, 0ULL);
+ BOOST_CHECK_EQUAL(dh1._deq_rid, 0ULL);
+ BOOST_CHECK_EQUAL(dh1._xidsize, std::size_t(0));
+ BOOST_CHECK(!dh1.get_owi());
+ }
+
+ {
+ deq_hdr dh2(magic, version, rid, drid, xidsize, owi);
+ BOOST_CHECK_EQUAL(dh2._magic, magic);
+ BOOST_CHECK_EQUAL(dh2._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(dh2._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(dh2._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(dh2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(dh2._rid, rid);
+ BOOST_CHECK_EQUAL(dh2._deq_rid, drid);
+ BOOST_CHECK_EQUAL(dh2._xidsize, xidsize);
+ BOOST_CHECK(dh2.get_owi());
+
+ dh2._uflag = uflag;
+ BOOST_CHECK(dh2.get_owi());
+
+ dh2.set_owi(false);
+ BOOST_CHECK(!dh2.get_owi());
+ BOOST_CHECK_EQUAL(dh2._uflag,
+ (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK));
+
+ dh2.set_owi(true);
+ BOOST_CHECK(dh2.get_owi());
+ BOOST_CHECK_EQUAL(dh2._uflag, uflag);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(txn_hdr_class)
+{
+ cout << test_filename << ".txn_hdr_class: " << flush;
+ const u_int32_t magic = 0xfedcba98UL;
+ const u_int8_t version = 0xa5;
+ const u_int16_t uflag = 0x5537;
+ const u_int64_t rid = 0xfedcba9876543210ULL;
+#ifdef JRNL_32_BIT
+ const std::size_t xidsize = 0xfedcba98UL;
+#else
+ const std::size_t xidsize = 0xfedcba9876543210ULL;
+#endif
+ const bool owi = true;
+
+ {
+ txn_hdr th1;
+ BOOST_CHECK_EQUAL(th1._magic, 0UL);
+ BOOST_CHECK_EQUAL(th1._version, 0);
+ BOOST_CHECK_EQUAL(th1._eflag, 0);
+ BOOST_CHECK_EQUAL(th1._uflag, 0);
+ BOOST_CHECK_EQUAL(th1._rid, 0ULL);
+ BOOST_CHECK_EQUAL(th1._xidsize, std::size_t(0));
+ BOOST_CHECK(!th1.get_owi());
+ }
+
+ {
+ txn_hdr th2(magic, version, rid, xidsize, owi);
+ BOOST_CHECK_EQUAL(th2._magic, magic);
+ BOOST_CHECK_EQUAL(th2._version, version);
+#ifdef JRNL_LITTLE_ENDIAN
+ BOOST_CHECK_EQUAL(th2._eflag, RHM_LENDIAN_FLAG);
+#else
+ BOOST_CHECK_EQUAL(th2._eflag, RHM_BENDIAN_FLAG);
+#endif
+ BOOST_CHECK_EQUAL(th2._uflag, (const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK);
+ BOOST_CHECK_EQUAL(th2._rid, rid);
+ BOOST_CHECK_EQUAL(th2._xidsize, xidsize);
+ BOOST_CHECK(th2.get_owi());
+
+ th2._uflag = uflag;
+ BOOST_CHECK(th2.get_owi());
+
+ th2.set_owi(false);
+ BOOST_CHECK(!th2.get_owi());
+ BOOST_CHECK_EQUAL(th2._uflag,
+ (uflag & ~(const u_int16_t)rec_hdr::HDR_OVERWRITE_INDICATOR_MASK));
+
+ th2.set_owi(true);
+ BOOST_CHECK(th2.get_owi());
+ BOOST_CHECK_EQUAL(th2._uflag, uflag);
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp
new file mode 100644
index 0000000000..f1b53bb97b
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_time_ns.cpp
@@ -0,0 +1,163 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <ctime>
+#include <iostream>
+#include "qpid/legacystore/jrnl/time_ns.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(time_ns_suite)
+
+const string test_filename("_ut_time_ns");
+
+QPID_AUTO_TEST_CASE(constructors)
+{
+ cout << test_filename << ".constructors: " << flush;
+ const std::time_t sec = 123;
+ const long nsec = 123456789;
+
+ time_ns t1;
+ BOOST_CHECK_EQUAL(t1.tv_sec, 0);
+ BOOST_CHECK_EQUAL(t1.tv_nsec, 0);
+ BOOST_CHECK_EQUAL(t1.is_zero(), true);
+ time_ns t2(sec, nsec);
+ BOOST_CHECK_EQUAL(t2.tv_sec, sec);
+ BOOST_CHECK_EQUAL(t2.tv_nsec, nsec);
+ BOOST_CHECK_EQUAL(t2.is_zero(), false);
+ time_ns t3(t1);
+ BOOST_CHECK_EQUAL(t3.tv_sec, 0);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, 0);
+ BOOST_CHECK_EQUAL(t3.is_zero(), true);
+ time_ns t4(t2);
+ BOOST_CHECK_EQUAL(t4.tv_sec, sec);
+ BOOST_CHECK_EQUAL(t4.tv_nsec, nsec);
+ BOOST_CHECK_EQUAL(t4.is_zero(), false);
+ t4.set_zero();
+ BOOST_CHECK_EQUAL(t4.tv_sec, 0);
+ BOOST_CHECK_EQUAL(t4.tv_nsec, 0);
+ BOOST_CHECK_EQUAL(t4.is_zero(), true);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(operators)
+{
+ cout << test_filename << ".operators: " << flush;
+ const std::time_t sec1 = 123;
+ const long nsec1 = 123456789;
+ const std::time_t sec2 = 1;
+ const long nsec2 = 999999999;
+ const std::time_t sec_sum = sec1 + sec2 + 1;
+ const long nsec_sum = nsec1 + nsec2 - 1000000000;
+ const std::time_t sec_1_minus_2 = sec1 - sec2 - 1;
+ const long nsec_1_minus_2 = nsec1 - nsec2 + 1000000000;
+ const std::time_t sec_2_minus_1 = sec2 - sec1;
+ const long nsec_2_minus_1 = nsec2 - nsec1;
+ time_ns z;
+ time_ns t1(sec1, nsec1);
+ time_ns t2(sec2, nsec2);
+
+ time_ns t3 = z;
+ BOOST_CHECK_EQUAL(t3.tv_sec, 0);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, 0);
+ BOOST_CHECK_EQUAL(t3 == z, true);
+ BOOST_CHECK_EQUAL(t3 != z, false);
+ BOOST_CHECK_EQUAL(t3 > z, false);
+ BOOST_CHECK_EQUAL(t3 >= z, true);
+ BOOST_CHECK_EQUAL(t3 < z, false);
+ BOOST_CHECK_EQUAL(t3 <= z, true);
+
+ t3 = t1;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec1);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec1);
+ BOOST_CHECK_EQUAL(t3 == t1, true);
+ BOOST_CHECK_EQUAL(t3 != t1, false);
+ BOOST_CHECK_EQUAL(t3 > t1, false);
+ BOOST_CHECK_EQUAL(t3 >= t1, true);
+ BOOST_CHECK_EQUAL(t3 < t1, false);
+ BOOST_CHECK_EQUAL(t3 <= t1, true);
+
+ t3 += z;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec1);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec1);
+
+ t3 = t2;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec2);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec2);
+ BOOST_CHECK_EQUAL(t3 == t2, true);
+ BOOST_CHECK_EQUAL(t3 != t2, false);
+ BOOST_CHECK_EQUAL(t3 > t2, false);
+ BOOST_CHECK_EQUAL(t3 >= t2, true);
+ BOOST_CHECK_EQUAL(t3 < t2, false);
+ BOOST_CHECK_EQUAL(t3 <= t2, true);
+
+ t3 += z;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec2);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec2);
+
+ t3 = t1;
+ t3 += t2;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_sum);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_sum);
+
+ t3 = t1;
+ t3 -= t2;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_1_minus_2);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_1_minus_2);
+
+ t3 = t2;
+ t3 -= t1;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_2_minus_1);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_2_minus_1);
+
+ t3 = t1 + t2;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_sum);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_sum);
+
+ t3 = t1 - t2;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_1_minus_2);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_1_minus_2);
+
+ t3 = t2 - t1;
+ BOOST_CHECK_EQUAL(t3.tv_sec, sec_2_minus_1);
+ BOOST_CHECK_EQUAL(t3.tv_nsec, nsec_2_minus_1);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(str)
+{
+ cout << test_filename << ".str: " << flush;
+ time_ns t1(123, 123456789);
+ BOOST_CHECK_EQUAL(t1.str(), "123.123457");
+ BOOST_CHECK_EQUAL(t1.str(9), "123.123456789");
+ BOOST_CHECK_EQUAL(t1.str(0), "123");
+ time_ns t2(1, 1);
+ BOOST_CHECK_EQUAL(t2.str(9), "1.000000001");
+ time_ns t3(-12, 345);
+ BOOST_CHECK_EQUAL(t3.str(9), "-11.999999655");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp
new file mode 100644
index 0000000000..595ce0f6c6
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_txn_map.cpp
@@ -0,0 +1,106 @@
+/*
+ *
+ * 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 "../unit_test.h"
+
+#include <iomanip>
+#include <iostream>
+#include "qpid/legacystore/jrnl/txn_map.h"
+#include <sstream>
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(txn_map_suite)
+
+const string test_filename("_ut_txn_map");
+
+// === Helper functions ===
+
+const string make_xid(u_int64_t rid)
+{
+ stringstream ss;
+ ss << "XID-" << setfill('0') << setw(16) << hex << rid;
+ ss << "-0123456789abcdef";
+ return ss.str();
+}
+
+void check_td_equal(txn_data& td1, txn_data& td2)
+{
+ BOOST_CHECK_EQUAL(td1._rid, td2._rid);
+ BOOST_CHECK_EQUAL(td1._drid, td2._drid);
+ BOOST_CHECK_EQUAL(td1._pfid, td2._pfid);
+ BOOST_CHECK_EQUAL(td1._enq_flag, td2._enq_flag);
+ BOOST_CHECK_EQUAL(td1._aio_compl, td2._aio_compl);
+}
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ const u_int64_t rid = 0x123456789abcdef0ULL;
+ const u_int64_t drid = 0xfedcba9876543210ULL;
+ const u_int16_t pfid = 0xfedcU;
+ const bool enq_flag = true;
+ txn_data td(rid, drid, pfid, enq_flag);
+ BOOST_CHECK_EQUAL(td._rid, rid);
+ BOOST_CHECK_EQUAL(td._drid, drid);
+ BOOST_CHECK_EQUAL(td._pfid, pfid);
+ BOOST_CHECK_EQUAL(td._enq_flag, enq_flag);
+ BOOST_CHECK_EQUAL(td._aio_compl, false);
+
+ txn_map t1;
+ BOOST_CHECK(t1.empty());
+ BOOST_CHECK_EQUAL(t1.size(), u_int32_t(0));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(insert_get)
+{
+ cout << test_filename << ".insert_get: " << flush;
+ u_int16_t fid;
+ u_int64_t rid;
+ u_int16_t pfid_start = 0x2000U;
+ u_int64_t rid_begin = 0xffffffff00000000ULL;
+ u_int64_t rid_end = 0xffffffff00000200ULL;
+
+ // insert with no dups
+ u_int64_t rid_incr_1 = 4ULL;
+ txn_map t2;
+ t2.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, fid = pfid_start; rid < rid_end; rid += rid_incr_1, fid++)
+ t2.insert_txn_data(make_xid(rid), txn_data(rid, ~rid, fid, false));
+ BOOST_CHECK(!t2.empty());
+ BOOST_CHECK_EQUAL(t2.size(), u_int32_t(128));
+
+ // get
+ u_int64_t rid_incr_2 = 6ULL;
+ for (u_int64_t rid = rid_begin; rid < rid_end; rid += rid_incr_2)
+ {
+ string xid = make_xid(rid);
+ BOOST_CHECK_EQUAL(t2.in_map(xid), (rid%rid_incr_1 ? false : true));
+ }
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata b/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata
new file mode 100755
index 0000000000..67b322af59
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/chk_jdata
@@ -0,0 +1,32 @@
+#!/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.
+#
+
+
+JRNL_BLK_SIZE=512 # Block size in bytes
+JRNL_PAGE_SIZE=256 # Journal page size in blocks
+JRNL_FILE_SIZE=12 # Journal file size in pages
+let END_OFFSET=${JRNL_BLK_SIZE}*${JRNL_PAGE_SIZE}*${JRNL_FILE_SIZE}
+for f in jdata/test.*.jdat; do
+ echo $f
+ hexdump -C -n 1024 $f
+ hexdump -C -s ${END_OFFSET} $f
+ echo "============"
+done
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl b/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl
new file mode 100755
index 0000000000..6d5171ae71
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/cp_rtest_jrnl
@@ -0,0 +1,59 @@
+#!/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.
+#
+
+JDATA_DIR=jdata
+TAR_DIR=rd_test_jrnls
+
+function get_filename
+{
+ local prefix=$1
+ local file_num=$2
+ local suffix=$3
+
+ if (( file_num < 10 )); then
+ local num="000${file_num}"
+ elif (( file_num < 100 )); then
+ local num="00${file_num}"
+ elif (( file_num < 1000 )); then
+ local num="0${file_num}"
+ else
+ local num="${file_num}"
+ fi
+ FILENAME=${prefix}${num}${suffix}
+ return 0
+}
+
+if (( $# != 1 )); then
+ echo "Incorrect args, expected 1 arg (usage: \"prep <testnum>\")"
+ exit
+fi
+
+get_filename "t" $1 ".tar.gz"
+if [[ -d ${JDATA_DIR} ]]; then
+ rm -rf ${JDATA_DIR}/*
+else
+ mkdir -p ${JDATA_DIR}
+fi
+if [[ -f "${TAR_DIR}/${FILENAME}" ]]; then
+ tar -C ${JDATA_DIR} -xzf "${TAR_DIR}/${FILENAME}"
+else
+ echo "Error: file \"${TAR_DIR}/${FILENAME}\" not found."
+fi
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jhexdump b/qpid/cpp/src/tests/legacystore/jrnl/jhexdump
new file mode 100755
index 0000000000..2d4c8a4afb
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jhexdump
@@ -0,0 +1,41 @@
+#!/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.
+#
+
+if [ -z "$1" ]; then
+ echo "No directory specified."
+ exit
+fi
+
+JDIR=$1
+echo "Target directory: ${JDIR}"
+
+rm -f j*.txt
+
+if [ -d "${JDIR}" ]; then
+ n=0
+ for f in "${JDIR}"/*.jdat; do
+ echo "$f -> j$n.txt"
+ hexdump -C "$f" > j$n.txt
+ (( n += 1 ))
+ done
+else
+ echo "This directory does not exist."
+fi
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp
new file mode 100644
index 0000000000..e4656ef83f
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_data_src.cpp
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include <cstddef>
+#include "data_src.h"
+#include <iomanip>
+#include <iostream>
+
+using namespace boost::unit_test;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_data_src)
+
+const string test_filename("_ut_data_src");
+
+long
+get_seed()
+{
+ timespec ts;
+ if (::clock_gettime(CLOCK_REALTIME, &ts))
+ BOOST_FAIL("Unable to read clock to generate seed.");
+ long tenths = ts.tv_nsec / 100000000;
+ return long(10 * ts.tv_sec + tenths); // time in tenths of a second
+}
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(data)
+{
+ cout << test_filename << ".data: " << flush;
+ BOOST_CHECK(data_src::max_dsize > 0);
+ for (std::size_t i=0; i<1024; i++)
+ {
+ const char* dp = data_src::get_data(i);
+ BOOST_CHECK_EQUAL(*dp, static_cast<char>('0' + ((i + 1) % 10)));
+ }
+ for (std::size_t i=data_src::max_dsize-1024; i<data_src::max_dsize; i++)
+ {
+ const char* dp = data_src::get_data(i);
+ BOOST_CHECK_EQUAL(*dp, static_cast<char>('0' + ((i + 1) % 10)));
+ }
+ const char* dp1 = data_src::get_data(data_src::max_dsize);
+ BOOST_CHECK_EQUAL(dp1,(char*) 0);
+ const char* dp2 = data_src::get_data(data_src::max_dsize + 0x1000);
+ BOOST_CHECK_EQUAL(dp2, (char*)0);
+ cout << "ok" << endl;
+}
+
+// There is a long version of this test in _ut_long_data_src.cpp
+QPID_AUTO_TEST_CASE(xid_data_xid)
+{
+ const std::size_t num = 64;
+ cout << test_filename << ".xid_data_xid: " << flush;
+ BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
+ BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
+ BOOST_CHECK_EQUAL(data_src::get_xid(3), "002");
+ BOOST_CHECK_EQUAL(data_src::get_xid(4), "0003");
+ BOOST_CHECK_EQUAL(data_src::get_xid(5), "00004");
+ BOOST_CHECK_EQUAL(data_src::get_xid(6), "000005");
+ BOOST_CHECK_EQUAL(data_src::get_xid(7), "0000006");
+ BOOST_CHECK_EQUAL(data_src::get_xid(8), "00000007");
+ BOOST_CHECK_EQUAL(data_src::get_xid(9), "xid:00008");
+ BOOST_CHECK_EQUAL(data_src::get_xid(10), "xid:000009");
+ BOOST_CHECK_EQUAL(data_src::get_xid(11), "xid:0000010");
+ BOOST_CHECK_EQUAL(data_src::get_xid(12), "xid:00000011");
+ BOOST_CHECK_EQUAL(data_src::get_xid(13), "xid:00000012:");
+ BOOST_CHECK_EQUAL(data_src::get_xid(14), "xid:00000013:n");
+ BOOST_CHECK_EQUAL(data_src::get_xid(15), "xid:00000014:no");
+ std::size_t i = 15;
+ for (; i<num; i++)
+ {
+ string xid(data_src::get_xid(i));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), i);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[i-1], (char)('a' + ((i-1)%26)));
+ }
+ for (std::size_t j=data_src::max_xsize-num; j<data_src::max_xsize; j++,i++)
+ {
+ string xid(data_src::get_xid(j));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), j);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[j-1], (char)('a' + ((j-1)%26)));
+ }
+ cout << "ok" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting the seed
+ * value to that required.
+ */
+QPID_AUTO_TEST_CASE(xid_data_xid)
+{
+ const long seed = get_seed();
+ // const long seed = 0x2d9b69d32;
+ ::srand48(seed);
+
+ const std::size_t num = 1024;
+ cout << test_filename << ".xid_data_xid seed=0x" << std::hex << seed << std::dec << ": " << flush;
+ BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
+ BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
+ BOOST_CHECK_EQUAL(data_src::get_xid(3), "002");
+ BOOST_CHECK_EQUAL(data_src::get_xid(4), "0003");
+ BOOST_CHECK_EQUAL(data_src::get_xid(5), "00004");
+ BOOST_CHECK_EQUAL(data_src::get_xid(6), "000005");
+ BOOST_CHECK_EQUAL(data_src::get_xid(7), "0000006");
+ BOOST_CHECK_EQUAL(data_src::get_xid(8), "00000007");
+ BOOST_CHECK_EQUAL(data_src::get_xid(9), "xid:00008");
+ BOOST_CHECK_EQUAL(data_src::get_xid(10), "xid:000009");
+ BOOST_CHECK_EQUAL(data_src::get_xid(11), "xid:0000010");
+ BOOST_CHECK_EQUAL(data_src::get_xid(12), "xid:00000011");
+ BOOST_CHECK_EQUAL(data_src::get_xid(13), "xid:00000012:");
+ BOOST_CHECK_EQUAL(data_src::get_xid(14), "xid:00000013:n");
+ BOOST_CHECK_EQUAL(data_src::get_xid(15), "xid:00000014:no");
+ std::size_t i = 15;
+ for (; i<num; i++)
+ {
+ string xid(data_src::get_xid(i));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), i);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[i-1], (char)('a' + ((i-1)%26)));
+ }
+ for (std::size_t j=data_src::max_xsize-num; j<data_src::max_xsize; j++,i++)
+ {
+ string xid(data_src::get_xid(j));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), j);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[j-1], (char)('a' + ((j-1)%26)));
+ }
+ std::srand(seed);
+ for (int cnt=0; cnt<1000; cnt++,i++)
+ {
+ std::size_t k = 1 + ::lrand48() % (data_src::max_xsize - 1);
+ string xid(data_src::get_xid(k));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), k);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[k-1], (char)('a' + ((k-1)%26)));
+ }
+ cout << "ok" << endl;
+}
+
+#endif
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_init_params.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_init_params.cpp
new file mode 100644
index 0000000000..9fefe25105
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_init_params.cpp
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include "jrnl_init_params.h"
+#include <iostream>
+
+using namespace boost::unit_test;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_jrnl_init_params)
+
+const string test_filename("_ut_jrnl_init_params");
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ const string jid = "jid";
+ const string jdir = "jdir";
+ const string bfn = "base filename";
+ const u_int16_t num_jfiles = 123;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 456;
+ const u_int32_t jfsize_sblks = 789;
+ jrnl_init_params jip(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks);
+ BOOST_CHECK_EQUAL(jip.jid(), jid);
+ BOOST_CHECK_EQUAL(jip.jdir(), jdir);
+ BOOST_CHECK_EQUAL(jip.base_filename(), bfn);
+ BOOST_CHECK_EQUAL(jip.num_jfiles(), num_jfiles);
+ BOOST_CHECK_EQUAL(jip.is_ae(), ae);
+ BOOST_CHECK_EQUAL(jip.ae_max_jfiles(), ae_max_jfiles);
+ BOOST_CHECK_EQUAL(jip.jfsize_sblks(), jfsize_sblks);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(copy_constructor_1)
+{
+ cout << test_filename << ".copy_constructor_1: " << flush;
+ const string jid = "jid";
+ const string jdir = "jdir";
+ const string bfn = "base filename";
+ const u_int16_t num_jfiles = 123;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 456;
+ const u_int32_t jfsize_sblks = 789;
+ jrnl_init_params jip1(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks);
+ jrnl_init_params jip2(jip1);
+ BOOST_CHECK_EQUAL(jip2.jid(), jid);
+ BOOST_CHECK_EQUAL(jip2.jdir(), jdir);
+ BOOST_CHECK_EQUAL(jip2.base_filename(), bfn);
+ BOOST_CHECK_EQUAL(jip2.num_jfiles(), num_jfiles);
+ BOOST_CHECK_EQUAL(jip2.is_ae(), ae);
+ BOOST_CHECK_EQUAL(jip2.ae_max_jfiles(), ae_max_jfiles);
+ BOOST_CHECK_EQUAL(jip2.jfsize_sblks(), jfsize_sblks);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(copy_constructor_2)
+{
+ cout << test_filename << ".copy_constructor_2: " << flush;
+ const string jid = "jid";
+ const string jdir = "jdir";
+ const string bfn = "base filename";
+ const u_int16_t num_jfiles = 123;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 456;
+ const u_int32_t jfsize_sblks = 789;
+ jrnl_init_params::shared_ptr p(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks));
+ jrnl_init_params jip2(p.get());
+ BOOST_CHECK_EQUAL(jip2.jid(), jid);
+ BOOST_CHECK_EQUAL(jip2.jdir(), jdir);
+ BOOST_CHECK_EQUAL(jip2.base_filename(), bfn);
+ BOOST_CHECK_EQUAL(jip2.num_jfiles(), num_jfiles);
+ BOOST_CHECK_EQUAL(jip2.is_ae(), ae);
+ BOOST_CHECK_EQUAL(jip2.ae_max_jfiles(), ae_max_jfiles);
+ BOOST_CHECK_EQUAL(jip2.jfsize_sblks(), jfsize_sblks);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
+
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp
new file mode 100644
index 0000000000..12f1c542d6
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_jrnl_instance.cpp
@@ -0,0 +1,178 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+
+#include <iostream>
+#include "jrnl_init_params.h"
+#include "jrnl_instance.h"
+#include "qpid/legacystore/jrnl/jdir.h"
+#include "qpid/legacystore/jrnl/jerrno.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_jrnl_instance)
+
+const string test_filename("_ut_jrnl_instance");
+const char* tdp = getenv("TMP_DATA_DIR");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/JttTest");
+
+QPID_AUTO_TEST_CASE(constructor_1)
+{
+ cout << test_filename << ".constructor_1: " << flush;
+ const string jid = "jid1";
+ const string jdir = test_dir + "/test1";
+ const string bfn = "test";
+ const u_int16_t num_jfiles = 20;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 45;
+ const u_int32_t jfsize_sblks = 128;
+
+ args a("a1");
+ using mrg::jtt::test_case;
+ test_case::shared_ptr p(new test_case(1, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL,
+ "t1"));
+ jrnl_instance ji(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks);
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ jdir::delete_dir(jdir);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_2)
+{
+ cout << test_filename << ".constructor_2: " << flush;
+ const string jid = "jid2";
+ const string jdir = test_dir + "/test2";
+ const string bfn = "test";
+ const u_int16_t num_jfiles = 20;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 45;
+ const u_int32_t jfsize_sblks = 128;
+
+ args a("a2");
+ using mrg::jtt::test_case;
+ test_case::shared_ptr p(new test_case(2, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL,
+ "t2"));
+ jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks));
+ jrnl_instance ji(jpp);
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ jdir::delete_dir(jdir);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_3)
+{
+ cout << test_filename << ".constructor_3: " << flush;
+ const string jid = "jid3";
+ const string jdir = test_dir + "/test3";
+ const string bfn = "test";
+ const u_int16_t num_jfiles = 20;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 45;
+ const u_int32_t jfsize_sblks = 128;
+
+ args a("a3");
+ using mrg::jtt::test_case;
+ test_case::shared_ptr p(new test_case(3, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL,
+ "t3"));
+ jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks));
+ jrnl_instance ji(jpp);
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ jdir::delete_dir(jdir);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover)
+{
+ cout << test_filename << ".recover: " << flush;
+ const string jid = "jid5";
+ const string jdir = test_dir + "/test5";
+ const string bfn = "test";
+ const u_int16_t num_jfiles = 20;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 0;
+ const u_int32_t jfsize_sblks = 128;
+
+ args a("a4");
+ using mrg::jtt::test_case;
+ test_case::shared_ptr p(new test_case(5, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL,
+ "t5"));
+ jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks));
+ jrnl_instance ji(jpp);
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ a.recover_mode = true;
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ jdir::delete_dir(jdir);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(recover_no_files)
+{
+ cout << test_filename << ".recover_no_files: " << flush;
+ const string jid = "jid6";
+ const string jdir = test_dir + "/test6";
+ const string bfn = "test";
+ const u_int16_t num_jfiles = 20;
+ const bool ae = false;
+ const u_int16_t ae_max_jfiles = 0;
+ const u_int32_t jfsize_sblks = 128;
+
+ args a("a5");
+ a.recover_mode = true;
+ using mrg::jtt::test_case;
+ test_case::shared_ptr p(new test_case(6, 0, 0, 0, false, 0, 0, test_case::JTT_PERSISTNET, test_case::JDL_INTERNAL,
+ "t6"));
+ jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid, jdir, bfn, num_jfiles, ae, ae_max_jfiles, jfsize_sblks));
+ jrnl_instance ji(jpp);
+ ji.init_tc(p, &a);
+ ji.run_tc();
+ ji.tc_wait_compl();
+ try { jdir::verify_dir(jdir, bfn); }
+ catch (const jexception& e) { BOOST_ERROR(e.what()); }
+ jdir::delete_dir(jdir);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
+
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp
new file mode 100644
index 0000000000..0d2025270d
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_read_arg.cpp
@@ -0,0 +1,146 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include <boost/test/unit_test_log.hpp>
+#include "read_arg.h"
+#include <iostream>
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+using namespace mrg::jtt;
+using namespace boost::unit_test;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_read_arg)
+
+const string test_filename("_ut_read_arg");
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ read_arg ra1;
+ BOOST_CHECK_EQUAL(ra1.val(), read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra1.str(), "NONE");
+ read_arg ra2(read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra2.val(), read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra2.str(), "NONE");
+ read_arg ra3(read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra3.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra3.str(), "ALL");
+ read_arg ra4(read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra4.val(), read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra4.str(), "RANDOM");
+ read_arg ra5(read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra5.val(), read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra5.str(), "LAZYLOAD");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(set_val)
+{
+ cout << test_filename << ".set_val: " << flush;
+ read_arg ra;
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra.str(), "NONE");
+ ra.set_val(read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.str(), "ALL");
+ ra.set_val(read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra.str(), "RANDOM");
+ ra.set_val(read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(parse)
+{
+ cout << test_filename << ".parse: " << flush;
+ read_arg ra;
+ ra.parse("LAZYLOAD");
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD");
+ ra.parse("ALL");
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.str(), "ALL");
+ BOOST_CHECK_THROW(ra.parse(""), po::invalid_option_value)
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.str(), "ALL");
+ BOOST_CHECK_THROW(ra.parse("abc123"), po::invalid_option_value)
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.str(), "ALL");
+ ra.parse("NONE");
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra.str(), "NONE");
+ ra.parse("RANDOM");
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra.str(), "RANDOM");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(istream_)
+{
+ cout << test_filename << ".istream_: " << flush;
+ read_arg ra;
+ istringstream ss1("LAZYLOAD", ios::in);
+ ss1 >> ra;
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::LAZYLOAD);
+ BOOST_CHECK_EQUAL(ra.str(), "LAZYLOAD");
+ istringstream ss2("ALL", ios::in);
+ ss2 >> ra;
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::ALL);
+ BOOST_CHECK_EQUAL(ra.str(), "ALL");
+ istringstream ss3("NONE", ios::in);
+ ss3 >> ra;
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::NONE);
+ BOOST_CHECK_EQUAL(ra.str(), "NONE");
+ istringstream ss4("RANDOM", ios::in);
+ ss4 >> ra;
+ BOOST_CHECK_EQUAL(ra.val(), read_arg::RANDOM);
+ BOOST_CHECK_EQUAL(ra.str(), "RANDOM");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(ostream_)
+{
+ cout << test_filename << ".ostream_: " << flush;
+ ostringstream s1;
+ read_arg ra(read_arg::LAZYLOAD);
+ s1 << ra;
+ BOOST_CHECK_EQUAL(s1.str(), "LAZYLOAD");
+ ra.set_val(read_arg::ALL);
+ ostringstream s2;
+ s2 << ra;
+ BOOST_CHECK_EQUAL(s2.str(), "ALL");
+ ra.set_val(read_arg::NONE);
+ ostringstream s3;
+ s3 << ra;
+ BOOST_CHECK_EQUAL(s3.str(), "NONE");
+ ra.set_val(read_arg::RANDOM);
+ ostringstream s4;
+ s4 << ra;
+ BOOST_CHECK_EQUAL(s4.str(), "RANDOM");
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp
new file mode 100644
index 0000000000..3a7d0f951c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case.cpp
@@ -0,0 +1,113 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include <cstddef>
+#include <iomanip>
+#include <iostream>
+#include "test_case.h"
+#include "test_case_result.h"
+
+using namespace boost::unit_test;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_test_case)
+
+const string test_filename("_ut_test_case");
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ const unsigned test_case_num = 0x12345;
+ const u_int32_t num_msgs = 0x100;
+ const std::size_t min_data_size = 0x1000;
+ const std::size_t max_data_size = 0;
+ const bool auto_deq = true;
+ const std::size_t min_xid_size = 0x200;
+ const std::size_t max_xid_size = 0x200;
+ using mrg::jtt::test_case;
+ const test_case::transient_t transient = test_case::JTT_PERSISTNET;
+ const test_case::external_t external = test_case::JDL_INTERNAL;
+ const string comment = "This is a test";
+
+ test_case tc(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq,
+ min_xid_size, max_xid_size, transient, external, comment);
+ BOOST_CHECK_EQUAL(tc.test_case_num(), test_case_num);
+ BOOST_CHECK_EQUAL(tc.num_msgs(), num_msgs);
+ BOOST_CHECK_EQUAL(tc.min_data_size(), min_data_size);
+ BOOST_CHECK_EQUAL(tc.max_data_size(), max_data_size);
+ BOOST_CHECK_EQUAL(tc.auto_deq(), auto_deq);
+ BOOST_CHECK_EQUAL(tc.min_xid_size(), min_xid_size);
+ BOOST_CHECK_EQUAL(tc.max_xid_size(), max_xid_size);
+ BOOST_CHECK_EQUAL(tc.transient(), transient);
+ BOOST_CHECK_EQUAL(tc.external(), external);
+ BOOST_CHECK_EQUAL(tc.comment(), comment);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(results)
+{
+ cout << test_filename << ".results: " << flush;
+ const unsigned test_case_num = 0x12345;
+ const u_int32_t num_msgs = 0x100;
+ const std::size_t min_data_size = 0x1000;
+ const std::size_t max_data_size = 0;
+ const bool auto_deq = true;
+ const std::size_t min_xid_size = 0x200;
+ const std::size_t max_xid_size = 0x200;
+ using mrg::jtt::test_case;
+ const test_case::transient_t transient = test_case::JTT_PERSISTNET;
+ const test_case::external_t external = test_case::JDL_INTERNAL;
+ const string comment = "This is a test";
+ const unsigned num_results = 20;
+
+ test_case tc(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq,
+ min_xid_size, max_xid_size, transient, external, comment);
+ for (unsigned i=0; i<num_results; i++)
+ {
+ ostringstream oss;
+ oss << "JID_" << setfill('0') << setw(2) << i;
+ test_case_result::shared_ptr p(new test_case_result(oss.str()));
+ tc.add_result(p);
+ }
+ BOOST_CHECK_EQUAL(tc.num_results(), num_results);
+ test_case_result_agregation ave = tc.average();
+ unsigned i=0;
+ for (test_case_result_agregation::tcrp_list_citr j=ave.rlist_begin(); j!=ave.rlist_end();
+ i++,j++)
+ {
+ ostringstream oss;
+ oss << "JID_" << setfill('0') << setw(2) << i;
+ BOOST_CHECK_EQUAL((*j)->jid(), oss.str());
+ }
+ for (unsigned i=0; i<num_results; i++)
+ {
+ ostringstream oss;
+ oss << "JID_" << setfill('0') << setw(2) << i;
+ BOOST_CHECK_EQUAL(ave[i]->jid(), oss.str());
+ }
+ tc.clear();
+ BOOST_CHECK_EQUAL(tc.num_results(), unsigned(0));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp
new file mode 100644
index 0000000000..dd83dbee69
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result.cpp
@@ -0,0 +1,206 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+
+#include <iostream>
+#include "qpid/legacystore/jrnl/jexception.h"
+#include "test_case_result.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_test_case_result)
+
+const string test_filename("_ut_test_case_result");
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ const string jid("journal id 1");
+ test_case_result tcr(jid);
+ BOOST_CHECK_EQUAL(tcr.jid(), jid);
+ BOOST_CHECK_EQUAL(tcr.exception(), false);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 0U);
+ const time_ns& ts1 = tcr.start_time();
+ BOOST_CHECK(ts1.is_zero());
+ const time_ns& ts2 = tcr.stop_time();
+ BOOST_CHECK(ts2.is_zero());
+ const time_ns& ts3 = tcr.test_time();
+ BOOST_CHECK(ts3.is_zero());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(start_stop)
+{
+ cout << test_filename << ".start_stop: " << flush;
+ const string jid("journal id 2");
+ test_case_result tcr(jid);
+ BOOST_CHECK_EQUAL(tcr.exception(), false);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 0U);
+ const time_ns& ts1 = tcr.start_time();
+ BOOST_CHECK(ts1.is_zero());
+ const time_ns& ts2 = tcr.stop_time();
+ BOOST_CHECK(ts2.is_zero());
+ const time_ns& ts3 = tcr.test_time();
+ BOOST_CHECK(ts3.is_zero());
+
+ tcr.set_start_time();
+ BOOST_CHECK_EQUAL(tcr.exception(), false);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 0U);
+ const time_ns& ts4 = tcr.start_time();
+ BOOST_CHECK(!ts4.is_zero());
+ const time_ns& ts5 = tcr.stop_time();
+ BOOST_CHECK(ts5.is_zero());
+ const time_ns& ts6 = tcr.test_time();
+ BOOST_CHECK(ts6.is_zero());
+
+ ::usleep(1100000); // 1.1 sec in microseconds
+ tcr.set_stop_time();
+ BOOST_CHECK_EQUAL(tcr.exception(), false);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 0U);
+ const time_ns& ts7 = tcr.stop_time();
+ BOOST_CHECK(!ts7.is_zero());
+ const time_ns& ts8 = tcr.test_time();
+ BOOST_CHECK(ts8.tv_sec == 1);
+ BOOST_CHECK(ts8.tv_nsec > 100000000); // 0.1 sec in nanoseconds
+ BOOST_CHECK(ts8.tv_nsec < 200000000); // 0.2 sec in nanoseconds
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(start_exception_stop_1)
+{
+ cout << test_filename << ".start_exception_stop_1: " << flush;
+ const string jid("journal id 3");
+ test_case_result tcr(jid);
+ const u_int32_t err_code = 0x321;
+ const string err_msg = "exception message";
+ const jexception e(err_code, err_msg);
+ tcr.set_start_time();
+ ::usleep(1100000); // 1.1 sec in microseconds
+ tcr.add_exception(e);
+ BOOST_CHECK_EQUAL(tcr.exception(), true);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 1U);
+ BOOST_CHECK_EQUAL(tcr[0], e.what());
+ const time_ns& ts1 = tcr.stop_time();
+ BOOST_CHECK(!ts1.is_zero());
+ const time_ns& ts2 = tcr.test_time();
+ BOOST_CHECK(ts2.tv_sec == 1);
+ BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds
+ BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(start_exception_stop_2)
+{
+ cout << test_filename << ".start_exception_stop_2: " << flush;
+ const string jid("journal id 4");
+ test_case_result tcr(jid);
+ const string err_msg = "exception message";
+ tcr.set_start_time();
+ ::usleep(1100000); // 1.1 sec in microseconds
+ tcr.add_exception(err_msg);
+ BOOST_CHECK_EQUAL(tcr.exception(), true);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 1U);
+ BOOST_CHECK_EQUAL(tcr[0], err_msg);
+ const time_ns& ts1 = tcr.stop_time();
+ BOOST_CHECK(!ts1.is_zero());
+ const time_ns& ts2 = tcr.test_time();
+ BOOST_CHECK(ts2.tv_sec == 1);
+ BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds
+ BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(start_exception_stop_3)
+{
+ cout << test_filename << ".start_exception_stop_3: " << flush;
+ const string jid("journal id 5");
+ test_case_result tcr(jid);
+ const char* err_msg = "exception message";
+ tcr.set_start_time();
+ ::usleep(1100000); // 1.1 sec in microseconds
+ tcr.add_exception(err_msg);
+ BOOST_CHECK_EQUAL(tcr.exception(), true);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 1U);
+ BOOST_CHECK_EQUAL(tcr[0], err_msg);
+ const time_ns& ts1 = tcr.stop_time();
+ BOOST_CHECK(!ts1.is_zero());
+ const time_ns& ts2 = tcr.test_time();
+ BOOST_CHECK(ts2.tv_sec == 1);
+ BOOST_CHECK(ts2.tv_nsec > 100000000); // 0.1 sec in nanoseconds
+ BOOST_CHECK(ts2.tv_nsec < 200000000); // 0.2 sec in nanoseconds
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(start_exception)
+{
+ cout << test_filename << ".start_exception: " << flush;
+ const string jid("journal id 6");
+ test_case_result tcr(jid);
+ u_int32_t err_code = 0x654;
+ const string err_msg = "exception message";
+ const jexception e(err_code, err_msg);
+ tcr.set_start_time();
+ ::usleep(1100000); // 1.1 sec in microseconds
+ tcr.add_exception(e, false);
+ BOOST_CHECK_EQUAL(tcr.exception(), true);
+ BOOST_CHECK_EQUAL(tcr.exception_count(), 1U);
+ BOOST_CHECK_EQUAL(tcr[0], e.what());
+ const time_ns& ts1 = tcr.stop_time();
+ BOOST_CHECK(ts1.is_zero());
+ const time_ns& ts2 = tcr.test_time();
+ BOOST_CHECK(ts2.is_zero());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(counters)
+{
+ cout << test_filename << ".counters: " << flush;
+ const u_int32_t num_enq = 125;
+ const u_int32_t num_deq = 64;
+ const u_int32_t num_read = 22;
+ const string jid("journal id 7");
+ test_case_result tcr(jid);
+ BOOST_CHECK_EQUAL(tcr.num_enq(), u_int32_t(0));
+ BOOST_CHECK_EQUAL(tcr.num_deq(), u_int32_t(0));
+ BOOST_CHECK_EQUAL(tcr.num_read(), u_int32_t(0));
+ for (unsigned i=0; i<num_enq; i++)
+ tcr.incr_num_enq();
+ BOOST_CHECK_EQUAL(tcr.num_enq(), num_enq);
+ BOOST_CHECK_EQUAL(tcr.num_deq(), u_int32_t(0));
+ BOOST_CHECK_EQUAL(tcr.num_read(), u_int32_t(0));
+ for (unsigned j=0; j<num_deq; j++)
+ tcr.incr_num_deq();
+ BOOST_CHECK_EQUAL(tcr.num_enq(), num_enq);
+ BOOST_CHECK_EQUAL(tcr.num_deq(), num_deq);
+ BOOST_CHECK_EQUAL(tcr.num_read(), u_int32_t(0));
+ for (unsigned k=0; k<num_read; k++)
+ tcr.incr_num_read();
+ BOOST_CHECK_EQUAL(tcr.num_enq(), num_enq);
+ BOOST_CHECK_EQUAL(tcr.num_deq(), num_deq);
+ BOOST_CHECK_EQUAL(tcr.num_read(), num_read);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result_agregation.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result_agregation.cpp
new file mode 100644
index 0000000000..aa01bf833d
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_result_agregation.cpp
@@ -0,0 +1,178 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include <ctime>
+#include <iostream>
+#include "test_case_result_agregation.h"
+
+using namespace boost::unit_test;
+using namespace mrg::journal;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_test_case_result_agregation)
+
+const string test_filename("_ut_test_case_result_agregation");
+
+// === Helper functions ===
+
+void check_agregate(const test_case_result_agregation& tcra, const u_int32_t num_enq,
+ const u_int32_t num_deq, const u_int32_t num_reads, const u_int32_t num_results,
+ const u_int32_t num_exceptions, const std::time_t secs, const long nsec)
+{
+ BOOST_CHECK_EQUAL(tcra.num_enq(), num_enq);
+ BOOST_CHECK_EQUAL(tcra.num_deq(), num_deq);
+ BOOST_CHECK_EQUAL(tcra.num_read(), num_reads);
+ BOOST_CHECK_EQUAL(tcra.num_results(), num_results);
+ BOOST_CHECK_EQUAL(tcra.exception_count(), num_exceptions);
+ BOOST_CHECK_EQUAL(tcra.exception(), num_exceptions > 0);
+ const time_ns& ts1 = tcra.test_time();
+ BOOST_CHECK_EQUAL(ts1.tv_sec, secs);
+ BOOST_CHECK_EQUAL(ts1.tv_nsec, nsec);
+}
+
+test_case_result::shared_ptr make_result(const string& jid, const u_int32_t num_enq,
+ const u_int32_t num_deq, const u_int32_t num_reads, const std::time_t secs, const long nsec)
+{
+ test_case_result::shared_ptr tcrp(new test_case_result(jid));
+ for (unsigned i=0; i<num_enq; i++)
+ tcrp->incr_num_enq();
+ for (unsigned i=0; i<num_deq; i++)
+ tcrp->incr_num_deq();
+ for (unsigned i=0; i<num_reads; i++)
+ tcrp->incr_num_read();
+ time_ns ts(secs, nsec);
+ tcrp->set_test_time(ts);
+ return tcrp;
+}
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(constructor_1)
+{
+ cout << test_filename << ".constructor_1: " << flush;
+ test_case_result_agregation tcra;
+ BOOST_CHECK_EQUAL(tcra.tc_average_mode(), true);
+ BOOST_CHECK_EQUAL(tcra.jid(), "Average");
+ BOOST_CHECK_EQUAL(tcra.exception(), false);
+ BOOST_CHECK_EQUAL(tcra.exception_count(), 0U);
+ const time_ns& ts1 = tcra.start_time();
+ BOOST_CHECK(ts1.is_zero());
+ const time_ns& ts2 = tcra.stop_time();
+ BOOST_CHECK(ts2.is_zero());
+ const time_ns& ts3 = tcra.test_time();
+ BOOST_CHECK(ts3.is_zero());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(constructor_2)
+{
+ cout << test_filename << ".constructor_2: " << flush;
+ string jid("journal id");
+ test_case_result_agregation tcra(jid);
+ BOOST_CHECK_EQUAL(tcra.tc_average_mode(), false);
+ BOOST_CHECK_EQUAL(tcra.jid(), jid);
+ BOOST_CHECK_EQUAL(tcra.exception(), false);
+ BOOST_CHECK_EQUAL(tcra.exception_count(), 0U);
+ const time_ns& ts1 = tcra.start_time();
+ BOOST_CHECK(ts1.is_zero());
+ const time_ns& ts2 = tcra.stop_time();
+ BOOST_CHECK(ts2.is_zero());
+ const time_ns& ts3 = tcra.test_time();
+ BOOST_CHECK(ts3.is_zero());
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(add_test_case)
+{
+ cout << test_filename << ".add_test_case: " << flush;
+ string jid("jid1");
+ test_case_result::shared_ptr tcrp1 = make_result("jid1", 10, 10, 0, 1, 101010101L);
+ test_case_result::shared_ptr tcrp2 = make_result("jid1", 25, 0, 35, 10, 20202020L);
+ test_case_result::shared_ptr tcrp3 = make_result("jid1", 0, 15, 5, 2, 555555555L);
+ test_case_result::shared_ptr tcrp4 = make_result("jid2", 100, 100, 100, 100, 323232324L);
+ test_case_result::shared_ptr tcrp5 = make_result("jid1", 5, 0, 0, 0, 100L);
+ tcrp5->add_exception(string("error 1"), false);
+ test_case_result::shared_ptr tcrp6 = make_result("jid3", 0, 5, 0, 0, 100L);
+ jexception e(0x123, "exception 2");
+ tcrp6->add_exception(e, false);
+ test_case_result::shared_ptr tcrp7 = make_result("jid1", 0, 0, 0, 0, 0L);
+ test_case_result::shared_ptr tcrp8 = make_result("jid1", 200, 100, 300, 12, 323232224L);
+
+ test_case_result_agregation tcra(jid);
+ check_agregate(tcra, 0, 0, 0, 0, 0, 0, 0L);
+ tcra.add_test_result(tcrp1);
+ check_agregate(tcra, 10, 10, 0, 1, 0, 1, 101010101L);
+ tcra.add_test_result(tcrp2);
+ check_agregate(tcra, 35, 10, 35, 2, 0, 11, 121212121L);
+ tcra.add_test_result(tcrp3);
+ check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L);
+ tcra.add_test_result(tcrp4);
+ check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L);
+ tcra.add_test_result(tcrp5);
+ check_agregate(tcra, 40, 25, 40, 4, 1, 13, 676767776L);
+ tcra.add_test_result(tcrp6);
+ check_agregate(tcra, 40, 25, 40, 4, 1, 13, 676767776L);
+ tcra.add_test_result(tcrp7);
+ check_agregate(tcra, 40, 25, 40, 5, 1, 13, 676767776L);
+ tcra.add_test_result(tcrp8);
+ check_agregate(tcra, 240, 125, 340, 6, 1, 26, 0L);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(add_test_case_average)
+{
+ cout << test_filename << ".add_test_case_average: " << flush;
+ test_case_result::shared_ptr tcrp1 = make_result("jid1", 10, 10, 0, 1, 101010101L);
+ test_case_result::shared_ptr tcrp2 = make_result("jid2", 25, 0, 35, 10, 20202020L);
+ test_case_result::shared_ptr tcrp3 = make_result("jid3", 0, 15, 5, 2, 555555555L);
+ test_case_result::shared_ptr tcrp4 = make_result("jid4", 100, 100, 100, 100, 323232324L);
+ test_case_result::shared_ptr tcrp5 = make_result("jid5", 5, 0, 0, 0, 100L);
+ tcrp5->add_exception(string("error 1"), false);
+ test_case_result::shared_ptr tcrp6 = make_result("jid6", 0, 5, 0, 0, 100L);
+ jexception e(0x123, "exception 2");
+ tcrp6->add_exception(e, false);
+ test_case_result::shared_ptr tcrp7 = make_result("jid7", 0, 0, 0, 0, 0L);
+ test_case_result::shared_ptr tcrp8 = make_result("jid8", 200, 100, 300, 12, 222222022L);
+
+ test_case_result_agregation tcra;
+ check_agregate(tcra, 0, 0, 0, 0, 0, 0, 0L);
+ tcra.add_test_result(tcrp1);
+ check_agregate(tcra, 10, 10, 0, 1, 0, 1, 101010101L);
+ tcra.add_test_result(tcrp2);
+ check_agregate(tcra, 35, 10, 35, 2, 0, 11, 121212121L);
+ tcra.add_test_result(tcrp3);
+ check_agregate(tcra, 35, 25, 40, 3, 0, 13, 676767676L);
+ tcra.add_test_result(tcrp4);
+ check_agregate(tcra, 135, 125, 140, 4, 0, 114, 0L);
+ tcra.add_test_result(tcrp5);
+ check_agregate(tcra, 140, 125, 140, 5, 1, 114, 100L);
+ tcra.add_test_result(tcrp6);
+ check_agregate(tcra, 140, 130, 140, 6, 2, 114, 200L);
+ tcra.add_test_result(tcrp7);
+ check_agregate(tcra, 140, 130, 140, 7, 2, 114, 200L);
+ tcra.add_test_result(tcrp8);
+ check_agregate(tcra, 340, 230, 440, 8, 2, 126, 222222222L);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp
new file mode 100644
index 0000000000..adbdf6884b
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.cpp
@@ -0,0 +1,147 @@
+/*
+ *
+ * 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 "../../unit_test.h"
+#include <cstddef>
+#include <iostream>
+#include <sys/stat.h>
+#include "test_case.h"
+#include "test_case_set.h"
+
+using namespace boost::unit_test;
+using namespace mrg::jtt;
+using namespace std;
+
+QPID_AUTO_TEST_SUITE(jtt_test_case_set)
+
+const string csv_file("_ut_test_case_set.csv");
+const string test_filename("_ut_test_case_set");
+
+// === Helper functions ===
+
+bool check_csv_file(const char* filename)
+{
+ struct stat s;
+ if (::stat(filename, &s))
+ return false;
+ if (S_ISREG(s.st_mode))
+ return true;
+ return false;
+}
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(constructor)
+{
+ cout << test_filename << ".constructor: " << flush;
+ test_case_set tcs;
+ BOOST_CHECK(tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(0));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(append_1)
+{
+ cout << test_filename << ".append_1: " << flush;
+ const unsigned test_case_num = 0x12345;
+ const u_int32_t num_msgs = 0x100;
+ const std::size_t min_data_size = 0x1000;
+ const std::size_t max_data_size = 0;
+ const bool auto_deq = true;
+ const std::size_t min_xid_size = 0x200;
+ const std::size_t max_xid_size = 0x200;
+ using mrg::jtt::test_case;
+ const test_case::transient_t transient = test_case::JTT_PERSISTNET;
+ const test_case::external_t external = test_case::JDL_INTERNAL;
+ const string comment = "This is a test";
+
+ test_case_set tcs;
+ tcs.append(test_case_num, num_msgs, min_data_size, max_data_size, auto_deq, min_xid_size,
+ max_xid_size, transient, external, comment);
+ BOOST_CHECK(!tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(1));
+ test_case::shared_ptr tcp = tcs[0];
+ BOOST_CHECK_EQUAL(tcp->test_case_num(), test_case_num);
+ BOOST_CHECK_EQUAL(tcp->num_msgs(), num_msgs);
+ BOOST_CHECK_EQUAL(tcp->min_data_size(), min_data_size);
+ BOOST_CHECK_EQUAL(tcp->max_data_size(), max_data_size);
+ BOOST_CHECK_EQUAL(tcp->min_xid_size(), min_xid_size);
+ BOOST_CHECK_EQUAL(tcp->max_xid_size(), max_xid_size);
+ BOOST_CHECK_EQUAL(tcp->transient(), transient);
+ BOOST_CHECK_EQUAL(tcp->external(), external);
+ BOOST_CHECK_EQUAL(tcp->comment(), comment);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(append_2)
+{
+ cout << test_filename << ".append_2: " << flush;
+ const unsigned test_case_num = 0x12345;
+ const u_int32_t num_msgs = 0x100;
+ const std::size_t min_data_size = 0x1000;
+ const std::size_t max_data_size = 0;
+ const bool auto_deq = true;
+ const std::size_t min_xid_size = 0x200;
+ const std::size_t max_xid_size = 0x200;
+ using mrg::jtt::test_case;
+ const test_case::transient_t transient = test_case::JTT_PERSISTNET;
+ const test_case::external_t external = test_case::JDL_INTERNAL;
+ const string comment = "This is a test";
+
+ test_case::shared_ptr tcp(new test_case(test_case_num, num_msgs, min_data_size, max_data_size,
+ auto_deq, min_xid_size, max_xid_size, transient, external, comment));
+ test_case_set tcs;
+ tcs.append(tcp);
+ BOOST_CHECK(!tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(1));
+ tcp = tcs[0];
+ BOOST_CHECK_EQUAL(tcp->test_case_num(), test_case_num);
+ BOOST_CHECK_EQUAL(tcp->num_msgs(), num_msgs);
+ BOOST_CHECK_EQUAL(tcp->min_data_size(), min_data_size);
+ BOOST_CHECK_EQUAL(tcp->max_data_size(), max_data_size);
+ BOOST_CHECK_EQUAL(tcp->min_xid_size(), min_xid_size);
+ BOOST_CHECK_EQUAL(tcp->max_xid_size(), max_xid_size);
+ BOOST_CHECK_EQUAL(tcp->transient(), transient);
+ BOOST_CHECK_EQUAL(tcp->external(), external);
+ BOOST_CHECK_EQUAL(tcp->comment(), comment);
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_CASE(append_from_csv)
+{
+ cout << test_filename << ".append_from_csv: " << flush;
+ test_case_set tcs;
+ BOOST_REQUIRE_MESSAGE(check_csv_file(csv_file.c_str()), "Test CSV file \"" << csv_file <<
+ "\" is missing.");
+ tcs.append_from_csv(csv_file, false);
+ BOOST_CHECK(!tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(44));
+ BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(0));
+ tcs.clear();
+ BOOST_CHECK(tcs.empty());
+ tcs.append_from_csv(csv_file, true);
+ BOOST_CHECK(!tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(18));
+ BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(26));
+ cout << "ok" << endl;
+}
+
+QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv
new file mode 100644
index 0000000000..f886186275
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/_ut_test_case_set.csv
@@ -0,0 +1,74 @@
+#
+# 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.
+#
+
+,,,,,,,"Msg size",,"Xid size",,,,,"enq-size",,"deq-size",,"txn-size",,
+"Col. 0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"
+"Test #","tf","pf","amn","mn incr","#msgs","ms incr","Min","Max","Min","Max","auto-deq","transient","extern","bytes","dblks","bytes","dblks","bytes","dblks","comment"
+,,,,,,,,,,,,,,,,,,,,
+"Initialize only",,,,,,,,,,,,,,,,,,,,
+0,"L",0,0,0,0,0,0,0,0,0,FALSE,FALSE,FALSE,44,1,0,0,0,0,"No messages - journal creation/initialization only"
+,,,,,,,,,,,,,,,,,,,,
+"Simple message combinations of persistent/deq transientueued/non-dequeued, transactional/non-transactional",,,,,,,,,,,,,,,,,,,,
+1,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"1 * 10-byte message"
+2,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"10 * 10-byte message"
+3,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"1 * 10-byte message [transient]"
+4,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"10 * 10-byte message [transient]"
+5,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn]"
+6,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn]"
+7,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn transient]"
+8,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn transient]"
+9,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq]"
+10,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq]"
+11,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq transient]"
+12,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq transient]"
+13,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [deq txn]"
+14,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [deq txn]"
+15,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient]"
+16,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient]"
+17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [extern]"
+18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [extern]"
+19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [transient extern]"
+20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [transient extern]"
+21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn extern]"
+22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn extern]"
+23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn transient extern]"
+24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn transient extern]"
+25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq extern]"
+26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq extern]"
+27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq transient extern]"
+28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq transient extern]"
+29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [deq txn extern]"
+30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [deq txn extern]"
+31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]"
+32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]"
+,,,,,,,,,,,,,,,,,,,,
+"High volume tests of random message lengths - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,,
+33,"M",1,5000000,0,5000000,0,0,100,1,100,FALSE,RANDOM,RANDOM,244,2,0,0,0,0,"100 bytes xid max + 100 bytes data max [txn]"
+34,"M",3,3000000,0,3000000,0,0,300,1,300,FALSE,RANDOM,RANDOM,644,6,0,0,0,0,"300 bytes xid max + 300 bytes data max [txn]"
+35,"M",10,1600000,0,1600000,0,0,1000,1,1000,FALSE,RANDOM,RANDOM,2044,16,0,0,0,0,"1000 bytes xid max + 1000 bytes data max [txn]"
+36,"M",30,600000,0,600000,0,0,3000,1,3000,FALSE,RANDOM,RANDOM,6044,48,0,0,0,0,"3000 bytes xid max + 3000 bytes data max [txn]"
+37,"M",100,200000,0,200000,0,0,10000,1,10000,FALSE,RANDOM,RANDOM,20044,157,0,0,0,0,"10000 bytes xid max + 10000 bytes data max [txn]"
+38,"M",300,60000,0,60000,0,0,30000,1,30000,FALSE,RANDOM,RANDOM,60044,470,0,0,0,0,"30000 bytes xid max + 30000 bytes data max [txn]"
+39,"M",1000,20000,0,20000,0,0,100000,1,100000,FALSE,RANDOM,RANDOM,200044,1563,0,0,0,0,"100000 bytes xid max + 100000 bytes data max [txn]"
+,,,,,,,,,,,,,,,,,,,,
+"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=212b (2 dblks)",,,,,,,,,,,,,,,,,,,,
+40,"M",1,10000000,0,10000000,0,212,212,0,0,FALSE,FALSE,FALSE,256,2,0,0,0,0,"212 bytes data (2 dblks enq)"
+41,"M",1,10000000,0,10000000,0,148,148,64,64,FALSE,FALSE,FALSE,256,2,0,0,0,0,"148 bytes data + 64 bytes xid (2 dblks enq)"
+42,"M",1,10000000,0,10000000,0,212,212,0,0,TRUE,FALSE,FALSE,256,2,32,1,0,0,"212 bytes data (2 dblks enq + 1 dblk deq)"
+43,"M",1,10000000,0,10000000,0,148,148,64,64,TRUE,FALSE,FALSE,256,2,108,1,100,1,"148 bytes data + 64 bytes xid (2 dblks enq + 1 dblks deq + 1 dblks txn)"
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.cpp
new file mode 100644
index 0000000000..0f041c380e
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.cpp
@@ -0,0 +1,226 @@
+/*
+ *
+ * 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 "args.h"
+
+#include <cstddef>
+#include <iostream>
+
+namespace po = boost::program_options;
+
+namespace mrg
+{
+namespace jtt
+{
+
+args::args(std::string opt_title):
+ _options_descr(opt_title),
+ format_chk(false),
+ keep_jrnls(false),
+ lld_rd_num(10),
+ lld_skip_num(100),
+ num_jrnls(1),
+ pause_secs(0),
+ randomize(false),
+ read_mode(),
+ read_prob(50),
+ recover_mode(false),
+ repeat_flag(false),
+ reuse_instance(false),
+ seed(0)
+{
+ _options_descr.add_options()
+ ("csv-file,c",
+ po::value<std::string>(&test_case_csv_file_name)->default_value("jtt.csv"),
+ "CSV file containing test cases.")
+
+ ("format-chk",
+ po::value<bool>(&format_chk)->zero_tokens(),
+ "Check the format of each journal file.")
+
+ ("help,h", "This help message.")
+
+ ("jrnl-dir",
+ po::value<std::string>(&journal_dir)->default_value("/var/tmp/jtt"),
+ "Directory in which journal files will be placed.")
+
+ ("keep-jrnls",
+ po::value<bool>(&keep_jrnls)->zero_tokens(),
+ "Keep all test journals.")
+
+ ("lld-rd-num",
+ po::value<unsigned>(&lld_rd_num)->default_value(10),
+ "Number of consecutive messages to read after only dequeueing lld-skip-num "
+ "messages during lazy-loading. Ignored if read-mode is not set to LAZYLOAD.")
+
+ ("lld-skip-num",
+ po::value<unsigned>(&lld_skip_num)->default_value(100),
+ "Number of consecutive messages to dequeue only (without reading) prior to "
+ "reading lld-rd-num messages. Ignored if read-mode is not set to LAZYLOAD.")
+
+ ("num-jrnls",
+ po::value<unsigned>(&num_jrnls)->default_value(1),
+ "Number of simultaneous journal instances to test.")
+
+ ("pause",
+ po::value<unsigned>(&pause_secs)->default_value(0),
+ "Pause in seconds between test cases (allows disk to catch up).")
+
+ ("randomize",
+ po::value<bool>(&randomize)->zero_tokens(),
+ "Randomize the order of the tests.")
+
+ ("read-mode",
+ po::value<read_arg>(&read_mode)->default_value(read_arg::NONE),
+ read_arg::descr().c_str())
+
+ ("read-prob",
+ po::value<unsigned>(&read_prob)->default_value(50),
+ "Read probability (percent) for each message when read-mode is set to RANDOM.")
+
+ ("recover-mode",
+ po::value<bool>(&recover_mode)->zero_tokens(),
+ "Recover journal from the previous test for each test case.")
+
+ ("repeat",
+ po::value<bool>(&repeat_flag)->zero_tokens(),
+ "Repeat all test cases indefinitely.")
+
+ ("reuse-instance",
+ po::value<bool>(&reuse_instance)->zero_tokens(),
+ "Reuse journal instance for all test cases.")
+
+ ("seed",
+ po::value<unsigned>(&seed)->default_value(0),
+ "Seed for use in random number generator.")
+
+ ("analyzer",
+ po::value<std::string>(&jfile_analyzer)->default_value("./file_chk.py"),
+ "Journal file analyzer program to use when the --format-chk option is used, ignored otherwise.")
+
+ ;
+}
+
+bool
+args::parse(int argc, char** argv) // return true if error, false if ok
+{
+ try
+ {
+ po::store(po::parse_command_line(argc, argv, _options_descr), _vmap);
+ po::notify(_vmap);
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "ERROR: " << e.what() << std::endl;
+ return usage();
+ }
+ if (_vmap.count("help"))
+ return usage();
+ if (num_jrnls == 0)
+ {
+ std::cout << "ERROR: num-jrnls must be 1 or more." << std::endl;
+ return usage();
+ }
+ if (read_prob > 100) // read_prob is unsigned, so no need to check < 0
+ {
+ std::cout << "ERROR: read-prob must be between 0 and 100 inclusive." << std::endl;
+ return usage();
+ }
+ if (repeat_flag && keep_jrnls)
+ {
+ std::string resp;
+ std::cout << "WARNING: repeat and keep-jrnls: Monitor disk usage as test journals will"
+ " accumulate." << std::endl;
+ std::cout << "Continue? <y/n> ";
+ std::cin >> resp;
+ if (resp.size() == 1)
+ {
+ if (resp[0] != 'y' && resp[0] != 'Y')
+ return true;
+ }
+ else if (resp.size() == 3) // any combo of lower- and upper-case
+ {
+ if (resp[0] != 'y' && resp[0] != 'Y')
+ return true;
+ if (resp[1] != 'e' && resp[1] != 'E')
+ return true;
+ if (resp[2] != 's' && resp[2] != 'S')
+ return true;
+ }
+ else
+ return true;
+ }
+ return false;
+}
+
+bool
+args::usage() const
+{
+ std::cout << _options_descr << std::endl;
+ return true;
+}
+
+void
+args::print_args() const
+{
+ std::cout << "Number of journals: " << num_jrnls << std::endl;
+ std::cout << "Read mode: " << read_mode << std::endl;
+ if (read_mode.val() == read_arg::RANDOM)
+ std::cout << "Read probability: " << read_prob << " %" << std::endl;
+ if (read_mode.val() == read_arg::LAZYLOAD)
+ {
+ std::cout << "Lazy-load skips: " << lld_skip_num << std::endl;
+ std::cout << "Lazy-load reads: " << lld_rd_num << std::endl;
+ }
+ if (pause_secs)
+ std::cout << "Pause between test cases: " << pause_secs << " sec." << std::endl;
+ if (seed)
+ std::cout << "Randomize seed: " << seed << std::endl;
+ print_flags();
+}
+
+void
+args::print_flags() const
+{
+ if (format_chk || keep_jrnls || randomize || recover_mode || repeat_flag ||
+ reuse_instance)
+ {
+ std::cout << "Flag options:";
+ // TODO: Get flag args and their strings directly from _options_descr.
+ if (format_chk)
+ std::cout << " format-chk";
+ if (keep_jrnls)
+ std::cout << " keep-jrnls";
+ if (randomize)
+ std::cout << " randomize";
+ if (recover_mode)
+ std::cout << " recover-mode";
+ if (repeat_flag)
+ std::cout << " repeat-flag";
+ if (reuse_instance)
+ std::cout << " reuse-instance";
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.h
new file mode 100644
index 0000000000..b6f7fb4a79
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/args.h
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_args_hpp
+#define mrg_jtt_args_hpp
+
+#include <boost/program_options.hpp>
+#include "read_arg.h"
+
+namespace mrg
+{
+namespace jtt
+{
+
+ struct args
+ {
+ boost::program_options::options_description _options_descr;
+ boost::program_options::variables_map _vmap;
+
+ // Add args here
+ std::string jfile_analyzer;
+ std::string test_case_csv_file_name;
+ std::string journal_dir;
+ bool format_chk;
+ bool keep_jrnls;
+ unsigned lld_rd_num;
+ unsigned lld_skip_num;
+ unsigned num_jrnls;
+ unsigned pause_secs;
+ bool randomize;
+ read_arg read_mode;
+ unsigned read_prob;
+ bool recover_mode;
+ bool repeat_flag;
+ bool reuse_instance;
+ unsigned seed;
+
+ args(std::string opt_title);
+ bool parse(int argc, char** argv); // return true if error, false if ok
+ bool usage() const; // return true
+ void print_args() const;
+ void print_flags() const;
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_args_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.cpp
new file mode 100644
index 0000000000..3530e0b223
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.cpp
@@ -0,0 +1,87 @@
+/*
+ *
+ * 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 "data_src.h"
+
+#include <cstddef>
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+char data_src::_data_src[data_src::max_dsize];
+char data_src::_xid_src[data_src::max_xsize];
+bool data_src::_initialized = data_src::__init();
+u_int64_t data_src::_xid_cnt = 0ULL;
+mrg::journal::smutex data_src::_sm;
+
+data_src::data_src()
+{}
+
+bool
+data_src::__init()
+{
+ for (unsigned i=0; i<max_dsize; i++)
+ _data_src[i] = '0' + ((i + 1) % 10); // 123456789012345...
+ for (unsigned j=0; j<max_xsize; j++)
+ _xid_src[j] = 'a' + (j % 26); // abc...xyzabc...
+ return true;
+}
+
+const char*
+data_src::get_data(const std::size_t offs)
+{
+ if (offs >= max_dsize) return 0;
+ return _data_src + offs;
+}
+
+std::string
+data_src::get_xid(const std::size_t xid_size)
+{
+ if (xid_size == 0)
+ return "";
+ std::ostringstream oss;
+ oss << std::setfill('0');
+ if (xid_size < 9)
+ oss << std::setw(xid_size) << get_xid_cnt();
+ else if (xid_size < 13)
+ oss << "xid:" << std::setw(xid_size - 4) << get_xid_cnt();
+ else
+ {
+ oss << "xid:" << std::setw(8) << get_xid_cnt() << ":";
+ oss.write(get_xid_content(13), xid_size - 13);
+ }
+ return oss.str();
+}
+
+const char*
+data_src::get_xid_content(const std::size_t offs)
+{
+ if (offs >= max_xsize) return 0;
+ return _xid_src + offs;
+}
+
+} // namespace jtt
+} // namespace mrg
+
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.h
new file mode 100644
index 0000000000..66dc613787
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/data_src.h
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_data_src_hpp
+#define mrg_jtt_data_src_hpp
+
+#include <cstddef>
+#include "qpid/legacystore/jrnl/slock.h"
+#include "qpid/legacystore/jrnl/smutex.h"
+#include <pthread.h>
+#include <string>
+#include <sys/types.h>
+
+#define DATA_SIZE 1024 * 1024
+#define XID_SIZE 1024 * 1024
+
+namespace mrg
+{
+namespace jtt
+{
+ class data_src
+ {
+ public:
+ static const std::size_t max_dsize = DATA_SIZE;
+ static const std::size_t max_xsize = XID_SIZE;
+
+ private:
+ static char _data_src[];
+ static char _xid_src[];
+ static u_int64_t _xid_cnt;
+ static bool _initialized;
+ static mrg::journal::smutex _sm;
+
+ public:
+ static const char* get_data(const std::size_t offs);
+ static std::string get_xid(const std::size_t xid_size);
+
+ private:
+ data_src();
+ static u_int64_t get_xid_cnt() { mrg::journal::slock s(_sm); return _xid_cnt++; }
+ static const char* get_xid_content(const std::size_t offs);
+ static bool __init();
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_data_src_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jfile_chk.py b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jfile_chk.py
new file mode 100755
index 0000000000..36ef511f5c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jfile_chk.py
@@ -0,0 +1,838 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+import sys
+import getopt
+import string
+import xml.parsers.expat
+from struct import unpack, calcsize
+from time import gmtime, strftime
+
+dblk_size = 128
+sblk_size = 4 * dblk_size
+jfsize = None
+hdr_ver = 1
+
+TEST_NUM_COL = 0
+NUM_MSGS_COL = 5
+MIN_MSG_SIZE_COL = 7
+MAX_MSG_SIZE_COL = 8
+MIN_XID_SIZE_COL = 9
+MAX_XID_SIZE_COL = 10
+AUTO_DEQ_COL = 11
+TRANSIENT_COL = 12
+EXTERN_COL = 13
+COMMENT_COL = 20
+
+owi_mask = 0x01
+transient_mask = 0x10
+extern_mask = 0x20
+
+printchars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ '
+
+
+
+#== global functions ===========================================================
+
+def load(f, klass):
+ args = load_args(f, klass)
+ subclass = klass.discriminate(args)
+ result = subclass(*args)
+ if subclass != klass:
+ result.init(f, *load_args(f, subclass))
+ result.skip(f)
+ return result;
+
+def load_args(f, klass):
+ size = calcsize(klass.format)
+ foffs = f.tell(),
+ bin = f.read(size)
+ if len(bin) != size:
+ raise Exception("end of file")
+ return foffs + unpack(klass.format, bin)
+
+def size_blks(size, blk_size):
+ return (size + blk_size - 1)/blk_size
+
+def rem_in_blk(f, blk_size):
+ foffs = f.tell()
+ return (size_blks(f.tell(), blk_size) * blk_size) - foffs;
+
+def file_full(f):
+ return f.tell() >= jfsize
+
+def isprintable(s):
+ return s.strip(printchars) == ''
+
+def print_xid(xidsize, xid):
+ if xid == None:
+ if xidsize > 0:
+ raise Exception('Inconsistent XID size: xidsize=%d, xid=None' % xidsize)
+ return ''
+ if isprintable(xid):
+ xidstr = split_str(xid)
+ else:
+ xidstr = hex_split_str(xid)
+ if xidsize != len(xid):
+ raise Exception('Inconsistent XID size: xidsize=%d, xid(%d)=\"%s\"' % (xidsize, len(xid), xidstr))
+ return 'xid(%d)=\"%s\" ' % (xidsize, xidstr)
+
+def print_data(dsize, data):
+ if data == None:
+ return ''
+ if isprintable(data):
+ datastr = split_str(data)
+ else:
+ datastr = hex_split_str(data)
+ if dsize != len(data):
+ raise Exception('Inconsistent data size: dsize=%d, data(%d)=\"%s\"' % (dsize, len(data), datastr))
+ return 'data(%d)=\"%s\" ' % (dsize, datastr)
+
+def hex_split_str(s, split_size = 50):
+ if len(s) <= split_size:
+ return hex_str(s, 0, len(s))
+ if len(s) > split_size + 25:
+ return hex_str(s, 0, 10) + ' ... ' + hex_str(s, 55, 65) + ' ... ' + hex_str(s, len(s)-10, len(s))
+ return hex_str(s, 0, 10) + ' ... ' + hex_str(s, len(s)-10, len(s))
+
+def hex_str(s, b, e):
+ o = ''
+ for i in range(b, e):
+ if isprintable(s[i]):
+ o += s[i]
+ else:
+ o += '\\%02x' % ord(s[i])
+ return o
+
+def split_str(s, split_size = 50):
+ if len(s) < split_size:
+ return s
+ return s[:25] + ' ... ' + s[-25:]
+
+def inv_str(s):
+ si = ''
+ for i in range(0,len(s)):
+ si += chr(~ord(s[i]) & 0xff)
+ return si
+
+def load_file_data(f, size, data):
+ if size == 0:
+ return (data, True)
+ if data == None:
+ loaded = 0
+ else:
+ loaded = len(data)
+ foverflow = f.tell() + size - loaded > jfsize
+ if foverflow:
+ rsize = jfsize - f.tell()
+ else:
+ rsize = size - loaded
+ bin = f.read(rsize)
+ if data == None:
+ data = unpack('%ds' % (rsize), bin)[0]
+ else:
+ data = data + unpack('%ds' % (rsize), bin)[0]
+ return (data, not foverflow)
+
+def exit(code, qflag):
+ if code != 0 or not qflag:
+ print out.getvalue()
+ out.close()
+ sys.exit(code)
+
+#== class Sizeable =============================================================
+
+class Sizeable:
+
+ def size(self):
+ classes = [self.__class__]
+
+ size = 0
+ while classes:
+ cls = classes.pop()
+ if hasattr(cls, "format"):
+ size += calcsize(cls.format)
+ classes.extend(cls.__bases__)
+
+ return size
+
+
+#== class Hdr ==================================================================
+
+class Hdr(Sizeable):
+
+ format = '=4sBBHQ'
+
+ def discriminate(args):
+ return CLASSES.get(args[1][-1], Hdr)
+ discriminate = staticmethod(discriminate)
+
+ def __init__(self, foffs, magic, ver, end, flags, rid):
+ self.foffs = foffs
+ self.magic = magic
+ self.ver = ver
+ self.end = end
+ self.flags = flags
+ self.rid = rid
+ if self.magic[-1] not in ['0x00', 'a', 'c', 'd', 'e', 'f', 'x']:
+ error = 3
+
+ def __str__(self):
+ if self.empty():
+ return '0x%08x: <empty>' % (self.foffs)
+ if self.magic[-1] == 'x':
+ return '0x%08x: [\"%s\"]' % (self.foffs, self.magic)
+ if self.magic[-1] in ['a', 'c', 'd', 'e', 'f', 'x']:
+ return '0x%08x: [\"%s\" v=%d e=%d f=0x%04x rid=0x%x]' % (self.foffs, self.magic, self.ver, self.end, self.flags, self.rid)
+ return '0x%08x: <error, unknown magic \"%s\" (possible overwrite boundary?)>' % (self.foffs, self.magic)
+
+ def empty(self):
+ return self.magic == '\x00'*4
+
+ def owi(self):
+ return self.flags & owi_mask != 0
+
+ def skip(self, f):
+ f.read(rem_in_blk(f, dblk_size))
+
+ def check(self):
+ if self.empty() or self.magic[:3] != 'RHM' or self.magic[3] not in ['a', 'c', 'd', 'e', 'f', 'x']:
+ return True
+ if self.ver != hdr_ver and self.magic[-1] != 'x':
+ raise Exception('%s: Invalid header version: found %d, expected %d.' % (self, self.ver, hdr_ver))
+ return False
+
+
+#== class FileHdr ==============================================================
+
+class FileHdr(Hdr):
+
+ format = '=2H4x3Q'
+
+ def init(self, f, foffs, fid, lid, fro, time_sec, time_ns):
+ self.fid = fid
+ self.lid = lid
+ self.fro = fro
+ self.time_sec = time_sec
+ self.time_ns = time_ns
+
+ def __str__(self):
+ return '%s fid=%d lid=%d fro=0x%08x t=%s' % (Hdr.__str__(self), self.fid, self.lid, self.fro, self.timestamp_str())
+
+ def skip(self, f):
+ f.read(rem_in_blk(f, sblk_size))
+
+ def timestamp(self):
+ return (self.time_sec, self.time_ns)
+
+ def timestamp_str(self):
+ ts = gmtime(self.time_sec)
+ fstr = '%%a %%b %%d %%H:%%M:%%S.%09d %%Y' % (self.time_ns)
+ return strftime(fstr, ts)
+
+
+#== class DeqHdr ===============================================================
+
+class DeqHdr(Hdr):
+
+ format = '=QQ'
+
+ def init(self, f, foffs, deq_rid, xidsize):
+ self.deq_rid = deq_rid
+ self.xidsize = xidsize
+ self.xid = None
+ self.deq_tail = None
+ self.xid_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(f)
+
+ def load(self, f):
+ if self.xidsize == 0:
+ self.xid_complete = True
+ self.tail_complete = True
+ else:
+ if not self.xid_complete:
+ ret = load_file_data(f, self.xidsize, self.xid)
+ self.xid = ret[0]
+ self.xid_complete = ret[1]
+ if self.xid_complete and not self.tail_complete:
+ ret = load_file_data(f, calcsize(RecTail.format), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.enq_tail = RecTail(self.tail_offs, *unpack(RecTail.format, self.tail_bin))
+ if self.enq_tail.magic_inv != inv_str(self.magic) or self.enq_tail.rid != self.rid:
+ print " > %s" % self
+ raise Exception('Invalid dequeue record tail (magic=%s; rid=%d) at 0x%08x' % (self.enq_tail, self.enq_tail.rid, self.enq_tail.foffs))
+ self.enq_tail.skip(f)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ return self.xid_complete and self.tail_complete
+
+ def __str__(self):
+ return '%s %sdrid=0x%x' % (Hdr.__str__(self), print_xid(self.xidsize, self.xid), self.deq_rid)
+
+
+#== class TxnHdr ===============================================================
+
+class TxnHdr(Hdr):
+
+ format = '=Q'
+
+ def init(self, f, foffs, xidsize):
+ self.xidsize = xidsize
+ self.xid = None
+ self.tx_tail = None
+ self.xid_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(f)
+
+ def load(self, f):
+ if not self.xid_complete:
+ ret = load_file_data(f, self.xidsize, self.xid)
+ self.xid = ret[0]
+ self.xid_complete = ret[1]
+ if self.xid_complete and not self.tail_complete:
+ ret = load_file_data(f, calcsize(RecTail.format), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.enq_tail = RecTail(self.tail_offs, *unpack(RecTail.format, self.tail_bin))
+ if self.enq_tail.magic_inv != inv_str(self.magic) or self.enq_tail.rid != self.rid:
+ print " > %s" % self
+ raise Exception('Invalid transaction record tail (magic=%s; rid=%d) at 0x%08x' % (self.enq_tail, self.enq_tail.rid, self.enq_tail.foffs))
+ self.enq_tail.skip(f)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ return self.xid_complete and self.tail_complete
+
+ def __str__(self):
+ return '%s %s' % (Hdr.__str__(self), print_xid(self.xidsize, self.xid))
+
+
+#== class RecTail ==============================================================
+
+class RecTail(Sizeable):
+
+ format = '=4sQ'
+
+ def __init__(self, foffs, magic_inv, rid):
+ self.foffs = foffs
+ self.magic_inv = magic_inv
+ self.rid = rid
+
+ def __str__(self):
+ magic = inv_str(self.magic_inv)
+ return '[\"%s\" rid=0x%x]' % (magic, self.rid)
+
+ def skip(self, f):
+ f.read(rem_in_blk(f, dblk_size))
+
+
+#== class EnqRec ===============================================================
+
+class EnqRec(Hdr):
+
+ format = '=QQ'
+
+ def init(self, f, foffs, xidsize, dsize):
+ self.xidsize = xidsize
+ self.dsize = dsize
+ self.transient = self.flags & transient_mask > 0
+ self.extern = self.flags & extern_mask > 0
+ self.xid = None
+ self.data = None
+ self.enq_tail = None
+ self.xid_complete = False
+ self.data_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(f)
+
+ def load(self, f):
+ if not self.xid_complete:
+ ret = load_file_data(f, self.xidsize, self.xid)
+ self.xid = ret[0]
+ self.xid_complete = ret[1]
+ if self.xid_complete and not self.data_complete:
+ if self.extern:
+ self.data_complete = True
+ else:
+ ret = load_file_data(f, self.dsize, self.data)
+ self.data = ret[0]
+ self.data_complete = ret[1]
+ if self.data_complete and not self.tail_complete:
+ ret = load_file_data(f, calcsize(RecTail.format), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.enq_tail = RecTail(self.tail_offs, *unpack(RecTail.format, self.tail_bin))
+ if self.enq_tail.magic_inv != inv_str(self.magic) or self.enq_tail.rid != self.rid:
+ print " > %s" % self
+ raise Exception('Invalid enqueue record tail (magic=%s; rid=%d) at 0x%08x' % (self.enq_tail, self.enq_tail.rid, self.enq_tail.foffs))
+ self.enq_tail.skip(f)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ return self.xid_complete and self.data_complete and self.tail_complete
+
+ def print_flags(self):
+ s = ''
+ if self.transient:
+ s = '*TRANSIENT'
+ if self.extern:
+ if len(s) > 0:
+ s += ',EXTERNAL'
+ else:
+ s = '*EXTERNAL'
+ if len(s) > 0:
+ s += '*'
+ return s
+
+ def __str__(self):
+ return '%s %s%s %s %s' % (Hdr.__str__(self), print_xid(self.xidsize, self.xid), print_data(self.dsize, self.data), self.enq_tail, self.print_flags())
+
+
+#== class Main =================================================================
+
+class Main:
+ def __init__(self, argv):
+ self.bfn = None
+ self.csvfn = None
+ self.jdir = None
+ self.aflag = False
+ self.hflag = False
+ self.qflag = False
+ self.tnum = None
+ self.num_jfiles = None
+ self.num_msgs = None
+ self.msg_len = None
+ self.auto_deq = None
+ self.xid_len = None
+ self.transient = None
+ self.extern = None
+
+ self.file_start = 0
+ self.file_num = 0
+ self.fro = 0x200
+ self.emap = {}
+ self.tmap = {}
+ self.rec_cnt = 0
+ self.msg_cnt = 0
+ self.txn_msg_cnt = 0
+ self.fhdr = None
+ self.f = None
+ self.first_rec = False
+ self.last_file = False
+ self.last_rid = -1
+ self.fhdr_owi_at_msg_start = None
+
+ self.proc_args(argv)
+ self.proc_csv()
+ self.read_jinf()
+
+ def run(self):
+ try:
+ start_info = self.analyze_files()
+ stop = self.advance_file(*start_info)
+ except Exception:
+ print 'WARNING: All journal files are empty.'
+ if self.num_msgs > 0:
+ raise Exception('All journal files are empty, but %d msgs expectd.' % self.num_msgs)
+ else:
+ stop = True
+ while not stop:
+ warn = ''
+ if file_full(self.f):
+ stop = self.advance_file()
+ if stop:
+ break
+ hdr = load(self.f, Hdr)
+ if hdr.empty():
+ stop = True;
+ break
+ if hdr.check():
+ stop = True;
+ else:
+ self.rec_cnt += 1
+ self.fhdr_owi_at_msg_start = self.fhdr.owi()
+ if self.first_rec:
+ if self.fhdr.fro != hdr.foffs:
+ raise Exception('File header first record offset mismatch: fro=0x%08x; rec_offs=0x%08x' % (self.fhdr.fro, hdr.foffs))
+ else:
+ if not self.qflag: print ' * fro ok: 0x%08x' % self.fhdr.fro
+ self.first_rec = False
+ if isinstance(hdr, EnqRec) and not stop:
+ while not hdr.complete():
+ stop = self.advance_file()
+ if stop:
+ break
+ hdr.load(self.f)
+ if self.extern != None:
+ if hdr.extern:
+ if hdr.data != None:
+ raise Exception('Message data found on external record')
+ else:
+ if self.msg_len > 0 and len(hdr.data) != self.msg_len:
+ raise Exception('Message length (%d) incorrect; expected %d' % (len(hdr.data), self.msg_len))
+ else:
+ if self.msg_len > 0 and len(hdr.data) != self.msg_len:
+ raise Exception('Message length (%d) incorrect; expected %d' % (len(hdr.data), self.msg_len))
+ if self.xid_len > 0 and len(hdr.xid) != self.xid_len:
+ print ' ERROR: XID length (%d) incorrect; expected %d' % (len(hdr.xid), self.xid_len)
+ sys.exit(1)
+ #raise Exception('XID length (%d) incorrect; expected %d' % (len(hdr.xid), self.xid_len))
+ if self.transient != None:
+ if self.transient:
+ if not hdr.transient:
+ raise Exception('Expected transient record, found persistent')
+ else:
+ if hdr.transient:
+ raise Exception('Expected persistent record, found transient')
+ stop = not self.check_owi(hdr)
+ if stop:
+ warn = ' (WARNING: OWI mismatch - could be overwrite boundary.)'
+ else:
+ self.msg_cnt += 1
+ if self.aflag or self.auto_deq:
+ if hdr.xid == None:
+ self.emap[hdr.rid] = (self.fhdr.fid, hdr, False)
+ else:
+ self.txn_msg_cnt += 1
+ if hdr.xid in self.tmap:
+ self.tmap[hdr.xid].append((self.fhdr.fid, hdr)) #Append tuple to existing list
+ else:
+ self.tmap[hdr.xid] = [(self.fhdr.fid, hdr)] # Create new list
+ elif isinstance(hdr, DeqHdr) and not stop:
+ while not hdr.complete():
+ stop = self.advance_file()
+ if stop:
+ break
+ hdr.load(self.f)
+ stop = not self.check_owi(hdr)
+ if stop:
+ warn = ' (WARNING: OWI mismatch - could be overwrite boundary.)'
+ else:
+ if self.auto_deq != None:
+ if not self.auto_deq:
+ warn = ' WARNING: Dequeue record rid=%d found in non-dequeue test - ignoring.' % hdr.rid
+ if self.aflag or self.auto_deq:
+ if hdr.xid == None:
+ if hdr.deq_rid in self.emap:
+ if self.emap[hdr.deq_rid][2]:
+ warn = ' (WARNING: dequeue rid 0x%x dequeues locked enqueue record 0x%x)' % (hdr.rid, hdr.deq_rid)
+ del self.emap[hdr.deq_rid]
+ else:
+ warn = ' (WARNING: rid being dequeued 0x%x not found in enqueued records)' % hdr.deq_rid
+ else:
+ if hdr.deq_rid in self.emap:
+ t = self.emap[hdr.deq_rid]
+ self.emap[hdr.deq_rid] = (t[0], t[1], True) # Lock enq record
+ if hdr.xid in self.tmap:
+ self.tmap[hdr.xid].append((self.fhdr.fid, hdr)) #Append to existing list
+ else:
+ self.tmap[hdr.xid] = [(self.fhdr.fid, hdr)] # Create new list
+ elif isinstance(hdr, TxnHdr) and not stop:
+ while not hdr.complete():
+ stop = self.advance_file()
+ if stop:
+ break
+ hdr.load(self.f)
+ stop = not self.check_owi(hdr)
+ if stop:
+ warn = ' (WARNING: OWI mismatch - could be overwrite boundary.)'
+ else:
+ if hdr.xid in self.tmap:
+ mismatched_rids = []
+ if hdr.magic[-1] == 'c': # commit
+ for rec in self.tmap[hdr.xid]:
+ if isinstance(rec[1], EnqRec):
+ self.emap[rec[1].rid] = (rec[0], rec[1], False) # Transfer enq to emap
+ elif isinstance(rec[1], DeqHdr):
+ if rec[1].deq_rid in self.emap:
+ del self.emap[rec[1].deq_rid] # Delete from emap
+ else:
+ mismatched_rids.append('0x%x' % rec[1].deq_rid)
+ else:
+ raise Exception('Unknown header found in txn map: %s' % rec[1])
+ elif hdr.magic[-1] == 'a': # abort
+ for rec in self.tmap[hdr.xid]:
+ if isinstance(rec[1], DeqHdr):
+ if rec[1].deq_rid in self.emap:
+ t = self.emap[rec[1].deq_rid]
+ self.emap[rec[1].deq_rid] = (t[0], t[1], False) # Unlock enq record
+ del self.tmap[hdr.xid]
+ if len(mismatched_rids) > 0:
+ warn = ' (WARNING: transactional dequeues not found in enqueue map; rids=%s)' % mismatched_rids
+ else:
+ warn = ' (WARNING: %s not found in transaction map)' % print_xid(len(hdr.xid), hdr.xid)
+ if not self.qflag: print ' > %s%s' % (hdr, warn)
+ if not stop:
+ stop = (self.last_file and hdr.check()) or hdr.empty() or self.fhdr.empty()
+
+ def analyze_files(self):
+ fname = ''
+ fnum = -1
+ rid = -1
+ fro = -1
+ tss = ''
+ if not self.qflag: print 'Analyzing journal files:'
+ owi_found = False
+ for i in range(0, self.num_jfiles):
+ jfn = self.jdir + '/' + self.bfn + '.%04d.jdat' % i
+ f = open(jfn)
+ fhdr = load(f, Hdr)
+ if fhdr.empty():
+ if not self.qflag:
+ print ' %s: file empty' % jfn
+ break
+ if i == 0:
+ init_owi = fhdr.owi()
+ fname = jfn
+ fnum = i
+ rid = fhdr.rid
+ fro = fhdr.fro
+ tss = fhdr.timestamp_str()
+ elif fhdr.owi() != init_owi and not owi_found:
+ fname = jfn
+ fnum = i
+ rid = fhdr.rid
+ fro = fhdr.fro
+ tss = fhdr.timestamp_str()
+ owi_found = True
+ if not self.qflag:
+ print ' %s: owi=%s rid=0x%x, fro=0x%08x ts=%s' % (jfn, fhdr.owi(), fhdr.rid, fhdr.fro, fhdr.timestamp_str())
+ if fnum < 0 or rid < 0 or fro < 0:
+ raise Exception('All journal files empty')
+ if not self.qflag: print ' Oldest complete file: %s: rid=%d, fro=0x%08x ts=%s' % (fname, rid, fro, tss)
+ return (fnum, rid, fro)
+
+ def advance_file(self, *start_info):
+ seek_flag = False
+ if len(start_info) == 3:
+ self.file_start = self.file_num = start_info[0]
+ self.fro = start_info[2]
+ seek_flag = True
+ if self.f != None and file_full(self.f):
+ self.file_num = self.incr_fnum()
+ if self.file_num == self.file_start:
+ return True
+ if self.file_start == 0:
+ self.last_file = self.file_num == self.num_jfiles - 1
+ else:
+ self.last_file = self.file_num == self.file_start - 1
+ if self.file_num < 0 or self.file_num >= self.num_jfiles:
+ raise Exception('Bad file number %d' % self.file_num)
+ jfn = self.jdir + '/' + self.bfn + '.%04d.jdat' % self.file_num
+ self.f = open(jfn)
+ self.fhdr = load(self.f, Hdr)
+ if seek_flag and self.f.tell() != self.fro:
+ self.f.seek(self.fro)
+ self.first_rec = True
+ if not self.qflag: print jfn, ": ", self.fhdr
+ return False
+
+ def incr_fnum(self):
+ self.file_num += 1
+ if self.file_num >= self.num_jfiles:
+ self.file_num = 0;
+ return self.file_num
+
+ def check_owi(self, hdr):
+ return self.fhdr_owi_at_msg_start == hdr.owi()
+
+ def check_rid(self, hdr):
+ if self.last_rid != -1 and hdr.rid <= self.last_rid:
+ return False
+ self.last_rid = hdr.rid
+ return True
+
+ def read_jinf(self):
+ filename = self.jdir + '/' + self.bfn + '.jinf'
+ try:
+ f = open(filename, 'r')
+ except IOError:
+ print 'ERROR: Unable to open jinf file %s' % filename
+ sys.exit(1)
+ p = xml.parsers.expat.ParserCreate()
+ p.StartElementHandler = self.handleStartElement
+ p.CharacterDataHandler = self.handleCharData
+ p.EndElementHandler = self.handleEndElement
+ p.ParseFile(f)
+ if self.num_jfiles == None:
+ print 'ERROR: number_jrnl_files not found in jinf file "%s"!' % filename
+ if jfsize == None:
+ print 'ERROR: jrnl_file_size_sblks not found in jinf file "%s"!' % filename
+ if self.num_jfiles == None or jfsize == None:
+ sys.exit(1)
+
+ def handleStartElement(self, name, attrs):
+ global jfsize
+ if name == 'number_jrnl_files':
+ self.num_jfiles = int(attrs['value'])
+ if name == 'jrnl_file_size_sblks':
+ jfsize = (int(attrs['value']) + 1) * sblk_size
+
+ def handleCharData(self, data): pass
+
+ def handleEndElement(self, name): pass
+
+ def proc_csv(self):
+ if self.csvfn != None and self.tnum != None:
+ tparams = self.get_test(self.csvfn, self.tnum)
+ if tparams == None:
+ print 'ERROR: Test %d not found in CSV file "%s"' % (self.tnum, self.csvfn)
+ sys.exit(1)
+ self.num_msgs = tparams['num_msgs']
+ if tparams['min_size'] == tparams['max_size']:
+ self.msg_len = tparams['max_size']
+ else:
+ self.msg_len = 0
+ self.auto_deq = tparams['auto_deq']
+ if tparams['xid_min_size'] == tparams['xid_max_size']:
+ self.xid_len = tparams['xid_max_size']
+ else:
+ self.xid_len = 0
+ self.transient = tparams['transient']
+ self.extern = tparams['extern']
+
+ def get_test(self, filename, tnum):
+ try:
+ f=open(filename, 'r')
+ except IOError:
+ print 'ERROR: Unable to open CSV file "%s"' % filename
+ sys.exit(1)
+ for l in f:
+ sl = l.strip().split(',')
+ if len(sl[0]) > 0 and sl[0][0] != '"':
+ try:
+ if (int(sl[TEST_NUM_COL]) == tnum):
+ return { 'num_msgs':int(sl[NUM_MSGS_COL]),
+ 'min_size':int(sl[MIN_MSG_SIZE_COL]),
+ 'max_size':int(sl[MAX_MSG_SIZE_COL]),
+ 'auto_deq':not (sl[AUTO_DEQ_COL] == 'FALSE' or sl[AUTO_DEQ_COL] == '0'),
+ 'xid_min_size':int(sl[MIN_XID_SIZE_COL]),
+ 'xid_max_size':int(sl[MAX_XID_SIZE_COL]),
+ 'transient':not (sl[TRANSIENT_COL] == 'FALSE' or sl[TRANSIENT_COL] == '0'),
+ 'extern':not (sl[EXTERN_COL] == 'FALSE' or sl[EXTERN_COL] == '0'),
+ 'comment':sl[COMMENT_COL] }
+ except Exception:
+ pass
+ return None
+
+ def proc_args(self, argv):
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "ab:c:d:hqt:", ["analyse", "base-filename=", "csv-filename=", "dir=", "help", "quiet", "test-num="])
+ except getopt.GetoptError:
+ self.usage()
+ sys.exit(2)
+ for o, a in opts:
+ if o in ("-h", "--help"):
+ self.usage()
+ sys.exit()
+ if o in ("-a", "--analyze"):
+ self.aflag = True
+ if o in ("-b", "--base-filename"):
+ self.bfn = a
+ if o in ("-c", "--csv-filename"):
+ self.csvfn = a
+ if o in ("-d", "--dir"):
+ self.jdir = a
+ if o in ("-q", "--quiet"):
+ self.qflag = True
+ if o in ("-t", "--test-num"):
+ if not a.isdigit():
+ print 'ERROR: Illegal test-num argument. Must be a non-negative number'
+ sys.exit(2)
+ self.tnum = int(a)
+ if self.bfn == None or self.jdir == None:
+ print 'ERROR: Missing requred args.'
+ self.usage()
+ sys.exit(2)
+ if self.tnum != None and self.csvfn == None:
+ print 'ERROR: Test number specified, but not CSV file'
+ self.usage()
+ sys.exit(2)
+
+ def usage(self):
+ print 'Usage: %s opts' % sys.argv[0]
+ print ' where opts are in either short or long format (*=req\'d):'
+ print ' -a --analyze Analyze enqueue/dequeue records'
+ print ' -b --base-filename [string] * Base filename for journal files'
+ print ' -c --csv-filename [string] CSV filename containing test parameters'
+ print ' -d --dir [string] * Journal directory containing journal files'
+ print ' -h --help Print help'
+ print ' -q --quiet Quiet (reduced output)'
+ print ' -t --test-num [int] Test number from CSV file - only valid if CSV file named'
+
+ def report(self):
+ if not self.qflag:
+ print
+ print ' === REPORT ===='
+ if self.num_msgs > 0 and self.msg_cnt != self.num_msgs:
+ print 'WARNING: Found %d messages; %d expected.' % (self.msg_cnt, self.num_msgs)
+ if len(self.emap) > 0:
+ print
+ print 'Remaining enqueued records (sorted by rid): '
+ keys = sorted(self.emap.keys())
+ for k in keys:
+ if self.emap[k][2] == True: # locked
+ locked = ' (locked)'
+ else:
+ locked = ''
+ print " fid=%d %s%s" % (self.emap[k][0], self.emap[k][1], locked)
+ print 'WARNING: Enqueue-Dequeue mismatch, %d enqueued records remain.' % len(self.emap)
+ if len(self.tmap) > 0:
+ txn_rec_cnt = 0
+ print
+ print 'Remaining transactions: '
+ for t in self.tmap:
+ print_xid(len(t), t)
+ for r in self.tmap[t]:
+ print " fid=%d %s" % (r[0], r[1])
+ print " Total: %d records for xid %s" % (len(self.tmap[t]), t)
+ txn_rec_cnt += len(self.tmap[t])
+ print 'WARNING: Incomplete transactions, %d xids remain containing %d records.' % (len(self.tmap), txn_rec_cnt)
+ print '%d enqueues, %d journal records processed.' % (self.msg_cnt, self.rec_cnt)
+
+
+#===============================================================================
+
+CLASSES = {
+ "a": TxnHdr,
+ "c": TxnHdr,
+ "d": DeqHdr,
+ "e": EnqRec,
+ "f": FileHdr
+}
+
+m = Main(sys.argv)
+m.run()
+m.report()
+
+sys.exit(None)
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.cpp
new file mode 100644
index 0000000000..1bc04110af
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.cpp
@@ -0,0 +1,77 @@
+/*
+ *
+ * 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 "jrnl_init_params.h"
+
+namespace mrg
+{
+namespace jtt
+{
+
+jrnl_init_params::jrnl_init_params(const std::string& jid, const std::string& jdir, const std::string& base_filename,
+ const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t jfsize_sblks,
+ const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks):
+ _jid(jid),
+ _jdir(jdir),
+ _base_filename(base_filename),
+ _num_jfiles(num_jfiles),
+ _ae(ae),
+ _ae_max_jfiles(ae_max_jfiles),
+ _jfsize_sblks(jfsize_sblks),
+ _wcache_num_pages(wcache_num_pages),
+ _wcache_pgsize_sblks(wcache_pgsize_sblks)
+{}
+
+jrnl_init_params::jrnl_init_params(const jrnl_init_params& jp):
+ _jid(jp._jid),
+ _jdir(jp._jdir),
+ _base_filename(jp._base_filename),
+ _num_jfiles(jp._num_jfiles),
+ _ae(jp._ae),
+ _ae_max_jfiles(jp._ae_max_jfiles),
+ _jfsize_sblks(jp._jfsize_sblks),
+ _wcache_num_pages(jp._wcache_num_pages),
+ _wcache_pgsize_sblks(jp._wcache_pgsize_sblks)
+{}
+
+jrnl_init_params::jrnl_init_params(const jrnl_init_params* const jp_ptr):
+ _jid(jp_ptr->_jid),
+ _jdir(jp_ptr->_jdir),
+ _base_filename(jp_ptr->_base_filename),
+ _num_jfiles(jp_ptr->_num_jfiles),
+ _ae(jp_ptr->_ae),
+ _ae_max_jfiles(jp_ptr->_ae_max_jfiles),
+ _jfsize_sblks(jp_ptr->_jfsize_sblks),
+ _wcache_num_pages(jp_ptr->_wcache_num_pages),
+ _wcache_pgsize_sblks(jp_ptr->_wcache_pgsize_sblks)
+{}
+
+// static initializers
+
+const u_int16_t jrnl_init_params::def_num_jfiles = 8;
+const bool jrnl_init_params::def_ae = false;
+const u_int16_t jrnl_init_params::def_ae_max_jfiles = 0;
+const u_int32_t jrnl_init_params::def_jfsize_sblks = 0xc00;
+const u_int16_t jrnl_init_params::def_wcache_num_pages = 32;
+const u_int32_t jrnl_init_params::def_wcache_pgsize_sblks = 64;
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.h
new file mode 100644
index 0000000000..ece87f8e03
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_init_params.h
@@ -0,0 +1,80 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_jrnl_init_params_hpp
+#define mrg_jtt_jrnl_init_params_hpp
+
+#include <boost/shared_ptr.hpp>
+#include <string>
+#include <sys/types.h>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class jrnl_init_params
+ {
+ public:
+ static const u_int16_t def_num_jfiles;
+ static const bool def_ae;
+ static const u_int16_t def_ae_max_jfiles;
+ static const u_int32_t def_jfsize_sblks;
+ static const u_int16_t def_wcache_num_pages;
+ static const u_int32_t def_wcache_pgsize_sblks;
+
+ typedef boost::shared_ptr<jrnl_init_params> shared_ptr;
+
+ private:
+ std::string _jid;
+ std::string _jdir;
+ std::string _base_filename;
+ u_int16_t _num_jfiles;
+ bool _ae;
+ u_int16_t _ae_max_jfiles;
+ u_int32_t _jfsize_sblks;
+ u_int16_t _wcache_num_pages;
+ u_int32_t _wcache_pgsize_sblks;
+
+ public:
+ jrnl_init_params(const std::string& jid, const std::string& jdir, const std::string& base_filename,
+ const u_int16_t num_jfiles = def_num_jfiles, const bool ae = def_ae,
+ const u_int16_t ae_max_jfiles = def_ae_max_jfiles, const u_int32_t jfsize_sblks = def_jfsize_sblks,
+ const u_int16_t wcache_num_pages = def_wcache_num_pages,
+ const u_int32_t wcache_pgsize_sblks = def_wcache_pgsize_sblks);
+ jrnl_init_params(const jrnl_init_params& jp);
+ jrnl_init_params(const jrnl_init_params* const jp_ptr);
+
+ inline const std::string& jid() const { return _jid; }
+ inline const std::string& jdir() const { return _jdir; }
+ inline const std::string& base_filename() const { return _base_filename; }
+ inline u_int16_t num_jfiles() const { return _num_jfiles; }
+ inline bool is_ae() const { return _ae; }
+ inline u_int16_t ae_max_jfiles() const { return _ae_max_jfiles; }
+ inline u_int32_t jfsize_sblks() const { return _jfsize_sblks; }
+ inline u_int16_t wcache_num_pages() const { return _wcache_num_pages; }
+ inline u_int32_t wcache_pgsize_sblks() const { return _wcache_pgsize_sblks; }
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_jrnl_init_params_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.cpp
new file mode 100644
index 0000000000..339dc1b52c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.cpp
@@ -0,0 +1,439 @@
+/*
+ *
+ * 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 "jrnl_instance.h"
+
+#include <cstdlib>
+#include "data_src.h"
+#include "qpid/legacystore/jrnl/data_tok.h"
+#include "qpid/legacystore/jrnl/jerrno.h"
+#include "test_case_result.h"
+
+#define MAX_WR_WAIT 10 // in ms
+#define MAX_RD_WAIT 100 // in ms
+#define MAX_ENQCAPTHRESH_CNT 1000 // 10s if MAX_WR_WAIT is 10 ms
+
+namespace mrg
+{
+namespace jtt
+{
+
+jrnl_instance::jrnl_instance(const std::string& jid, const std::string& jdir, const std::string& base_filename,
+ const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t jfsize_sblks,
+ const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks):
+ mrg::journal::jcntl(jid, jdir, base_filename),
+ _jpp(new jrnl_init_params(jid, jdir, base_filename, num_jfiles, ae, ae_max_jfiles, jfsize_sblks,
+ wcache_num_pages, wcache_pgsize_sblks)),
+ _args_ptr(0),
+ _dtok_master_enq_list(),
+ _dtok_master_txn_list(),
+ _dtok_rd_list(),
+ _dtok_deq_list(),
+ _rd_aio_cv(_rd_aio_mutex),
+ _wr_full_cv(_wr_full_mutex),
+ _rd_list_cv(_rd_list_mutex),
+ _deq_list_cv(_deq_list_mutex),
+ _tcp(),
+ _tcrp()
+{}
+
+jrnl_instance::jrnl_instance(const jrnl_init_params::shared_ptr& p):
+ mrg::journal::jcntl(p->jid(), p->jdir(), p->base_filename()),
+ _jpp(p),
+ _args_ptr(0),
+ _dtok_master_enq_list(),
+ _dtok_master_txn_list(),
+ _dtok_rd_list(),
+ _dtok_deq_list(),
+ _rd_aio_cv(_rd_aio_mutex),
+ _wr_full_cv(_wr_full_mutex),
+ _rd_list_cv(_rd_list_mutex),
+ _deq_list_cv(_deq_list_mutex),
+ _tcp(),
+ _tcrp()
+{}
+
+jrnl_instance::~jrnl_instance() {}
+
+
+void
+jrnl_instance::init_tc(test_case::shared_ptr& tcp, const args* const args_ptr) throw ()
+{
+ test_case_result::shared_ptr p(new test_case_result(_jpp->jid()));
+ _tcrp = p;
+ _args_ptr = args_ptr;
+ try
+ {
+ _tcp = tcp;
+ _dtok_master_enq_list.clear();
+ _dtok_master_txn_list.clear();
+ _dtok_rd_list.clear();
+ _dtok_deq_list.clear();
+
+ if (_args_ptr->recover_mode)
+ {
+ try
+ {
+ u_int64_t highest_rid;
+ recover(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this,
+ 0, highest_rid);
+ recover_complete();
+ }
+ catch (const mrg::journal::jexception& e)
+ {
+ if (e.err_code() == mrg::journal::jerrno::JERR_JDIR_STAT)
+ initialize(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this);
+ else
+ throw;
+ }
+ }
+ else
+ initialize(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this);
+ }
+ catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); }
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); }
+}
+
+void
+jrnl_instance::run_tc() throw ()
+{
+ _tcrp->set_start_time();
+ ::pthread_create(&_enq_thread, 0, run_enq, this);
+ ::pthread_create(&_read_thread, 0, run_read, this);
+ ::pthread_create(&_deq_thread, 0, run_deq, this);
+}
+
+void
+jrnl_instance::tc_wait_compl() throw ()
+{
+ try
+ {
+ ::pthread_join(_deq_thread, 0);
+ ::pthread_join(_read_thread, 0);
+ ::pthread_join(_enq_thread, 0);
+ stop(true);
+ }
+ catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); panic(); }
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
+ _lpmgr.finalize();
+ _tcrp->set_stop_time();
+ _tcp->add_result(_tcrp);
+}
+
+void
+jrnl_instance::run_enq() throw ()
+{
+ try
+ {
+ unsigned sleep_cnt = 0U;
+ while(_tcrp->num_enq() < _tcp->num_msgs() && !_tcrp->exception())
+ {
+ dtok_ptr p(new mrg::journal::data_tok);
+ _dtok_master_enq_list.push_back(p);
+ const char* msgp = data_src::get_data(_tcrp->num_enq() % 10);
+ const std::size_t msg_size = _tcp->this_data_size();
+ const std::size_t xid_size = _tcp->this_xid_size();
+ const std::string xid(data_src::get_xid(xid_size));
+ const bool external = _tcp->this_external();
+ const bool transient = _tcp->this_transience();
+ mrg::journal::iores res;
+ if (xid_size)
+ {
+ if (external)
+ res = enqueue_extern_txn_data_record(msg_size, p.get(), xid, transient);
+ else
+ res = enqueue_txn_data_record(msgp, msg_size, msg_size, p.get(), xid,
+ transient);
+ }
+ else
+ {
+ if (external)
+ res = enqueue_extern_data_record(msg_size, p.get(), transient);
+ else
+ res = enqueue_data_record(msgp, msg_size, msg_size, p.get(), transient);
+ }
+ switch (res)
+ {
+ case mrg::journal::RHM_IORES_SUCCESS:
+ sleep_cnt = 0U;
+ _tcrp->incr_num_enq();
+ if (p->has_xid() && !_tcp->auto_deq())
+ commit(p.get());
+ break;
+ case mrg::journal::RHM_IORES_ENQCAPTHRESH:
+ if (++sleep_cnt > MAX_ENQCAPTHRESH_CNT)
+ {
+ _tcrp->add_exception("Timeout waiting for RHM_IORES_ENQCAPTHRESH to clear.");
+ panic();
+ }
+ else if (get_wr_events(0) == 0) // *** GEV2
+ {
+ mrg::journal::slock sl(_wr_full_mutex);
+ _wr_full_cv.waitintvl(MAX_WR_WAIT * 1000000); // MAX_WR_WAIT in ms
+ }
+ break;
+ default:
+ std::ostringstream oss;
+ oss << "ERROR: enqueue operation in journal \"" << _jid << "\" returned ";
+ oss << mrg::journal::iores_str(res) << ".";
+ _tcrp->add_exception(oss.str());
+ }
+ }
+ flush(true);
+ }
+ catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); panic(); }
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
+}
+
+void
+jrnl_instance::run_read() throw ()
+{
+ try
+ {
+ read_arg::read_mode_t rd_mode = _args_ptr->read_mode.val();
+ if (rd_mode != read_arg::NONE)
+ {
+ while (_tcrp->num_rproc() < _tcp->num_msgs() && !_tcrp->exception())
+ {
+ journal::data_tok* dtokp = 0;
+ {
+ mrg::journal::slock sl(_rd_list_mutex);
+ if (_dtok_rd_list.empty())
+ _rd_list_cv.wait();
+ if (!_dtok_rd_list.empty())
+ {
+ dtokp = _dtok_rd_list.front();
+ _dtok_rd_list.pop_front();
+ }
+ }
+ if (dtokp)
+ {
+ _tcrp->incr_num_rproc();
+
+ bool do_read = true;
+ if (rd_mode == read_arg::RANDOM)
+ do_read = 1.0 * std::rand() / RAND_MAX < _args_ptr->read_prob / 100.0;
+ else if (rd_mode == read_arg::LAZYLOAD)
+ do_read = _tcrp->num_rproc() >= _args_ptr->lld_skip_num &&
+ _tcrp->num_read() < _args_ptr->lld_rd_num;
+ bool read_compl = false;
+ while (do_read && !read_compl && !_tcrp->exception())
+ {
+ void* dptr = 0;
+ std::size_t dsize = 0;
+ void* xptr = 0;
+ std::size_t xsize = 0;
+ bool tr = false;
+ bool ext = false;
+ mrg::journal::iores res = read_data_record(&dptr, dsize, &xptr, xsize, tr,
+ ext, dtokp);
+ switch (res)
+ {
+ case mrg::journal::RHM_IORES_SUCCESS:
+ {
+ mrg::journal::slock sl(_deq_list_mutex);
+ _dtok_deq_list.push_back(dtokp);
+ _deq_list_cv.broadcast();
+ }
+ read_compl = true;
+ _tcrp->incr_num_read();
+
+ // clean up
+ if (xsize)
+ std::free(xptr);
+ else if (dsize)
+ std::free(dptr);
+ dptr = 0;
+ xptr = 0;
+ break;
+ case mrg::journal::RHM_IORES_PAGE_AIOWAIT:
+ if (get_rd_events(0) == 0)
+ {
+ mrg::journal::slock sl(_rd_aio_mutex);
+ _rd_aio_cv.waitintvl(MAX_RD_WAIT * 1000000); // MAX_RD_WAIT in ms
+ }
+ break;
+ default:
+ std::ostringstream oss;
+ oss << "ERROR: read operation in journal \"" << _jid;
+ oss << "\" returned " << mrg::journal::iores_str(res) << ".";
+ _tcrp->add_exception(oss.str());
+ {
+ mrg::journal::slock sl(_deq_list_mutex);
+ _deq_list_cv.broadcast(); // wake up deq thread
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); panic(); }
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
+}
+
+void
+jrnl_instance::run_deq() throw ()
+{
+ try
+ {
+ if (_tcp->auto_deq())
+ {
+ while(_tcrp->num_deq() < _tcp->num_msgs() && !_tcrp->exception())
+ {
+ journal::data_tok* dtokp = 0;
+ {
+ mrg::journal::slock sl(_deq_list_mutex);
+ if (_dtok_deq_list.empty())
+ _deq_list_cv.wait();
+ if (!_dtok_deq_list.empty())
+ {
+ dtokp = _dtok_deq_list.front();
+ _dtok_deq_list.pop_front();
+ }
+ }
+ if (dtokp)
+ {
+ mrg::journal::iores res;
+ if (dtokp->has_xid())
+ res = dequeue_txn_data_record(dtokp, dtokp->xid());
+ else
+ res = dequeue_data_record(dtokp);
+ if (res == mrg::journal::RHM_IORES_SUCCESS)
+ {
+ _tcrp->incr_num_deq();
+ commit(dtokp);
+ }
+ else
+ {
+ std::ostringstream oss;
+ oss << "ERROR: dequeue operation in journal \"" << _jid;
+ oss << "\" returned " << mrg::journal::iores_str(res) << ".";
+ _tcrp->add_exception(oss.str());
+ }
+ }
+ }
+ flush(true);
+ }
+ }
+ catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); panic(); }
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
+}
+
+void
+jrnl_instance::abort(const mrg::journal::data_tok* dtokp)
+{
+ txn(dtokp, false);
+}
+
+void
+jrnl_instance::commit(const mrg::journal::data_tok* dtokp)
+{
+ txn(dtokp, true);
+}
+
+void
+jrnl_instance::txn(const mrg::journal::data_tok* dtokp, const bool commit)
+{
+ if (dtokp->has_xid())
+ {
+ mrg::journal::data_tok* p = prep_txn_dtok(dtokp);
+ mrg::journal::iores res = commit ? txn_commit(p, p->xid()) : txn_abort(p, p->xid());
+ if (res != mrg::journal::RHM_IORES_SUCCESS)
+ {
+ std::ostringstream oss;
+ oss << "ERROR: " << (commit ? "commit" : "abort") << " operation in journal \"";
+ oss << _jid << "\" returned " << mrg::journal::iores_str(res) << ".";
+ _tcrp->add_exception(oss.str());
+ }
+ }
+}
+
+mrg::journal::data_tok*
+jrnl_instance::prep_txn_dtok(const mrg::journal::data_tok* dtokp)
+{
+ dtok_ptr p(new mrg::journal::data_tok);
+ _dtok_master_txn_list.push_back(p);
+ p->set_xid(dtokp->xid());
+ return p.get();
+}
+
+void
+jrnl_instance::panic()
+{
+ // In the event of a panic or exception condition, release all waiting CVs
+ _rd_aio_cv.broadcast();
+ _wr_full_cv.broadcast();
+ _rd_list_cv.broadcast();
+ _deq_list_cv.broadcast();
+}
+
+// AIO callbacks
+
+void
+jrnl_instance::wr_aio_cb(std::vector<journal::data_tok*>& dtokl)
+{
+ for (std::vector<journal::data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
+ {
+ if ((*i)->wstate() == journal::data_tok::ENQ || (*i)->wstate() == journal::data_tok::DEQ)
+ {
+ journal::data_tok* dtokp = *i;
+ if (dtokp->wstate() == journal::data_tok::ENQ)
+ {
+ if (_args_ptr->read_mode.val() == read_arg::NONE)
+ {
+ mrg::journal::slock sl(_deq_list_mutex);
+ _dtok_deq_list.push_back(dtokp);
+ _deq_list_cv.broadcast();
+ }
+ else
+ {
+ mrg::journal::slock sl(_rd_list_mutex);
+ _dtok_rd_list.push_back(dtokp);
+ _rd_list_cv.broadcast();
+ }
+ }
+ else // DEQ
+ {
+ mrg::journal::slock sl(_wr_full_mutex);
+ _wr_full_cv.broadcast();
+ }
+ }
+ }
+}
+
+void
+jrnl_instance::rd_aio_cb(std::vector<u_int16_t>& /*pil*/)
+{
+ mrg::journal::slock sl(_rd_aio_mutex);
+ _rd_aio_cv.broadcast();
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.h
new file mode 100644
index 0000000000..5003f39b24
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jrnl_instance.h
@@ -0,0 +1,121 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_jrnl_instance_hpp
+#define mrg_jtt_jrnl_instance_hpp
+
+#include "args.h"
+#include "jrnl_init_params.h"
+#include "test_case.h"
+
+#include <boost/shared_ptr.hpp>
+#include "qpid/legacystore/jrnl/cvar.h"
+#include "qpid/legacystore/jrnl/data_tok.h"
+#include "qpid/legacystore/jrnl/jcntl.h"
+#include "qpid/legacystore/jrnl/slock.h"
+#include "qpid/legacystore/jrnl/smutex.h"
+#include <list>
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class jrnl_instance : public mrg::journal::jcntl, public virtual mrg::journal::aio_callback
+ {
+ public:
+ typedef boost::shared_ptr<jrnl_instance> shared_ptr;
+ typedef boost::shared_ptr<journal::data_tok> dtok_ptr;
+
+ private:
+ jrnl_init_params::shared_ptr _jpp;
+ const args* _args_ptr;
+ std::vector<dtok_ptr> _dtok_master_enq_list;
+ std::vector<dtok_ptr> _dtok_master_txn_list;
+ std::list<journal::data_tok*> _dtok_rd_list;
+ std::list<journal::data_tok*> _dtok_deq_list;
+ mrg::journal::smutex _rd_aio_mutex; ///< Mutex for read aio wait conditions
+ mrg::journal::cvar _rd_aio_cv; ///< Condition var for read aio wait conditions
+ mrg::journal::smutex _wr_full_mutex; ///< Mutex for write full conditions
+ mrg::journal::cvar _wr_full_cv; ///< Condition var for write full conditions
+ mrg::journal::smutex _rd_list_mutex; ///< Mutex for _dtok_rd_list
+ mrg::journal::cvar _rd_list_cv; ///< Condition var for _dtok_rd_list
+ mrg::journal::smutex _deq_list_mutex; ///< Mutex for _dtok_deq_list
+ mrg::journal::cvar _deq_list_cv; ///< Condition var for _dtok_deq_list
+ pthread_t _enq_thread;
+ pthread_t _deq_thread;
+ pthread_t _read_thread;
+ test_case::shared_ptr _tcp;
+ test_case_result::shared_ptr _tcrp;
+
+ public:
+ jrnl_instance(const std::string& jid, const std::string& jdir,
+ const std::string& base_filename,
+ const u_int16_t num_jfiles = jrnl_init_params::def_num_jfiles,
+ const bool ae = jrnl_init_params::def_ae,
+ const u_int16_t ae_max_jfiles = jrnl_init_params::def_ae_max_jfiles,
+ const u_int32_t jfsize_sblks = jrnl_init_params::def_jfsize_sblks,
+ const u_int16_t wcache_num_pages = jrnl_init_params::def_wcache_num_pages,
+ const u_int32_t wcache_pgsize_sblks = jrnl_init_params::def_wcache_pgsize_sblks);
+ jrnl_instance(const jrnl_init_params::shared_ptr& params);
+ virtual ~jrnl_instance();
+
+ inline const jrnl_init_params::shared_ptr& params() const { return _jpp; }
+ inline const std::string& jid() const { return _jpp->jid(); }
+
+ void init_tc(test_case::shared_ptr& tcp, const args* const args_ptr) throw ();
+ void run_tc() throw ();
+ void tc_wait_compl() throw ();
+
+ // AIO callbacks
+ virtual void wr_aio_cb(std::vector<journal::data_tok*>& dtokl);
+ virtual void rd_aio_cb(std::vector<u_int16_t>& pil);
+
+ private:
+ void run_enq() throw ();
+ inline static void* run_enq(void* p)
+ { static_cast<jrnl_instance*>(p)->run_enq(); return 0; }
+
+ void run_read() throw ();
+ inline static void* run_read(void* p)
+ { static_cast<jrnl_instance*>(p)->run_read(); return 0; }
+
+ void run_deq() throw ();
+ inline static void* run_deq(void* p)
+ { static_cast<jrnl_instance*>(p)->run_deq(); return 0; }
+
+ void abort(const mrg::journal::data_tok* dtokp);
+ void commit(const mrg::journal::data_tok* dtokp);
+ void txn(const mrg::journal::data_tok* dtokp, const bool commit);
+ mrg::journal::data_tok* prep_txn_dtok(const mrg::journal::data_tok* dtokp);
+
+ void panic();
+
+// // static callbacks
+// static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
+// static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_jrnl_instance_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv
new file mode 100644
index 0000000000..df523e3f97
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv
@@ -0,0 +1,234 @@
+#
+# 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.
+#
+
+,,,,,,,"Msg size",,"Xid size",,,,,"enq-size",,"deq-size",,"txn-size",,
+"Test #","tf","pf","amn","mn incr","#msgs","ms incr","Min","Max","Min","Max","auto-deq","transient","extern","bytes","dblks","bytes","dblks","bytes","dblks","comment"
+,,,,,,,,,,,,,,,,,,,,
+"Initialize only",,,,,,,,,,,,,,,,,,,,
+0,"L",0,0,0,0,0,0,0,0,0,FALSE,FALSE,FALSE,44,1,0,0,0,0,"No messages - journal creation/initialization only"
+,,,,,,,,,,,,,,,,,,,,
+"Simple message combinations of persistent/deq transientueued/non-dequeued, transactional/non-transactional",,,,,,,,,,,,,,,,,,,,
+1,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"1 * 10-byte message"
+2,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"10 * 10-byte message"
+3,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"1 * 10-byte message [transient]"
+4,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"10 * 10-byte message [transient]"
+5,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn]"
+6,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn]"
+7,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn transient]"
+8,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn transient]"
+9,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq]"
+10,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq]"
+11,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq transient]"
+12,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq transient]"
+13,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [deq txn]"
+14,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [deq txn]"
+15,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient]"
+16,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient]"
+17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [extern]"
+18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [extern]"
+19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [transient extern]"
+20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [transient extern]"
+21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn extern]"
+22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn extern]"
+23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn transient extern]"
+24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn transient extern]"
+25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq extern]"
+26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq extern]"
+27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq transient extern]"
+28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq transient extern]"
+29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [deq txn extern]"
+30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [deq txn extern]"
+31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]"
+32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from one d-block to two per message",,,,,,,,,,,,,,,,,,,,
+33,"L",1,10,0,10,0,84,84,0,0,FALSE,FALSE,FALSE,128,1,0,0,0,0,"1 dblk exact fit"
+34,"L",1,10,0,10,1,85,85,0,0,FALSE,FALSE,FALSE,129,2,0,0,0,0,"1 dblk + 1 byte"
+35,"L",1,10,0,10,0,58,58,26,26,FALSE,FALSE,FALSE,128,1,0,0,0,0,"1 dblk exact fit [txn]"
+36,"L",1,10,0,10,1,59,59,26,26,FALSE,FALSE,FALSE,129,2,0,0,0,0,"1 dblk + 1 byte [txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from one s-block to two per message",,,,,,,,,,,,,,,,,,,,
+37,"L",1,10,0,10,0,468,468,0,0,FALSE,FALSE,FALSE,512,4,0,0,0,0,"1 sblk exact fit"
+38,"L",1,10,0,10,1,469,469,0,0,FALSE,FALSE,FALSE,513,5,0,0,0,0,"1 sblk + 1 byte"
+39,"L",1,10,0,10,0,442,442,26,26,FALSE,FALSE,FALSE,512,4,0,0,0,0,"1 sblk exact fit [txn]"
+40,"L",1,10,0,10,1,443,443,26,26,FALSE,FALSE,FALSE,513,5,0,0,0,0,"1 sblk + 1 byte [txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from first page to second",,,,,,,,,,,,,,,,,,,,
+41,"L",1,8,0,8,0,4052,4052,0,0,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page"
+42,"L",1,8,1,9,0,4052,4052,0,0,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page"
+43,"L",1,8,0,8,1,4053,4053,0,0,FALSE,FALSE,FALSE,4097,33,0,0,0,0,"1/8 page + 1 byte"
+44,"L",1,8,0,8,0,3796,3796,256,256,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page [txn]"
+45,"L",1,8,1,9,0,3796,3796,256,256,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page [txn]"
+46,"L",1,8,0,8,1,3797,3797,256,256,FALSE,FALSE,FALSE,4097,33,0,0,0,0,"1/8 page + 1 byte [txn]"
+47,"L",1,8,0,8,0,3924,3924,0,0,TRUE,FALSE,FALSE,3968,31,32,1,0,0,"1/8 page incl deq [deq]"
+48,"L",1,8,1,9,0,3924,3924,0,0,TRUE,FALSE,FALSE,3968,31,32,1,0,0,"1/8 page incl deq [deq]"
+49,"L",1,8,0,8,1,3925,3925,0,0,TRUE,FALSE,FALSE,3969,32,32,1,0,0,"1/8 page incl deq + 1 byte [deq]"
+50,"L",1,8,0,8,0,3028,3028,256,256,TRUE,FALSE,FALSE,3328,26,300,3,292,3,"1/8 page incl deq & txn [deq txn]"
+51,"L",1,8,1,9,0,3028,3028,256,256,TRUE,FALSE,FALSE,3328,26,300,3,292,3,"1/8 page incl deq & txn [deq txn]"
+52,"L",1,8,0,8,1,3029,3029,256,256,TRUE,FALSE,FALSE,3329,27,300,3,292,3,"1/8 page incl deq & txn + 1 byte [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Page cache rollover (from page 32 back to page 0)",,,,,,,,,,,,,,,,,,,,
+53,"L",1,32,0,32,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+54,"L",1,32,1,33,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+55,"L",1,32,0,32,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte"
+56,"L",1.5,22,0,22,0,49108,49108,0,0,FALSE,FALSE,FALSE,49152,384,0,0,0,0,"1.5 pages"
+57,"L",1,32,0,32,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+58,"L",1,32,1,33,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+59,"L",1,32,0,32,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte [txn]"
+60,"L",1.5,22,0,22,0,48852,48852,256,256,FALSE,FALSE,FALSE,49152,384,0,0,0,0,"1.5 pages [txn]"
+61,"L",1,32,0,32,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+62,"L",1,32,1,33,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+63,"L",1,32,0,32,1,32597,32597,0,0,TRUE,FALSE,FALSE,32641,256,32,1,0,0,"1 page incl deq + 1 byte [deq]"
+64,"L",1.5,22,0,22,0,48980,48980,0,0,TRUE,FALSE,FALSE,49024,383,32,1,0,0,"1.5 pages incl deq [deq]"
+65,"L",1,32,0,32,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+66,"L",1,32,1,33,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+67,"L",1,32,0,32,1,31701,31701,256,256,TRUE,FALSE,FALSE,32001,251,300,3,292,3,"1 page incl deq & txn + 1 byte [deq txn]"
+68,"L",1.5,22,0,22,0,48084,48084,256,256,TRUE,FALSE,FALSE,48384,378,300,3,292,3,"1.5 pages incl deq & txn [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"File transition (from file 0000 to 0001)",,,,,,,,,,,,,,,,,,,,
+69,"L",1,48,0,48,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+70,"L",1,48,1,49,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+71,"L",1,48,0,48,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte"
+72,"L",2.5,20,0,20,0,81876,81876,0,0,FALSE,FALSE,FALSE,81920,640,0,0,0,0,"2.5 pages"
+73,"L",1,48,0,48,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+74,"L",1,48,1,49,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+75,"L",1,48,0,48,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte [txn]"
+76,"L",2.5,20,0,20,0,81620,81620,256,256,FALSE,FALSE,FALSE,81920,640,0,0,0,0,"2.5 pages [txn]"
+77,"L",1,48,0,48,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+78,"L",1,48,1,49,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+79,"L",1,48,0,48,1,32597,32597,0,0,TRUE,FALSE,FALSE,32641,256,32,1,0,0,"1 page incl deq + 1 byte [deq]"
+80,"L",2.5,20,0,20,0,81748,81748,0,0,TRUE,FALSE,FALSE,81792,639,32,1,0,0,"2.5 pages incl deq [deq]"
+81,"L",1,48,0,48,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+82,"L",1,48,1,49,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+83,"L",1,48,0,48,1,31701,31701,256,256,TRUE,FALSE,FALSE,32001,251,300,3,292,3,"1 page incl deq & txn + 1 byte [deq txn]"
+84,"L",2.5,20,0,20,0,80852,80852,256,256,TRUE,FALSE,FALSE,81152,634,300,3,292,3,"2.5 pages incl deq & txn [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"File rollover (from file 0007 to 0000) - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,,
+85,"L",0.5,16,0,16,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+86,"L",0.5,16,1,17,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+87,"L",0.5,16,0,16,1,786261,786261,0,0,TRUE,FALSE,FALSE,786305,6144,32,1,0,0,"24 pages incl deq + 1 byte [deq]"
+88,"L",0.5,16,0,16,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+89,"L",0.5,16,1,17,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+90,"L",0.5,16,0,16,1,785365,785365,256,256,TRUE,FALSE,FALSE,785665,6139,300,3,292,3,"24 pages incl deq & txn + 1 byte [deq txn]"
+91,"L",0.25,32,0,32,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+92,"L",0.25,32,1,33,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+93,"L",0.25,32,0,32,1,786261,786261,0,0,TRUE,FALSE,FALSE,786305,6144,32,1,0,0,"24 pages incl deq + 1 byte [deq]"
+94,"L",0.25,32,0,32,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+95,"L",0.25,32,1,33,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+96,"L",0.25,32,0,32,1,785365,785365,256,256,TRUE,FALSE,FALSE,785665,6139,300,3,292,3,"24 pages incl deq & txn + 1 byte [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Multi-page messages (large messages) - tests various paths in encoder.",,,,,,,,,,,,,,,,,,,,
+97,"L",1,16,0,16,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"data 1 page"
+98,"L",1,16,0,16,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"data 1 page + 1 byte (tail split; 1 byte over page boundary)"
+99,"L",1,16,0,16,11,32735,32735,0,0,FALSE,FALSE,FALSE,32779,257,0,0,0,0,"data 1 page + 11 bytes (tail split; 11 bytes over page boundary)"
+100,"L",1,16,0,16,12,32736,32736,0,0,FALSE,FALSE,FALSE,32780,257,0,0,0,0,"data 1 page + 12 bytes (tail separated exactly onto next page)"
+101,"L",1,16,0,16,13,32737,32737,0,0,FALSE,FALSE,FALSE,32781,257,0,0,0,0,"data 1 page + 13 bytes (data split; 1 byte over page boundary)"
+102,"L",1,16,0,16,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"data 1 page [txn]"
+103,"L",1,16,0,16,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"data 1 page + 1 byte (tail split; 1 byte over page boundary) [txn]"
+104,"L",1,16,0,16,11,32479,32479,256,256,FALSE,FALSE,FALSE,32779,257,0,0,0,0,"data 1 page + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+105,"L",1,16,0,16,12,32480,32480,256,256,FALSE,FALSE,FALSE,32780,257,0,0,0,0,"data 1 page + 12 bytes (tail separated exactly onto next page) [txn]"
+106,"L",1,16,0,16,13,32481,32481,256,256,FALSE,FALSE,FALSE,32781,257,0,0,0,0,"data 1 page + 13 bytes (data split; 1 byte over page boundary) [txn]"
+107,"L",2,16,0,16,0,65492,65492,0,0,FALSE,FALSE,FALSE,65536,512,0,0,0,0,"data 2 pages"
+108,"L",2,16,0,16,1,65493,65493,0,0,FALSE,FALSE,FALSE,65537,513,0,0,0,0,"data 2 pages + 1 byte (tail split; 1 byte over page boundary)"
+109,"L",2,16,0,16,11,65503,65503,0,0,FALSE,FALSE,FALSE,65547,513,0,0,0,0,"data 2 pages + 11 bytes (tail split; 11 bytes over page boundary)"
+110,"L",2,16,0,16,12,65504,65504,0,0,FALSE,FALSE,FALSE,65548,513,0,0,0,0,"data 2 pages + 12 bytes (tail separated exactly onto next page)"
+111,"L",2,16,0,16,13,65505,65505,0,0,FALSE,FALSE,FALSE,65549,513,0,0,0,0,"data 2 pages + 13 bytes (data split; 1 byte over page boundary)"
+112,"L",2,16,0,16,0,65236,65236,256,256,FALSE,FALSE,FALSE,65536,512,0,0,0,0,"data 2 pages [txn]"
+113,"L",2,16,0,16,1,65237,65237,256,256,FALSE,FALSE,FALSE,65537,513,0,0,0,0,"data 2 pages + 1 byte (tail split; 1 byte over page boundary) [txn]"
+114,"L",2,16,0,16,11,65247,65247,256,256,FALSE,FALSE,FALSE,65547,513,0,0,0,0,"data 2 pages + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+115,"L",2,16,0,16,12,65248,65248,256,256,FALSE,FALSE,FALSE,65548,513,0,0,0,0,"data 2 pages + 12 bytes (tail separated exactly onto next page) [txn]"
+116,"L",2,16,0,16,13,65249,65249,256,256,FALSE,FALSE,FALSE,65549,513,0,0,0,0,"data 2 pages + 13 bytes (data split; 1 byte over page boundary) [txn]"
+117,"L",4,16,0,16,0,131028,131028,0,0,FALSE,FALSE,FALSE,131072,1024,0,0,0,0,"data 4 pages"
+118,"L",4,16,0,16,1,131029,131029,0,0,FALSE,FALSE,FALSE,131073,1025,0,0,0,0,"data 4 pages + 1 byte (tail split; 1 byte over page boundary)"
+119,"L",4,16,0,16,11,131039,131039,0,0,FALSE,FALSE,FALSE,131083,1025,0,0,0,0,"data 4 pages + 11 bytes (tail split; 11 bytes over page boundary)"
+120,"L",4,16,0,16,12,131040,131040,0,0,FALSE,FALSE,FALSE,131084,1025,0,0,0,0,"data 4 pages + 12 bytes (tail separated exactly onto next page)"
+121,"L",4,16,0,16,13,131041,131041,0,0,FALSE,FALSE,FALSE,131085,1025,0,0,0,0,"data 4 pages + 13 bytes (data split; 1 byte over page boundary)"
+122,"L",4,16,0,16,0,130772,130772,256,256,FALSE,FALSE,FALSE,131072,1024,0,0,0,0,"data 4 pages [txn]"
+123,"L",4,16,0,16,1,130773,130773,256,256,FALSE,FALSE,FALSE,131073,1025,0,0,0,0,"data 4 pages + 1 byte (tail split; 1 byte over page boundary) [txn]"
+124,"L",4,16,0,16,11,130783,130783,256,256,FALSE,FALSE,FALSE,131083,1025,0,0,0,0,"data 4 pages + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+125,"L",4,16,0,16,12,130784,130784,256,256,FALSE,FALSE,FALSE,131084,1025,0,0,0,0,"data 4 pages + 12 bytes (tail separated exactly onto next page) [txn]"
+126,"L",4,16,0,16,13,130785,130785,256,256,FALSE,FALSE,FALSE,131085,1025,0,0,0,0,"data 4 pages + 13 bytes (data split; 1 byte over page boundary) [txn]"
+127,"L",3.5,16,0,16,0,114644,114644,0,0,FALSE,FALSE,FALSE,114688,896,0,0,0,0,"data 3.5 pages"
+128,"L",3.5,16,0,16,1,114645,114645,0,0,FALSE,FALSE,FALSE,114689,897,0,0,0,0,"data 3.5 pages + 1 byte"
+129,"L",3.5,16,0,16,0,114388,114388,256,256,FALSE,FALSE,FALSE,114688,896,0,0,0,0,"data 3.5 pages [txn]"
+130,"L",3.5,16,0,16,1,114389,114389,256,256,FALSE,FALSE,FALSE,114689,897,0,0,0,0,"data 3.5 pages + 1 byte [txn]"
+131,"L",1,16,0,16,-1,10,10,32735,32735,FALSE,FALSE,FALSE,32789,257,0,0,0,0,"xid 1 page – 1 byte; data 10 bytes (exact fit) [txn]"
+132,"L",1,16,0,16,0,10,10,32736,32736,FALSE,FALSE,FALSE,32790,257,0,0,0,0,"xid 1 page; data 10 bytes (exact fit) [txn]"
+133,"L",1,16,0,16,1,10,10,32737,32737,FALSE,FALSE,FALSE,32791,257,0,0,0,0,"xid 1 page + 1 byte; data 10 bytes (exact fit) [txn]"
+134,"L",2,16,0,16,-1,10,10,65503,65503,FALSE,FALSE,FALSE,65557,513,0,0,0,0,"xid 2 pages – 1 byte; data 10 bytes (exact fit) [txn]"
+135,"L",2,16,0,16,0,10,10,65504,65504,FALSE,FALSE,FALSE,65558,513,0,0,0,0,"xid 2 pages; data 10 bytes (exact fit) [txn]"
+136,"L",2,16,0,16,1,10,10,65505,65505,FALSE,FALSE,FALSE,65559,513,0,0,0,0,"xid 2 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+137,"L",4,16,0,16,-1,10,10,131039,131039,FALSE,FALSE,FALSE,131093,1025,0,0,0,0,"xid 4 pages – 1 byte; data 10 bytes (exact fit) [txn]"
+138,"L",4,16,0,16,0,10,10,131040,131040,FALSE,FALSE,FALSE,131094,1025,0,0,0,0,"xid 4 pages; data 10 bytes (exact fit) [txn]"
+139,"L",4,16,0,16,1,10,10,131041,131041,FALSE,FALSE,FALSE,131095,1025,0,0,0,0,"xid 4 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+140,"L",3.5,16,0,16,0,10,10,114656,114656,FALSE,FALSE,FALSE,114710,897,0,0,0,0,"xid 3.5 pages; data 10 bytes (exact fit) [txn]"
+141,"L",3.5,16,0,16,1,10,10,114657,114657,FALSE,FALSE,FALSE,114711,897,0,0,0,0,"xid 3.5 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+142,"L",1,16,0,16,-1,10,10,32735,32735,TRUE,FALSE,FALSE,32789,257,32779,257,32771,257,"xid 1 page – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+143,"L",1,16,0,16,0,10,10,32736,32736,TRUE,FALSE,FALSE,32790,257,32780,257,32772,257,"xid 1 page for enq rec; data 10 bytes (exact fit) [deq, txn]"
+144,"L",1,16,0,16,1,10,10,32737,32737,TRUE,FALSE,FALSE,32791,257,32781,257,32773,257,"xid 1 page + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+145,"L",2,16,0,16,-1,10,10,65503,65503,TRUE,FALSE,FALSE,65557,513,65547,513,65539,513,"xid 2 pages – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+146,"L",2,16,0,16,0,10,10,65504,65504,TRUE,FALSE,FALSE,65558,513,65548,513,65540,513,"xid 2 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+147,"L",2,16,0,16,1,10,10,65505,65505,TRUE,FALSE,FALSE,65559,513,65549,513,65541,513,"xid 2 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+148,"L",4,16,0,16,-1,10,10,131039,131039,TRUE,FALSE,FALSE,131093,1025,131083,1025,131075,1025,"xid 4 pages – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+149,"L",4,16,0,16,0,10,10,131040,131040,TRUE,FALSE,FALSE,131094,1025,131084,1025,131076,1025,"xid 4 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+150,"L",4,16,0,16,1,10,10,131041,131041,TRUE,FALSE,FALSE,131095,1025,131085,1025,131077,1025,"xid 4 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+151,"L",3.5,16,0,16,0,10,10,114656,114656,TRUE,FALSE,FALSE,114710,897,114700,897,114692,897,"xid 3.5 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+152,"L",3.5,16,0,16,1,10,10,114657,114657,TRUE,FALSE,FALSE,114711,897,114701,897,114693,897,"xid 3.5 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+153,"L",1,16,0,16,-1,10,10,32735,32735,TRUE,FALSE,FALSE,32789,257,32779,257,32771,257,"xid 1 page – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+154,"L",1,16,0,16,0,10,10,32736,32736,TRUE,FALSE,FALSE,32790,257,32780,257,32772,257,"xid 1 page for deq rec; data 10 bytes (exact fit) [deq, txn]"
+155,"L",1,16,0,16,1,10,10,32737,32737,TRUE,FALSE,FALSE,32791,257,32781,257,32773,257,"xid 1 page + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+156,"L",2,16,0,16,-1,10,10,65503,65503,TRUE,FALSE,FALSE,65557,513,65547,513,65539,513,"xid 2 pages – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+157,"L",2,16,0,16,0,10,10,65504,65504,TRUE,FALSE,FALSE,65558,513,65548,513,65540,513,"xid 2 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+158,"L",2,16,0,16,1,10,10,65505,65505,TRUE,FALSE,FALSE,65559,513,65549,513,65541,513,"xid 2 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+159,"L",4,16,0,16,-1,10,10,131039,131039,TRUE,FALSE,FALSE,131093,1025,131083,1025,131075,1025,"xid 4 pages – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+160,"L",4,16,0,16,0,10,10,131040,131040,TRUE,FALSE,FALSE,131094,1025,131084,1025,131076,1025,"xid 4 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+161,"L",4,16,0,16,1,10,10,131041,131041,TRUE,FALSE,FALSE,131095,1025,131085,1025,131077,1025,"xid 4 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+162,"L",3.5,16,0,16,0,10,10,114656,114656,TRUE,FALSE,FALSE,114710,897,114700,897,114692,897,"xid 3.5 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+163,"L",3.5,16,0,16,1,10,10,114657,114657,TRUE,FALSE,FALSE,114711,897,114701,897,114693,897,"xid 3.5 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+164,"L",1,16,0,16,-1,10,10,32743,32743,TRUE,FALSE,FALSE,32797,257,32787,257,32779,257,"xid 1 page – 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+165,"L",1,16,0,16,0,10,10,32744,32744,TRUE,FALSE,FALSE,32798,257,32788,257,32780,257,"xid 1 page for txn rec; data 10 bytes (exact fit) [deq, txn]"
+166,"L",1,16,0,16,1,10,10,32745,32745,TRUE,FALSE,FALSE,32799,257,32789,257,32781,257,"xid 1 page + 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+167,"L",2,16,0,16,-1,10,10,65511,65511,TRUE,FALSE,FALSE,65565,513,65555,513,65547,513,"xid 2 pages – 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+168,"L",2,16,0,16,0,10,10,65512,65512,TRUE,FALSE,FALSE,65566,513,65556,513,65548,513,"xid 2 pages for txn rec; data 10 bytes (exact fit) [deq, txn]"
+169,"L",2,16,0,16,1,10,10,65513,65513,TRUE,FALSE,FALSE,65567,513,65557,513,65549,513,"xid 2 pages + 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+170,"L",4,16,0,16,-1,10,10,131047,131047,TRUE,FALSE,FALSE,131101,1025,131091,1025,131083,1025,"xid 4 pages – 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+171,"L",4,16,0,16,0,10,10,131048,131048,TRUE,FALSE,FALSE,131102,1025,131092,1025,131084,1025,"xid 4 pages for txn rec; data 10 bytes (exact fit) [deq, txn]"
+172,"L",4,16,0,16,1,10,10,131049,131049,TRUE,FALSE,FALSE,131103,1025,131093,1025,131085,1025,"xid 4 pages + 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+173,"L",3.5,16,0,16,0,10,10,114664,114664,TRUE,FALSE,FALSE,114718,897,114708,897,114700,897,"xid 3.5 pages for txn rec; data 10 bytes (exact fit) [deq, txn]"
+174,"L",3.5,16,0,16,1,10,10,114665,114665,TRUE,FALSE,FALSE,114719,897,114709,897,114701,897,"xid 3.5 pages + 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+,,,,,,,,,,,,,,,,,,,,
+"High volume tests of random message lengths - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,,
+#175,"M",1,5000000,0,5000000,0,0,84,0,0,TRUE,FALSE,FALSE,128,1,32,1,0,0,"1 dblk max [deq]"
+#176,"M",3,3000000,0,3000000,0,0,340,0,0,TRUE,FALSE,FALSE,384,3,32,1,0,0,"3 dblks max [deq]"
+#177,"M",10,1600000,0,1600000,0,0,1236,0,0,TRUE,FALSE,FALSE,1280,10,32,1,0,0,"10 dblks max [deq]"
+#178,"M",30,600000,0,600000,0,0,3796,0,0,TRUE,FALSE,FALSE,3840,30,32,1,0,0,"30 dblks max [deq]"
+#179,"M",100,200000,0,200000,0,0,12756,0,0,TRUE,FALSE,FALSE,12800,100,32,1,0,0,"100 dblks max [deq]"
+#180,"M",300,60000,0,60000,0,0,38356,0,0,TRUE,FALSE,FALSE,38400,300,32,1,0,0,"300 dblks max [deq]"
+#181,"M",1000,20000,0,20000,0,0,127956,0,0,TRUE,FALSE,FALSE,128000,1000,32,1,0,0,"1000 dblks max [deq]"
+#182,"M",1,5000000,0,5000000,0,0,100,1,100,TRUE,FALSE,FALSE,244,2,144,2,136,2,"100 bytes xid max + 100 bytes data max [deq txn]"
+#183,"M",3,3000000,0,3000000,0,0,300,1,300,TRUE,FALSE,FALSE,644,6,344,3,336,3,"300 bytes xid max + 300 bytes data max [deq txn]"
+#184,"M",10,1600000,0,1600000,0,0,1000,1,1000,TRUE,FALSE,FALSE,2044,16,1044,9,1036,9,"1000 bytes xid max + 1000 bytes data max [deq txn]"
+#185,"M",30,600000,0,600000,0,0,3000,1,3000,TRUE,FALSE,FALSE,6044,48,3044,24,3036,24,"3000 bytes xid max + 3000 bytes data max [deq txn]"
+#186,"M",100,200000,0,200000,0,0,10000,1,10000,TRUE,FALSE,FALSE,20044,157,10044,79,10036,79,"10000 bytes xid max + 10000 bytes data max [deq txn]"
+#187,"M",300,60000,0,60000,0,0,30000,1,30000,TRUE,FALSE,FALSE,60044,470,30044,235,30036,235,"30000 bytes xid max + 30000 bytes data max [deq txn]"
+#188,"M",1000,20000,0,20000,0,0,100000,1,100000,TRUE,FALSE,FALSE,200044,1563,100044,782,100036,782,"100000 bytes xid max + 100000 bytes data max [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=212b (2 dblks)",,,,,,,,,,,,,,,,,,,,
+#189,"M",1,10000000,0,10000000,0,212,212,0,0,TRUE,FALSE,FALSE,256,2,32,1,0,0,"212 bytes data (2 dblks enq + 1 dblk deq)"
+#190,"M",1,10000000,0,10000000,0,148,148,64,64,TRUE,FALSE,FALSE,256,2,108,1,100,1,"148 bytes data + 64 bytes xid (2 dblks enq + 1 dblks deq + 1 dblks txn)"
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp
new file mode 100644
index 0000000000..c8a4642b1c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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 "test_mgr.h"
+
+#include "args.h"
+#include <csignal>
+#include <iostream>
+
+#define PACKAGE_NAME "Journal Test Tool"
+#define VERSION "0.1"
+
+namespace po = boost::program_options;
+
+int main(int argc, char** argv)
+{
+ std::signal(SIGINT, mrg::jtt::test_mgr::signal_handler);
+ std::signal(SIGTERM, mrg::jtt::test_mgr::signal_handler);
+
+ std::cout << PACKAGE_NAME << " v." << VERSION << std::endl;
+
+ std::ostringstream oss;
+ oss << PACKAGE_NAME << " options";
+ mrg::jtt::args args(oss.str());
+ if (args.parse(argc, argv)) return 1;
+
+ try
+ {
+ mrg::jtt::test_mgr tm(args);
+ tm.run();
+ if (tm.error()) return 2; // One or more tests threw exceptions
+ }
+ catch (const std::exception& e)
+ {
+ std::cerr << e.what() << std::endl;
+ return 3;
+ }
+ return 0;
+}
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp
new file mode 100644
index 0000000000..94a07c7005
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp
@@ -0,0 +1,93 @@
+/*
+ *
+ * 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 "read_arg.h"
+
+#include <cassert>
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+namespace mrg
+{
+namespace jtt
+{
+std::map<std::string, read_arg::read_mode_t> read_arg::_map;
+std::string read_arg::_description;
+const bool read_arg::init = __init();
+
+// static init fn
+bool
+read_arg::__init()
+{
+ // Set string versions of each enum option here
+ _map["NONE"] = NONE;
+ _map["ALL"] = ALL;
+ _map["RANDOM"] = RANDOM;
+ _map["LAZYLOAD"] = LAZYLOAD;
+ _description = "Determines if and when messages will be read prior to dequeueing. "
+ "Values: (NONE | ALL | RANDOM | LAZYLOAD)";
+ return true;
+}
+
+void
+read_arg::parse(const std::string& str)
+{
+ std::map<std::string, read_arg::read_mode_t>::const_iterator i = _map.find(str);
+ if (i == _map.end())
+ throw po::invalid_option_value(str);
+ _rm = i->second;
+}
+
+// static fn
+const std::string&
+read_arg::str(const read_mode_t rm)
+{
+ std::map<std::string, read_mode_t>::const_iterator i = _map.begin();
+ while (i->second != rm && i != _map.end()) i++;
+ assert(i != _map.end());
+ return i->first;
+}
+
+// static fn
+const std::string&
+read_arg::descr()
+{
+ return _description;
+}
+
+std::ostream&
+operator<<(std::ostream& os, const read_arg& ra)
+{
+ os << ra.str();
+ return os;
+}
+
+std::istream&
+operator>>(std::istream& is, read_arg& ra)
+{
+ std::string s;
+ is >> s;
+ ra.parse(s);
+ return is;
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h
new file mode 100644
index 0000000000..a8fd6f198e
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_read_arg_hpp
+#define mrg_jtt_read_arg_hpp
+
+#include <string>
+#include <map>
+
+namespace mrg
+{
+namespace jtt
+{
+
+class read_arg
+{
+ public:
+ enum read_mode_t { NONE, ALL, RANDOM, LAZYLOAD};
+ private:
+ static std::map<std::string, read_mode_t> _map;
+ static std::string _description;
+ static const bool init;
+ static bool __init();
+ read_mode_t _rm;
+ public:
+ inline read_arg() : _rm(NONE) {}
+ inline read_arg(read_mode_t rm) : _rm(rm) {}
+
+ inline read_mode_t val() const { return _rm; }
+ inline void set_val(const read_mode_t rm) { _rm = rm; }
+ void parse(const std::string& str);
+
+ inline const std::string& str() const { return str(_rm); }
+ static const std::string& str(const read_mode_t rm);
+ static const std::string& descr();
+
+ friend std::ostream& operator<<(std::ostream& os, const read_arg& ra);
+ friend std::istream& operator>>(std::istream& is, read_arg& ra);
+};
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_read_arg_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp
new file mode 100644
index 0000000000..e06e053504
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp
@@ -0,0 +1,179 @@
+/*
+ *
+ * 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 "test_case.h"
+
+#include <cstdlib>
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case::test_case(const unsigned test_case_num, const u_int32_t num_msgs,
+ const std::size_t min_data_size, const std::size_t max_data_size, const bool auto_deq,
+ const std::size_t min_xid_size, const std::size_t max_xid_size, const transient_t transient,
+ const external_t external, const std::string& comment):
+ _test_case_num(test_case_num),
+ _num_msgs(num_msgs),
+ _min_data_size(min_data_size),
+ _max_data_size(max_data_size),
+ _auto_dequeue(auto_deq),
+ _min_xid_size(min_xid_size),
+ _max_xid_size(max_xid_size),
+ _transient(transient),
+ _external(external),
+ _comment(comment),
+ _result_average(),
+ _result_jmap()
+{}
+
+test_case::~test_case()
+{}
+
+std::size_t
+test_case::this_data_size() const
+{
+ if (_min_data_size == _max_data_size)
+ return _max_data_size;
+ std::size_t size_diff = _max_data_size - _min_data_size;
+ return _min_data_size + std::size_t(1.0 * std::rand() * size_diff/(RAND_MAX + 1.0));
+}
+
+std::size_t
+test_case::this_xid_size() const
+{
+ // TODO: rework when probabilities are introduced. Assume 50% if _min_xid_size = 0
+ if (_max_xid_size == 0)
+ return std::size_t(0);
+ if (_min_xid_size == 0)
+ {
+ if (1.0 * std::rand() / RAND_MAX < 0.5)
+ return std::size_t(0);
+ }
+ std::size_t size_diff = _max_xid_size - _min_xid_size;
+ return _min_xid_size + std::size_t(1.0 * std::rand() * size_diff/(RAND_MAX + 1.0));
+}
+
+bool
+test_case::this_transience() const
+{
+ // TODO: rework when probabilities are introduced. Assume 50% if JTT_RANDOM
+ if (_transient == JTT_TRANSIENT)
+ return false;
+ if (_transient == JTT_PERSISTNET)
+ return true;
+ return 1.0 * std::rand() / RAND_MAX < 0.5;
+}
+
+bool
+test_case::this_external() const
+{
+ // TODO: rework when probabilities are introduced. Assume 50% if JDL_RANDOM
+ if (_external == JDL_INTERNAL)
+ return false;
+ if (_external == JDL_EXTERNAL)
+ return true;
+ return 1.0 * std::rand() / RAND_MAX < 0.5;
+}
+
+void
+test_case::add_result(test_case_result::shared_ptr& tcrp)
+{
+ _result_average.add_test_result(tcrp);
+ res_map_citr ari = _result_jmap.find(tcrp->jid());
+ if (ari == _result_jmap.end())
+ {
+ test_case_result_agregation::shared_ptr p(new test_case_result_agregation(tcrp->jid()));
+ p->add_test_result(tcrp);
+ _result_jmap.insert(res_map_pair(tcrp->jid(), p));
+ }
+ else
+ ari->second->add_test_result(tcrp);
+}
+
+void
+test_case::set_fmt_chk_res(const bool res, const std::string& jid)
+{
+ _result_average.set_fmt_chk_res(res);
+ res_map_citr ari = _result_jmap.find(jid);
+ if (ari != _result_jmap.end())
+ ari->second->set_fmt_chk_res(res);
+}
+
+const test_case_result::shared_ptr
+test_case::jmap_last(std::string& jid) const
+{
+ res_map_citr i = _result_jmap.find(jid);
+ if (i == _result_jmap.end())
+ return test_case_result::shared_ptr();
+ u_int32_t num_res = (*i).second->num_results();
+ if (num_res)
+ return (*(*i).second)[num_res - 1];
+ return test_case_result::shared_ptr();
+}
+
+void
+test_case::clear()
+{
+ _result_average.clear();
+ _result_jmap.clear();
+}
+
+const std::string
+test_case::str() const
+{
+ std::ostringstream oss;
+ oss << "Test Parameters: Test case no. " << _test_case_num << ":" << std::endl;
+ oss << " Comment: " << _comment << std::endl;
+ oss << " Number of messages: " << _num_msgs << std::endl;
+ oss << " Data size: " << _min_data_size;
+ if (_min_data_size == _max_data_size)
+ oss << " bytes (fixed)" << std::endl;
+ else
+ oss << " - " << _max_data_size << " bytes" << std::endl;
+ oss << " XID size: " << _min_xid_size;
+ if (_min_xid_size == _max_xid_size)
+ oss << " bytes (fixed)" << std::endl;
+ else
+ oss << " - " << _max_xid_size << " bytes" << std::endl;
+ oss << " Auto-dequeue: " << (_auto_dequeue ? "true" : "false") << std::endl;
+ oss << " Persistence: ";
+ switch (_transient)
+ {
+ case JTT_TRANSIENT: oss << "TRANSIENT" << std::endl; break;
+ case JTT_PERSISTNET: oss << "PERSISTNET" << std::endl; break;
+ case JTT_RANDOM: oss << "RANDOM" << std::endl; break;
+ }
+ oss << " Message Data: ";
+ switch (_external)
+ {
+ case JDL_INTERNAL: oss << "INTERNAL"; break;
+ case JDL_EXTERNAL: oss << "EXTERNAL"; break;
+ case JDL_RANDOM: oss << "RANDOM"; break;
+ }
+ return oss.str();
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h
new file mode 100644
index 0000000000..f72dd05f0c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h
@@ -0,0 +1,110 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_hpp
+#define mrg_jtt_test_case_hpp
+
+#include <boost/shared_ptr.hpp>
+#include <cstddef>
+#include <map>
+#include "test_case_result.h"
+#include "test_case_result_agregation.h"
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class test_case
+ {
+ public:
+ enum transient_type { JTT_TRANSIENT = 0, JTT_PERSISTNET, JTT_RANDOM };
+ typedef transient_type transient_t;
+
+ enum data_location { JDL_INTERNAL = 0, JDL_EXTERNAL, JDL_RANDOM };
+ typedef data_location external_t;
+
+ typedef boost::shared_ptr<test_case> shared_ptr;
+
+ typedef std::map<std::string, test_case_result_agregation::shared_ptr> res_map;
+ typedef std::pair<std::string, test_case_result_agregation::shared_ptr> res_map_pair;
+ typedef res_map::const_iterator res_map_citr;
+
+ private:
+ unsigned _test_case_num;
+ u_int32_t _num_msgs;
+ std::size_t _min_data_size;
+ std::size_t _max_data_size;
+ bool _auto_dequeue;
+ // TODO: add probability of transaction to these params
+ std::size_t _min_xid_size;
+ std::size_t _max_xid_size;
+ // TODO: change these enums (transient_t & external_t) to probabilities
+ transient_t _transient;
+ external_t _external;
+ std::string _comment;
+
+ test_case_result_agregation _result_average; // overall average result
+ res_map _result_jmap; // map of per-journal averages
+
+ public:
+ test_case(const unsigned test_case_num, const u_int32_t num_msgs,
+ const std::size_t min_data_size, const std::size_t max_data_size,
+ const bool auto_deq, const std::size_t min_xid_size,
+ const std::size_t max_xid_size, const transient_t transient,
+ const external_t external, const std::string& comment);
+ virtual ~test_case();
+
+ inline unsigned test_case_num() const { return _test_case_num; }
+ inline u_int32_t num_msgs() const { return _num_msgs; }
+ inline std::size_t min_data_size() const { return _min_data_size; }
+ inline std::size_t max_data_size() const { return _max_data_size; }
+ std::size_t this_data_size() const;
+ inline bool auto_deq() const { return _auto_dequeue; }
+ inline std::size_t min_xid_size() const { return _min_xid_size; }
+ inline std::size_t max_xid_size() const { return _max_xid_size; }
+ std::size_t this_xid_size() const;
+ inline transient_t transient() const { return _transient; }
+ bool this_transience() const;
+ inline external_t external() const { return _external; }
+ bool this_external() const;
+ inline const std::string& comment() const { return _comment; }
+
+ void add_result(test_case_result::shared_ptr& p);
+ void set_fmt_chk_res(const bool res, const std::string& jid);
+
+ inline const test_case_result_agregation& average() const { return _result_average; }
+ inline u_int32_t num_results() const { return _result_average.num_results(); }
+ inline unsigned num_jrnls() const { return _result_jmap.size(); }
+ inline res_map_citr jrnl_average(std::string& jid) const { return _result_jmap.find(jid); }
+ inline res_map_citr jmap_begin() const { return _result_jmap.begin(); }
+ inline res_map_citr jmap_end() const { return _result_jmap.end(); }
+ const test_case_result::shared_ptr jmap_last(std::string& jid) const;
+
+ void clear();
+ const std::string str() const;
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp
new file mode 100644
index 0000000000..2f88f265a5
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp
@@ -0,0 +1,201 @@
+/*
+ *
+ * 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 "test_case_result.h"
+
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_result::test_case_result(const std::string& jid):
+ _jid(jid),
+ _num_enq(0),
+ _num_deq(0),
+ _num_read(0),
+ _num_rproc(0),
+ _start_time(),
+ _stop_time(),
+ _stopped(false),
+ _test_time(),
+ _exception_list()
+{}
+
+test_case_result::~test_case_result()
+{}
+
+const std::string
+test_case_result::test_time_str() const
+{
+ return _test_time.str(9);
+}
+
+void
+test_case_result::add_exception(const journal::jexception& e, const bool set_stop_time_flag)
+{
+ if (!_stopped && set_stop_time_flag)
+ {
+ set_stop_time();
+ _stopped = true;
+ }
+ _exception_list.push_back(e.what());
+}
+
+void
+test_case_result::add_exception(const std::string& err_str, const bool set_stop_time_flag)
+{
+ if (!_stopped && set_stop_time_flag)
+ {
+ set_stop_time();
+ _stopped = true;
+ }
+ _exception_list.push_back(err_str);
+}
+
+void
+test_case_result::add_exception(const char* err_str, const bool set_stop_time_flag)
+{
+ if (!_stopped && set_stop_time_flag)
+ {
+ set_stop_time();
+ _stopped = true;
+ }
+ _exception_list.push_back(err_str);
+}
+
+void
+test_case_result::clear()
+{
+ _num_enq = 0;
+ _num_deq = 0;
+ _num_read = 0;
+ _start_time.set_zero();
+ _stop_time.set_zero();
+ _test_time.set_zero();
+ _exception_list.clear();
+}
+
+const std::string
+test_case_result::str(const bool summary) const
+{
+ std::ostringstream oss;
+ if (summary)
+ {
+ oss << _jid << ":";
+ oss << str_summary();
+ if (_exception_list.size())
+ oss << "; fail: " << _exception_list[0] << std::endl;
+ else
+ oss << "; ok" << std::endl;
+ }
+ else
+ {
+ oss << "--- Journal instance: jid=\"" << _jid << "\" ---" << std::endl;
+ oss << str_full();
+ if (_exception_list.size())
+ oss << " exception/error:" << _exception_list[0] << std::endl;
+ }
+ return oss.str();
+}
+
+const std::string
+test_case_result::str_full() const
+{
+ const double t = _test_time.tv_sec + (_test_time.tv_nsec/1e9);
+ const bool no_exception = _exception_list.empty();
+ std::ostringstream oss;
+ oss.setf(std::ios::fixed, std::ios::floatfield);
+ oss.precision(2);
+ if (no_exception)
+ {
+ oss.precision(6);
+ oss << " total test time: " << t << "s" << std::endl;
+ }
+ oss.precision(3);
+ oss << " total number enqueues: " << _num_enq;
+ if (no_exception)
+ oss << " (" << (_num_enq / t) << " enq/sec)";
+ oss << std::endl;
+ oss << " total number dequeues: " << _num_deq;
+ if (no_exception)
+ oss << " (" << (_num_deq / t) << " deq/sec)";
+ oss << std::endl;
+ oss << "total write operations: " << (_num_enq + _num_deq);
+ if (no_exception)
+ oss << " (" << ((_num_enq + _num_deq) / t) << " wrops/sec)";
+ oss << std::endl;
+ oss << " total number reads: " << _num_read;
+ if (no_exception)
+ oss << " (" << (_num_read / t) << " rd/sec)";
+ oss << std::endl;
+ oss << " total operations: " << (_num_enq + _num_deq + _num_read);
+ if (no_exception)
+ oss << " (" << ((_num_enq + _num_deq + _num_read) / t) << " ops/sec)";
+ oss << std::endl;
+ oss << " overall result: " << (no_exception ? "PASS" : "*** FAIL ***") << std::endl;
+ return oss.str();
+}
+
+const std::string
+test_case_result::str_summary() const
+{
+ const double t = _test_time.tv_sec + (_test_time.tv_nsec/1e9);
+ const bool no_exception = _exception_list.empty();
+ std::ostringstream oss;
+ oss.setf(std::ios::fixed, std::ios::floatfield);
+ if (no_exception)
+ {
+ oss.precision(6);
+ oss << " t=" << t << "s;";
+ }
+ else
+ oss << " exception";
+ oss.precision(3);
+ oss << " enq=" << _num_enq;
+ if (no_exception)
+ oss << " (" << (_num_enq / t) << ")";
+ oss << "; deq=" << _num_deq;
+ if (no_exception)
+ oss << " (" << (_num_deq / t) << ")";
+ oss << "; wr=" << (_num_enq + _num_deq);
+ if (no_exception)
+ oss << " (" << ((_num_enq + _num_deq) / t) << ")";
+ oss << "; rd=" << _num_read;
+ if (no_exception)
+ oss << " (" << (_num_read / t) << ")";
+ oss << "; tot=" << (_num_enq + _num_deq + _num_read);
+ if (no_exception)
+ oss << " (" << ((_num_enq + _num_deq + _num_read) / t) << ")";
+ return oss.str();
+}
+
+void
+test_case_result::calc_test_time()
+{
+ if (!_start_time.is_zero() && _stop_time >= _start_time)
+ _test_time = _stop_time - _start_time;
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h
new file mode 100644
index 0000000000..d15f9d021d
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_result_hpp
+#define mrg_jtt_test_case_result_hpp
+
+#include <boost/shared_ptr.hpp>
+#include <deque>
+#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/legacystore/jrnl/time_ns.h"
+#include <string>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class test_case_result
+ {
+ public:
+ typedef boost::shared_ptr<test_case_result> shared_ptr;
+
+ typedef std::deque<std::string> elist;
+ typedef elist::const_iterator elist_citr;
+
+ protected:
+ std::string _jid;
+ u_int32_t _num_enq;
+ u_int32_t _num_deq;
+ u_int32_t _num_read; // Messages actually read
+ u_int32_t _num_rproc; // Messages handled by read thread (not all are read)
+ journal::time_ns _start_time;
+ journal::time_ns _stop_time;
+ bool _stopped;
+ journal::time_ns _test_time;
+ elist _exception_list;
+
+ public:
+ test_case_result(const std::string& jid);
+ virtual ~test_case_result();
+
+ inline const std::string& jid() const { return _jid; }
+ inline u_int32_t num_enq() const { return _num_enq; }
+ inline u_int32_t incr_num_enq() { return ++_num_enq; }
+ inline u_int32_t num_deq() const { return _num_deq; }
+ inline u_int32_t incr_num_deq() { return ++_num_deq; }
+ inline u_int32_t num_read() const { return _num_read; }
+ inline u_int32_t incr_num_read() { return ++_num_read; }
+ inline u_int32_t num_rproc() const { return _num_rproc; }
+ inline u_int32_t incr_num_rproc() { return ++_num_rproc; }
+
+ inline const journal::time_ns& start_time() const { return _start_time; }
+ inline void set_start_time() { ::clock_gettime(CLOCK_REALTIME, &_start_time); }
+ inline const journal::time_ns& stop_time() const { return _stop_time; }
+ inline void set_stop_time()
+ { ::clock_gettime(CLOCK_REALTIME, &_stop_time); calc_test_time(); }
+ inline void set_test_time(const journal::time_ns& ts) { _test_time = ts; }
+ inline const journal::time_ns& test_time() const { return _test_time; }
+ const std::string test_time_str() const;
+
+ void add_exception(const journal::jexception& e, const bool set_stop_time_flag = true);
+ void add_exception(const std::string& err_str, const bool set_stop_time_flag = true);
+ void add_exception(const char* err_str, const bool set_stop_time_flag = true);
+ inline bool exception() const { return _exception_list.size() > 0; }
+ inline unsigned exception_count() const { return _exception_list.size(); }
+ inline elist_citr begin() { return _exception_list.begin(); }
+ inline elist_citr end() { return _exception_list.end(); }
+ inline const std::string& operator[](unsigned i) { return _exception_list[i]; }
+
+ void clear();
+ const std::string str(const bool summary) const;
+
+ protected:
+ const std::string str_full() const;
+ const std::string str_summary() const;
+ void calc_test_time();
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_result_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp
new file mode 100644
index 0000000000..da439e71e8
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp
@@ -0,0 +1,185 @@
+/*
+ *
+ * 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 "test_case_result_agregation.h"
+
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_result_agregation::test_case_result_agregation():
+ test_case_result("Average"),
+ _tc_average(true),
+ _fmt_chk_done(false),
+ _fmt_chk_err(false),
+ _res_list()
+{
+}
+
+test_case_result_agregation::test_case_result_agregation(const std::string& jid):
+ test_case_result(jid),
+ _tc_average(false),
+ _fmt_chk_done(false),
+ _fmt_chk_err(false),
+ _res_list()
+{}
+
+test_case_result_agregation::~test_case_result_agregation()
+{}
+
+void
+test_case_result_agregation::add_test_result(const test_case_result::shared_ptr& tcrp)
+{
+ if (_tc_average || _jid.compare(tcrp->jid()) == 0)
+ {
+ _num_enq += tcrp->num_enq();
+ _num_deq += tcrp->num_deq();
+ _num_read += tcrp->num_read();
+ add_test_time(tcrp->test_time());
+ _exception_list.insert(_exception_list.end(), tcrp->begin(), tcrp->end());
+ _res_list.push_back(tcrp);
+ }
+}
+
+bool
+test_case_result_agregation::exception() const
+{
+ for (tcrp_list_citr i = _res_list.begin(); i < _res_list.end(); i++)
+ if ((*i)->exception())
+ return true;
+ return false;
+}
+
+unsigned
+test_case_result_agregation::exception_count() const
+{
+ unsigned cnt = 0;
+ for (tcrp_list_citr i = _res_list.begin(); i < _res_list.end(); i++)
+ cnt += (*i)->exception_count();
+ return cnt;
+}
+
+void
+test_case_result_agregation::clear()
+{
+ test_case_result::clear();
+ _res_list.clear();
+}
+
+const std::string
+test_case_result_agregation::str(const bool last_only, const bool summary) const
+{
+ std::ostringstream oss;
+ if (last_only)
+ oss << " " << _res_list.at(_res_list.size()-1)->str(summary);
+ else
+ {
+ for (tcrp_list_citr i=_res_list.begin(); i!=_res_list.end(); i++)
+ oss << " " << (*i)->str(summary);
+ }
+ if (_res_list.size() > 1)
+ oss << " " << (summary ? str_summary(last_only) : str_full(last_only));
+ return oss.str();
+}
+
+const std::string
+test_case_result_agregation::str_full(const bool /*last_only*/) const
+{
+ std::ostringstream oss;
+ oss.precision(2);
+ if (_tc_average)
+ oss << "Average across all journal instances:" << std::endl;
+ else
+ oss << "Average for jid=\"" << _jid << "\":" << std::endl;
+ oss << " total number results: " << _res_list.size() << std::endl;
+ oss << " number exceptions: " << _exception_list.size() << " (" <<
+ (100.0 * _res_list.size() / _exception_list.size()) << "%)" << std::endl;
+
+ oss << test_case_result::str_full();
+
+ if (_exception_list.size())
+ {
+ unsigned n = 0;
+ oss << "List of exceptions/errors:" << std::endl;
+ for (elist_citr i = _exception_list.begin(); i != _exception_list.end(); i++, n++)
+ oss << " " << n << ". " << (*i) << std::endl;
+ }
+
+ if (!_tc_average && _res_list.size() > 1)
+ {
+ oss << "Individual results:" << std::endl;
+ for (tcrp_list_citr i=_res_list.begin(); i!=_res_list.end(); i++)
+ oss << " " << (*i)->str(false) << std::endl;
+ oss << std::endl;
+ }
+
+ return oss.str();
+}
+
+const std::string
+test_case_result_agregation::str_summary(const bool /*last_only*/) const
+{
+ std::ostringstream oss;
+ if (_tc_average)
+ oss << "overall average [" << _res_list.size() << "]:";
+ else
+ oss << "average (" << _res_list.size() << "):";
+
+ oss << test_case_result::str_summary();
+ if (_fmt_chk_done)
+ oss << " fmt-chk=" << (_fmt_chk_err ? "fail" : "ok");
+
+ if (_exception_list.size())
+ {
+ if (_tc_average)
+ oss << " fail: " << _exception_list.size() << " exception"
+ << (_exception_list.size()>1?"s":"") << std::endl;
+ else
+ {
+ if (_exception_list.size() == 1)
+ oss << " fail: " << *_exception_list.begin() << std::endl;
+ else
+ {
+ oss << std::endl;
+ unsigned n = 0;
+ for (elist_citr i = _exception_list.begin(); i != _exception_list.end(); i++, n++)
+ oss << " " << n << ". " << (*i) << std::endl;
+ }
+ }
+ }
+ else
+ oss << " ok" << std::endl;
+ return oss.str();
+}
+
+const journal::time_ns&
+test_case_result_agregation::add_test_time(const journal::time_ns& t)
+{
+ _test_time += t;
+ return _test_time;
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h
new file mode 100644
index 0000000000..0b3998176c
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h
@@ -0,0 +1,81 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_result_agregation_hpp
+#define mrg_jtt_test_case_result_agregation_hpp
+
+#include "test_case_result.h"
+
+#include <iostream>
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class test_case_result_agregation : public test_case_result
+ {
+ public:
+ typedef boost::shared_ptr<test_case_result_agregation> shared_ptr;
+
+ typedef std::vector<test_case_result::shared_ptr> tcrp_list;
+ typedef tcrp_list::const_iterator tcrp_list_citr;
+
+ private:
+ bool _tc_average;
+ bool _fmt_chk_done;
+ bool _fmt_chk_err;
+ tcrp_list _res_list;
+
+ public:
+ test_case_result_agregation(); // used for average across jrnl instances
+ test_case_result_agregation(const std::string& jid);
+ virtual ~test_case_result_agregation();
+
+ void add_test_result(const test_case_result::shared_ptr& tcrp);
+
+ inline bool tc_average_mode() const { return _tc_average; }
+ inline bool fmt_chk_done() const { return _fmt_chk_done; }
+ inline bool fmt_chk_res() const { return _fmt_chk_err; }
+ inline void set_fmt_chk_res(const bool err)
+ { _fmt_chk_done = true; _fmt_chk_err |= err; if (err) add_exception("Journal format error"); }
+ inline u_int32_t num_results() const { return _res_list.size(); }
+ inline tcrp_list_citr rlist_begin() const { return _res_list.begin(); }
+ inline tcrp_list_citr rlist_end() const { return _res_list.end(); }
+ inline const test_case_result::shared_ptr& operator[](unsigned i) const
+ { return _res_list[i]; }
+ bool exception() const;
+ unsigned exception_count() const;
+
+ void clear();
+ const std::string str(const bool last_only, const bool summary) const;
+
+ private:
+ const std::string str_full(const bool last_only) const;
+ const std::string str_summary(const bool last_only) const;
+ const journal::time_ns& add_test_time(const journal::time_ns& t);
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_result_agregation_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp
new file mode 100644
index 0000000000..b818d6c7ae
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp
@@ -0,0 +1,169 @@
+/*
+ *
+ * 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 "test_case_set.h"
+
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_set::test_case_set():
+ _tc_list(),
+ _csv_ignored(0)
+{}
+
+test_case_set::test_case_set(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols):
+ _tc_list(),
+ _csv_ignored(0)
+{
+ append_from_csv(csv_filename, recover_mode, cols);
+}
+
+test_case_set::~test_case_set()
+{}
+
+void
+test_case_set::append(const unsigned test_case_num, const u_int32_t num_msgs,
+ const std::size_t min_data_size, const std::size_t max_data_size, const bool auto_deq,
+ const std::size_t min_xid_size, const std::size_t max_xid_size,
+ const test_case::transient_t transient, const test_case::external_t external,
+ const std::string& comment)
+{
+ test_case::shared_ptr tcp(new test_case(test_case_num, num_msgs, min_data_size,
+ max_data_size, auto_deq, min_xid_size, max_xid_size, transient, external, comment));
+ append(tcp);
+}
+
+
+#define CSV_BUFF_SIZE 2048
+void
+test_case_set::append_from_csv(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols)
+{
+ char buff[CSV_BUFF_SIZE];
+ std::ifstream ifs(csv_filename.c_str());
+ while (ifs.good())
+ {
+ ifs.getline(buff, (std::streamsize)CSV_BUFF_SIZE);
+ if (ifs.gcount())
+ {
+ test_case::shared_ptr tcp = get_tc_from_csv(buff, cols);
+ if (tcp.get())
+ {
+ if (!recover_mode || tcp->auto_deq())
+ append(tcp);
+ else
+ _csv_ignored++;
+ }
+ }
+ }
+}
+
+test_case::shared_ptr
+test_case_set::get_tc_from_csv(const std::string& csv_line, const csv_map& cols)
+{
+ unsigned test_case_num = 0;
+ u_int32_t num_msgs = 0;
+ std::size_t min_data_size = 0;
+ std::size_t max_data_size = 0;
+ bool auto_deq = false;
+ std::size_t min_xid_size = 0;
+ std::size_t max_xid_size = 0;
+ test_case::transient_t transient = test_case::JTT_TRANSIENT;
+ test_case::external_t external = test_case::JDL_INTERNAL;
+ std::string comment;
+
+ csv_tok t(csv_line);
+ unsigned col_num = 0;
+ for (csv_tok_citr t_itr = t.begin(); t_itr != t.end(); ++t_itr, ++col_num)
+ {
+ const std::string& tok = *t_itr;
+ csv_map_citr m_citr = cols.find(col_num);
+ if (m_citr != cols.end())
+ {
+ switch (m_citr->second)
+ {
+ case CSV_TC_NUM:
+ if (!tok.size() || tok[0] < '0' || tok[0] > '9')
+ return test_case::shared_ptr();
+ test_case_num = unsigned(std::atol(tok.c_str()));
+ break;
+ case CSV_TC_NUM_MSGS: num_msgs = u_int32_t(std::atol(tok.c_str())); break;
+ case CSV_TC_MIN_DATA_SIZE: min_data_size = std::size_t(std::atol(tok.c_str())); break;
+ case CSV_TC_MAX_DATA_SIZE: max_data_size = std::size_t(std::atol(tok.c_str())); break;
+ case CSV_TC_AUTO_DEQ:
+ if (tok == "TRUE" || tok == "1")
+ auto_deq = true;
+ break;
+ case CSV_TC_MIN_XID_SIZE: min_xid_size = std::size_t(std::atol(tok.c_str())); break;
+ case CSV_TC_MAX_XID_SIZE: max_xid_size = std::size_t(std::atol(tok.c_str())); break;
+ case CSV_TC_TRANSIENT:
+ if (tok == "TRUE" || tok == "1")
+ transient = test_case::JTT_PERSISTNET;
+ else if (tok == "RANDOM" || tok == "-1")
+ transient = test_case::JTT_RANDOM;
+ break;
+ case CSV_TC_EXTERNAL:
+ if (tok == "TRUE" || tok == "1")
+ external = test_case::JDL_EXTERNAL;
+ else if (tok == "RANDOM" || tok == "-1")
+ external = test_case::JDL_RANDOM;
+ break;
+ case CSV_TC_COMMENT: comment = *t_itr; break;
+ }
+ }
+ }
+ if (col_num)
+ return test_case::shared_ptr(new test_case(test_case_num, num_msgs, min_data_size,
+ max_data_size, auto_deq, min_xid_size, max_xid_size, transient, external, comment));
+ else
+ return test_case::shared_ptr();
+}
+
+// Static member initializations
+// This csv_map is for use on the standard spreadsheet-derived test case csv files.
+test_case_set::csv_map test_case_set::std_csv_map;
+const bool test_case_set::_map_init = __init();
+
+bool
+test_case_set::__init()
+{
+ std_csv_map.insert(test_case_set::csv_pair(0, test_case_set::CSV_TC_NUM));
+ std_csv_map.insert(test_case_set::csv_pair(5, test_case_set::CSV_TC_NUM_MSGS));
+ std_csv_map.insert(test_case_set::csv_pair(7, test_case_set::CSV_TC_MIN_DATA_SIZE));
+ std_csv_map.insert(test_case_set::csv_pair(8, test_case_set::CSV_TC_MAX_DATA_SIZE));
+ std_csv_map.insert(test_case_set::csv_pair(11, test_case_set::CSV_TC_AUTO_DEQ));
+ std_csv_map.insert(test_case_set::csv_pair(9, test_case_set::CSV_TC_MIN_XID_SIZE));
+ std_csv_map.insert(test_case_set::csv_pair(10, test_case_set::CSV_TC_MAX_XID_SIZE));
+ std_csv_map.insert(test_case_set::csv_pair(12, test_case_set::CSV_TC_TRANSIENT));
+ std_csv_map.insert(test_case_set::csv_pair(13, test_case_set::CSV_TC_EXTERNAL));
+ std_csv_map.insert(test_case_set::csv_pair(20, test_case_set::CSV_TC_COMMENT));
+ return true;
+}
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h
new file mode 100644
index 0000000000..94a1ee3172
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h
@@ -0,0 +1,99 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_set_hpp
+#define mrg_jtt_test_case_set_hpp
+
+#include "test_case.h"
+
+#include <cstddef>
+#include <boost/tokenizer.hpp>
+#include <map>
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+ class test_case_set
+ {
+ public:
+ enum csv_col_enum {
+ CSV_TC_NUM = 0,
+ CSV_TC_NUM_MSGS,
+ CSV_TC_MIN_DATA_SIZE,
+ CSV_TC_MAX_DATA_SIZE,
+ CSV_TC_AUTO_DEQ,
+ CSV_TC_MIN_XID_SIZE,
+ CSV_TC_MAX_XID_SIZE,
+ CSV_TC_TRANSIENT,
+ CSV_TC_EXTERNAL,
+ CSV_TC_COMMENT };
+ typedef std::pair<unsigned, csv_col_enum> csv_pair;
+ typedef std::map<unsigned, csv_col_enum> csv_map;
+ typedef csv_map::const_iterator csv_map_citr;
+ static csv_map std_csv_map;
+
+ typedef std::vector<test_case::shared_ptr> tcl;
+ typedef tcl::iterator tcl_itr;
+ typedef tcl::const_iterator tcl_citr;
+
+ typedef boost::tokenizer<boost::escaped_list_separator<char> > csv_tok;
+ typedef csv_tok::const_iterator csv_tok_citr;
+
+ private:
+ tcl _tc_list;
+ static const bool _map_init;
+ unsigned _csv_ignored;
+
+ public:
+ test_case_set();
+ test_case_set(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols = std_csv_map);
+ virtual ~test_case_set();
+
+ inline unsigned size() const { return _tc_list.size(); }
+ inline unsigned ignored() const { return _csv_ignored; }
+ inline bool empty() const { return _tc_list.empty(); }
+
+ inline void append(const test_case::shared_ptr& tc) { _tc_list.push_back(tc); }
+ void append(const unsigned test_case_num, const u_int32_t num_msgs,
+ const std::size_t min_data_size, const std::size_t max_data_size,
+ const bool auto_deq, const std::size_t min_xid_size,
+ const std::size_t max_xid_size, const test_case::transient_t transient,
+ const test_case::external_t external, const std::string& comment);
+ void append_from_csv(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols = std_csv_map);
+ inline tcl_itr begin() { return _tc_list.begin(); }
+ inline tcl_itr end() { return _tc_list.end(); }
+ inline const test_case::shared_ptr& operator[](unsigned i) { return _tc_list[i]; }
+ inline void clear() { _tc_list.clear(); }
+
+ private:
+ test_case::shared_ptr get_tc_from_csv(const std::string& csv_line, const csv_map& cols);
+ static bool __init();
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_set_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp
new file mode 100644
index 0000000000..de0b5dbfb9
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp
@@ -0,0 +1,218 @@
+/*
+ *
+ * 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 "test_mgr.h"
+
+#include <cstdlib>
+#include <iostream>
+#include <sys/stat.h>
+#include "test_case_set.h"
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_mgr::test_mgr(args& args):
+ _ji_list(),
+ _args(args),
+ _err_flag(false),
+ _random_fn_ptr(random_fn)
+{
+ if (_args.seed)
+ std::srand(_args.seed);
+}
+
+test_mgr::~test_mgr()
+{}
+
+void
+test_mgr::run()
+{
+ // TODO: complete tidy-up of non-summary (verbose) results, then pull through
+ // a command-line summary to control this.
+ // Idea: --summary: prints short results afterwards
+ // --verbose: prints long version as test progresses
+ // defualt: none of these, similar to current summary = true version.
+ const bool summary = true;
+
+ std::cout << "CSV file: \"" << _args.test_case_csv_file_name << "\"";
+ test_case_set tcs(_args.test_case_csv_file_name, _args.recover_mode);
+
+ if (tcs.size())
+ {
+ std::cout << " (found " << tcs.size() << " test case" << (tcs.size() != 1 ? "s" : "") <<
+ ")" << std::endl;
+ if (tcs.ignored())
+ std::cout << "WARNING: " << tcs.ignored() << " test cases were ignored. (All test "
+ "cases without auto-dequeue are ignored when recover-mode is selected.)" <<
+ std::endl;
+ _args.print_args();
+ }
+ else if(tcs.ignored())
+ {
+ std::cout << " WARNING: All " << tcs.ignored() << " test case(s) were ignored. (All test "
+ "cases without auto-dequeue are ignored when recover-mode is selected.)" <<
+ std::endl;
+ }
+ else
+ std::cout << " (WARNING: This CSV file is empty or does not exist.)" << std::endl;
+
+ do
+ {
+ unsigned u = 0;
+ if (_args.randomize)
+ random_shuffle(tcs.begin(), tcs.end(), _random_fn_ptr);
+ for (test_case_set::tcl_itr tci = tcs.begin(); tci != tcs.end(); tci++, u++)
+ {
+ if (summary)
+ std::cout << "Test case " << (*tci)->test_case_num() << ": \"" <<
+ (*tci)->comment() << "\"" << std::endl;
+ else
+ std::cout << (*tci)->str() << std::endl;
+ if (!_args.reuse_instance || _ji_list.empty())
+ initialize_jrnls();
+ for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+ (*jii)->init_tc(*tci, &_args);
+ for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+ (*jii)->run_tc();
+ for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+ (*jii)->tc_wait_compl();
+
+ if (_args.format_chk)
+ {
+ for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+ {
+ jrnl_init_params::shared_ptr jpp = (*jii)->params();
+ std::string ja = _args.jfile_analyzer;
+ if (ja.empty()) ja = "./jfile_chk.py";
+ if (!exists(ja))
+ {
+ std::ostringstream oss;
+ oss << "ERROR: Validation program \"" << ja << "\" does not exist" << std::endl;
+ throw std::runtime_error(oss.str());
+ }
+ std::ostringstream oss;
+ oss << ja << " -b " << jpp->base_filename();
+ // TODO: When jfile_check.py can handle previously recovered journals for
+ // specific tests, then remove this exclusion.
+ if (!_args.recover_mode)
+ {
+ oss << " -c " << _args.test_case_csv_file_name;
+ oss << " -t " << (*tci)->test_case_num();
+ }
+ oss << " -q " << jpp->jdir();
+ bool res = system(oss.str().c_str()) != 0;
+ (*tci)->set_fmt_chk_res(res, jpp->jid());
+ if (res) _err_flag = true;
+ }
+ }
+
+ if (!_args.recover_mode && !_args.keep_jrnls)
+ for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+ try { mrg::journal::jdir::delete_dir((*jii)->jrnl_dir()); }
+ catch (...) {} // TODO - work out exception strategy for failure here...
+
+ print_results(*tci, summary);
+ if ((*tci)->average().exception())
+ _err_flag = true;
+ if (_abort || (!_args.repeat_flag && _signal))
+ break;
+ if (_args.pause_secs && tci != tcs.end())
+ ::usleep(_args.pause_secs * 1000000);
+ }
+ }
+ while (_args.repeat_flag && !_signal);
+}
+
+// static fn:
+void
+test_mgr::signal_handler(int sig)
+{
+ if (_signal)
+ _abort = true;
+ _signal = sig;
+ std::cout << std::endl;
+ std::cout << "********************************" << std::endl;
+ std::cout << "Caught signal " << sig << std::endl;
+ if (_abort)
+ std::cout << "Aborting..." << std::endl;
+ else
+ std::cout << "Completing current test cycle..." << std::endl;
+ std::cout << "********************************" << std::endl << std::endl;
+}
+
+bool
+test_mgr::exists(std::string fname)
+{
+ struct stat s;
+ if (::stat(fname.c_str(), &s))
+ {
+ if (errno == ENOENT) // No such dir or file
+ return false;
+ // Throw for any other condition
+ std::ostringstream oss;
+ oss << "ERROR: test_mgr::exists(): file=\"" << fname << "\": " << FORMAT_SYSERR(errno);
+ throw std::runtime_error(oss.str());
+ }
+ return true;
+}
+
+void
+test_mgr::initialize_jrnls()
+{
+ _ji_list.clear();
+ for (unsigned i=0; i<_args.num_jrnls; i++)
+ {
+ std::ostringstream jid;
+ jid << std::hex << std::setfill('0');
+ jid << "test_" << std::setw(4) << std::hex << i;
+ std::ostringstream jdir;
+ jdir << _args.journal_dir << "/" << jid.str();
+ jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid.str(), jdir.str(), jid.str()));
+ jrnl_instance::shared_ptr jip(new jrnl_instance(jpp));
+ _ji_list.push_back(jip);
+ }
+}
+
+void
+test_mgr::print_results(test_case::shared_ptr tcp, const bool summary)
+{
+ if (!summary)
+ std::cout << " === Results ===" << std::endl;
+
+// TODO - the reporting is broken when --repeat is used. The following commented-out
+// section was an attempt to fix it, but there are too many side-effects.
+// for (test_case::res_map_citr i=tcp->jmap_begin(); i!=tcp->jmap_end(); i++)
+// std::cout << (*i).second->str(summary, summary);
+// if (tcp->num_jrnls() > 1)
+ std::cout << tcp->average().str(false, summary);
+
+ if (!summary)
+ std::cout << std::endl;
+}
+
+// static instances
+volatile sig_atomic_t test_mgr::_signal = 0;
+volatile bool test_mgr::_abort = false;
+
+} // namespace jtt
+} // namespace mrg
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h
new file mode 100644
index 0000000000..e608ac6280
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h
@@ -0,0 +1,68 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef mrg_jtt_test_mgr_hpp
+#define mrg_jtt_test_mgr_hpp
+
+#include "args.h"
+#include <csignal>
+#include <cstdlib>
+#include "jrnl_instance.h"
+
+namespace mrg
+{
+namespace jtt
+{
+ class test_mgr
+ {
+ public:
+ typedef std::vector<jrnl_instance::shared_ptr> ji_list;
+ typedef ji_list::iterator ji_list_itr;
+ typedef ji_list::const_iterator ji_list_citr;
+
+ private:
+ ji_list _ji_list;
+ args& _args;
+ bool _err_flag;
+ ptrdiff_t (*_random_fn_ptr)(const ptrdiff_t i);
+ static volatile std::sig_atomic_t _signal;
+ static volatile bool _abort;
+
+ public:
+ test_mgr(args& args);
+ virtual ~test_mgr();
+ void run();
+ inline bool error() const { return _err_flag; }
+
+ static void signal_handler(int signal);
+
+ private:
+ static bool exists(std::string file_name);
+ void initialize_jrnls();
+ void print_results(test_case::shared_ptr tcp, const bool summary);
+ inline static ptrdiff_t random_fn(const ptrdiff_t i)
+ { return static_cast<ptrdiff_t>(1.0 * i * std::rand() / RAND_MAX); }
+ };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_mgr_hpp
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/prof b/qpid/cpp/src/tests/legacystore/jrnl/prof
new file mode 100755
index 0000000000..6e0e6da0eb
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/prof
@@ -0,0 +1,32 @@
+#!/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.
+#
+
+mkdir -p profile
+opcontrol --setup --no-vmlinux --separate=library
+opcontrol --start
+# -- Do stuff here --
+./jtest wtests.csv 264
+# -- End of stuff --
+opcontrol --stop
+opcontrol --dump
+opcontrol --shutdown
+opreport -l ./jtest
+opannotate --source --output-dir=profile ./jtest
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/run-journal-tests b/qpid/cpp/src/tests/legacystore/jrnl/run-journal-tests
new file mode 100755
index 0000000000..5e13967a01
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/run-journal-tests
@@ -0,0 +1,47 @@
+#!/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.
+#
+
+if test x${TMP_DATA_DIR} == x; then
+ export TMP_DATA_DIR=/tmp
+fi
+fail=0
+num_jrnls=3
+
+# Run jtt using default test set
+echo
+echo "===== Mode 1: New journal instance, no recover ====="
+jtt/jtt --analyzer ../../tools/store_chk --jrnl-dir ${TMP_DATA_DIR} --csv jtt/jtt.csv --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_DATA_DIR}/test_0*
+echo
+echo "===== Mode 2: Re-use journal instance, no recover ====="
+jtt/jtt --analyzer ../../tools/store_chk --jrnl-dir ${TMP_DATA_DIR} --csv jtt/jtt.csv --reuse-instance --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_DATA_DIR}/test_0*
+echo
+echo "===== Mode 3: New journal instance, recover previous test journal ====="
+jtt/jtt --analyzer ../../tools/store_chk --jrnl-dir ${TMP_DATA_DIR} --csv jtt/jtt.csv --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_DATA_DIR}/test_0*
+echo
+echo "===== Mode 4: Re-use journal instance, recover previous test journal ====="
+jtt/jtt --analyzer ../../tools/store_chk --jrnl-dir ${TMP_DATA_DIR} --csv jtt/jtt.csv --reuse-instance --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_DATA_DIR}/test_0*
+echo
+
+exit $fail
diff --git a/qpid/cpp/src/tests/legacystore/jrnl/tests.ods b/qpid/cpp/src/tests/legacystore/jrnl/tests.ods
new file mode 100644
index 0000000000..d900374321
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/jrnl/tests.ods
Binary files differ
diff --git a/qpid/cpp/src/tests/legacystore/python_tests/__init__.py b/qpid/cpp/src/tests/legacystore/python_tests/__init__.py
new file mode 100644
index 0000000000..ebb9da8670
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/python_tests/__init__.py
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+# Do not delete - marks this directory as a python package.
+
+from client_persistence import *
+from resize import *
+
diff --git a/qpid/cpp/src/tests/legacystore/python_tests/client_persistence.py b/qpid/cpp/src/tests/legacystore/python_tests/client_persistence.py
new file mode 100644
index 0000000000..3c62740a62
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/python_tests/client_persistence.py
@@ -0,0 +1,234 @@
+#
+# 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.
+#
+
+from brokertest import EXPECT_EXIT_OK
+from store_test import StoreTest, Qmf, store_args
+from qpid.messaging import *
+
+class ExchangeQueueTests(StoreTest):
+ """
+ Simple tests of the broker exchange and queue types
+ """
+
+ def test_direct_exchange(self):
+ """Test Direct exchange."""
+ broker = self.broker(store_args(), name="test_direct_exchange", expect=EXPECT_EXIT_OK)
+ msg1 = Message("A_Message1", durable=True, correlation_id="Msg0001")
+ msg2 = Message("B_Message1", durable=True, correlation_id="Msg0002")
+ broker.send_message("a", msg1)
+ broker.send_message("b", msg2)
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_direct_exchange")
+ self.check_message(broker, "a", msg1, True)
+ self.check_message(broker, "b", msg2, True)
+
+ def test_topic_exchange(self):
+ """Test Topic exchange."""
+ broker = self.broker(store_args(), name="test_topic_exchange", expect=EXPECT_EXIT_OK)
+ ssn = broker.connect().session()
+ snd1 = ssn.sender("abc/key1; {create:always, node:{type:topic, durable:True}}")
+ snd2 = ssn.sender("abc/key2; {create:always, node:{type:topic, durable:True}}")
+ ssn.receiver("a; {create:always, link:{x-bindings:[{exchange:abc, key:key1}]}, node:{durable:True}}")
+ ssn.receiver("b; {create:always, link:{x-bindings:[{exchange:abc, key:key1}]}, node:{durable:True}}")
+ ssn.receiver("c; {create:always, link:{x-bindings:[{exchange:abc, key:key1}, "
+ "{exchange:abc, key: key2}]}, node:{durable:True}}")
+ ssn.receiver("d; {create:always, link:{x-bindings:[{exchange:abc, key:key2}]}, node:{durable:True}}")
+ ssn.receiver("e; {create:always, link:{x-bindings:[{exchange:abc, key:key2}]}, node:{durable:True}}")
+ msg1 = Message("Message1", durable=True, correlation_id="Msg0003")
+ snd1.send(msg1)
+ msg2 = Message("Message2", durable=True, correlation_id="Msg0004")
+ snd2.send(msg2)
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_topic_exchange")
+ self.check_message(broker, "a", msg1, True)
+ self.check_message(broker, "b", msg1, True)
+ self.check_messages(broker, "c", [msg1, msg2], True)
+ self.check_message(broker, "d", msg2, True)
+ self.check_message(broker, "e", msg2, True)
+
+
+ def test_legacy_lvq(self):
+ """Test legacy LVQ."""
+ broker = self.broker(store_args(), name="test_lvq", expect=EXPECT_EXIT_OK)
+ ma1 = Message("A1", durable=True, correlation_id="Msg0005", properties={"qpid.LVQ_key":"A"})
+ ma2 = Message("A2", durable=True, correlation_id="Msg0006", properties={"qpid.LVQ_key":"A"})
+ mb1 = Message("B1", durable=True, correlation_id="Msg0007", properties={"qpid.LVQ_key":"B"})
+ mb2 = Message("B2", durable=True, correlation_id="Msg0008", properties={"qpid.LVQ_key":"B"})
+ mb3 = Message("B3", durable=True, correlation_id="Msg0009", properties={"qpid.LVQ_key":"B"})
+ mc1 = Message("C1", durable=True, correlation_id="Msg0010", properties={"qpid.LVQ_key":"C"})
+ broker.send_messages("lvq-test", [mb1, ma1, ma2, mb2, mb3, mc1],
+ xprops="arguments:{\"qpid.last_value_queue\":True}")
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_lvq", expect=EXPECT_EXIT_OK)
+ ssn = self.check_messages(broker, "lvq-test", [ma2, mb3, mc1], empty=True, ack=False)
+ # Add more messages while subscriber is active (no replacement):
+ ma3 = Message("A3", durable=True, correlation_id="Msg0011", properties={"qpid.LVQ_key":"A"})
+ ma4 = Message("A4", durable=True, correlation_id="Msg0012", properties={"qpid.LVQ_key":"A"})
+ mc2 = Message("C2", durable=True, correlation_id="Msg0013", properties={"qpid.LVQ_key":"C"})
+ mc3 = Message("C3", durable=True, correlation_id="Msg0014", properties={"qpid.LVQ_key":"C"})
+ mc4 = Message("C4", durable=True, correlation_id="Msg0015", properties={"qpid.LVQ_key":"C"})
+ broker.send_messages("lvq-test", [mc2, mc3, ma3, ma4, mc4], session=ssn)
+ ssn.acknowledge()
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_lvq")
+ self.check_messages(broker, "lvq-test", [ma4, mc4], True)
+
+
+ def test_fanout_exchange(self):
+ """Test Fanout Exchange"""
+ broker = self.broker(store_args(), name="test_fanout_exchange", expect=EXPECT_EXIT_OK)
+ ssn = broker.connect().session()
+ snd = ssn.sender("TestFanoutExchange; {create: always, node: {type: topic, x-declare: {type: fanout}}}")
+ ssn.receiver("TestFanoutExchange; {link: {name: \"q1\", durable: True, reliability:at-least-once}}")
+ ssn.receiver("TestFanoutExchange; {link: {name: \"q2\", durable: True, reliability:at-least-once}}")
+ ssn.receiver("TestFanoutExchange; {link: {name: \"q3\", durable: True, reliability:at-least-once}}")
+ msg1 = Message("Msg1", durable=True, correlation_id="Msg0001")
+ snd.send(msg1)
+ msg2 = Message("Msg2", durable=True, correlation_id="Msg0002")
+ snd.send(msg2)
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_fanout_exchange")
+ self.check_messages(broker, "q1", [msg1, msg2], True)
+ self.check_messages(broker, "q2", [msg1, msg2], True)
+ self.check_messages(broker, "q3", [msg1, msg2], True)
+
+
+ def test_message_reject(self):
+ broker = self.broker(store_args(), name="test_message_reject", expect=EXPECT_EXIT_OK)
+ ssn = broker.connect().session()
+ snd = ssn.sender("tmr; {create:always, node:{type:queue, durable:True}}")
+ rcv = ssn.receiver("tmr; {create:always, node:{type:queue, durable:True}}")
+ m1 = Message("test_message_reject", durable=True, correlation_id="Msg0001")
+ snd.send(m1)
+ m2 = rcv.fetch()
+ ssn.acknowledge(message=m2, disposition=Disposition(REJECTED))
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_message_reject")
+ qmf = Qmf(broker)
+ assert qmf.queue_message_count("tmr") == 0
+
+
+ def test_route(self):
+ """ Test the recovery of a route (link and bridge objects."""
+ broker = self.broker(store_args(), name="test_route", expect=EXPECT_EXIT_OK)
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+
+ # create a "link"
+ link_args = {"host":"a.fake.host.com", "port":9999, "durable":True,
+ "authMechanism":"PLAIN", "username":"guest", "password":"guest",
+ "transport":"tcp"}
+ result = qmf_broker_obj.create("link", "test-link", link_args, False)
+ self.assertEqual(result.status, 0, result)
+ link = qmf.get_objects("link")[0]
+
+ # create bridge
+ bridge_args = {"link":"test-link", "src":"amq.direct", "dest":"amq.fanout",
+ "key":"my-key", "durable":True}
+ result = qmf_broker_obj.create("bridge", "test-bridge", bridge_args, False);
+ self.assertEqual(result.status, 0, result)
+ bridge = qmf.get_objects("bridge")[0]
+
+ broker.terminate()
+
+ # recover the link and bridge
+ broker = self.broker(store_args(), name="test_route")
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+ self.assertEqual(len(qmf.get_objects("link")), 1)
+ self.assertEqual(len(qmf.get_objects("bridge")), 1)
+
+
+
+class AlternateExchangePropertyTests(StoreTest):
+ """
+ Test the persistence of the Alternate Exchange property for exchanges and queues.
+ """
+
+ def test_exchange(self):
+ """Exchange alternate exchange property persistence test"""
+ broker = self.broker(store_args(), name="test_exchange", expect=EXPECT_EXIT_OK)
+ qmf = Qmf(broker)
+ qmf.add_exchange("altExch", "direct", durable=True) # Serves as alternate exchange instance
+ qmf.add_exchange("testExch", "direct", durable=True, alt_exchange_name="altExch")
+ qmf.close()
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_exchange")
+ qmf = Qmf(broker)
+ try:
+ qmf.add_exchange("altExch", "direct", passive=True)
+ except Exception, error:
+ self.fail("Alternate exchange (\"altExch\") instance not recovered: %s" % error)
+ try:
+ qmf.add_exchange("testExch", "direct", passive=True)
+ except Exception, error:
+ self.fail("Test exchange (\"testExch\") instance not recovered: %s" % error)
+ self.assertTrue(qmf.query_exchange("testExch", alt_exchange_name = "altExch"),
+ "Alternate exchange property not found or is incorrect on exchange \"testExch\".")
+ qmf.close()
+
+ def test_queue(self):
+ """Queue alternate exchange property persistexchangeNamece test"""
+ broker = self.broker(store_args(), name="test_queue", expect=EXPECT_EXIT_OK)
+ qmf = Qmf(broker)
+ qmf.add_exchange("altExch", "direct", durable=True) # Serves as alternate exchange instance
+ qmf.add_queue("testQueue", durable=True, alt_exchange_name="altExch")
+ qmf.close()
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_queue")
+ qmf = Qmf(broker)
+ try:
+ qmf.add_exchange("altExch", "direct", passive=True)
+ except Exception, error:
+ self.fail("Alternate exchange (\"altExch\") instance not recovered: %s" % error)
+ try:
+ qmf.add_queue("testQueue", passive=True)
+ except Exception, error:
+ self.fail("Test queue (\"testQueue\") instance not recovered: %s" % error)
+ self.assertTrue(qmf.query_queue("testQueue", alt_exchange_name = "altExch"),
+ "Alternate exchange property not found or is incorrect on queue \"testQueue\".")
+ qmf.close()
+
+
+class RedeliveredTests(StoreTest):
+ """
+ Test the behavior of the redelivered flag in the context of persistence
+ """
+
+ def test_broker_recovery(self):
+ """Test that the redelivered flag is set on messages after recovery of broker"""
+ broker = self.broker(store_args(), name="test_broker_recovery", expect=EXPECT_EXIT_OK)
+ msg_content = "xyz"*100
+ msg = Message(msg_content, durable=True)
+ broker.send_message("testQueue", msg)
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_broker_recovery")
+ rcv_msg = broker.get_message("testQueue")
+ self.assertEqual(msg_content, rcv_msg.content)
+ self.assertTrue(rcv_msg.redelivered)
+
diff --git a/qpid/cpp/src/tests/legacystore/python_tests/resize.py b/qpid/cpp/src/tests/legacystore/python_tests/resize.py
new file mode 100644
index 0000000000..469e0f6730
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/python_tests/resize.py
@@ -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.
+#
+
+import glob
+import os
+import subprocess
+
+from brokertest import EXPECT_EXIT_OK
+from qpid.datatypes import uuid4
+from store_test import StoreTest, store_args
+from qpid.messaging import Message
+
+class ResizeTest(StoreTest):
+
+ resize_tool = os.getenv("QPID_STORE_RESIZE_TOOL", "qpid-store-resize")
+ print resize_tool
+ def _resize_store(self, store_dir, queue_name, resize_num_files, resize_file_size, exp_fail):
+ for f in glob.glob(os.path.join(store_dir, "*")):
+ final_store_dir = os.path.join(f, queue_name)
+ p = subprocess.Popen([self.resize_tool, final_store_dir, "--num-jfiles", str(resize_num_files),
+ "--jfile-size-pgs", str(resize_file_size), "--quiet"], stdout = subprocess.PIPE,
+ stderr = subprocess.STDOUT)
+ res = p.wait()
+ err_found = False
+ try:
+ for l in p.stdout:
+ if exp_fail:
+ err_found = True
+ print "[Expected error]:",
+ print l,
+ finally:
+ p.stdout.close()
+ return res
+
+ def _resize_test(self, queue_name, num_msgs, msg_size, resize_num_files, resize_file_size, init_num_files = 8,
+ init_file_size = 24, exp_fail = False, wait_time = None):
+ # Using a sender will force the creation of an empty persistent queue which is needed for some tests
+ broker = self.broker(store_args(), name="broker", expect=EXPECT_EXIT_OK, wait=wait_time)
+ ssn = broker.connect().session()
+ snd = ssn.sender("%s; {create:always, node:{durable:True}}" % queue_name)
+
+ msgs = []
+ for index in range(0, num_msgs):
+ msg = Message(self.make_message(index, msg_size), durable=True, id=uuid4(), correlation_id="msg-%04d"%index)
+ msgs.append(msg)
+ snd.send(msg)
+ broker.terminate()
+
+ res = self._resize_store(os.path.join(self.dir, "broker", "rhm", "jrnl"), queue_name, resize_num_files,
+ resize_file_size, exp_fail)
+ if res != 0:
+ if exp_fail:
+ return
+ self.fail("ERROR: Resize operation failed with return code %d" % res)
+ elif exp_fail:
+ self.fail("ERROR: Resize operation succeeded, but a failure was expected")
+
+ broker = self.broker(store_args(), name="broker")
+ self.check_messages(broker, queue_name, msgs, True)
+
+ # TODO: Check the physical files to check number and size are as expected.
+
+
+class SimpleTest(ResizeTest):
+ """
+ Simple tests of the resize utility for resizing a journal to larger and smaller sizes.
+ """
+
+ def test_empty_store_same(self):
+ self._resize_test(queue_name = "empty_store_same",
+ num_msgs = 0, msg_size = 0,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 8, resize_file_size = 24)
+
+ def test_empty_store_up(self):
+ self._resize_test(queue_name = "empty_store_up",
+ num_msgs = 0, msg_size = 0,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 16, resize_file_size = 48)
+
+ def test_empty_store_down(self):
+ self._resize_test(queue_name = "empty_store_down",
+ num_msgs = 0, msg_size = 0,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 6, resize_file_size = 12)
+
+# TODO: Put into long tests, make sure there is > 128GB free disk space
+# def test_empty_store_max(self):
+# self._resize_test(queue_name = "empty_store_max",
+# num_msgs = 0, msg_size = 0,
+# init_num_files = 8, init_file_size = 24,
+# resize_num_files = 64, resize_file_size = 32768,
+# wait_time = 120)
+
+ def test_empty_store_min(self):
+ self._resize_test(queue_name = "empty_store_min",
+ num_msgs = 0, msg_size = 0,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 4, resize_file_size = 1)
+
+ def test_basic_up(self):
+ self._resize_test(queue_name = "basic_up",
+ num_msgs = 100, msg_size = 10000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 16, resize_file_size = 48)
+
+ def test_basic_down(self):
+ self._resize_test(queue_name = "basic_down",
+ num_msgs = 100, msg_size = 10000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 4, resize_file_size = 15)
+
+ def test_basic_low(self):
+ self._resize_test(queue_name = "basic_low",
+ num_msgs = 100, msg_size = 10000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 4, resize_file_size = 4,
+ exp_fail = True)
+
+ def test_basic_under(self):
+ self._resize_test(queue_name = "basic_under",
+ num_msgs = 100, msg_size = 10000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 4, resize_file_size = 3,
+ exp_fail = True)
+
+ def test_very_large_msg_up(self):
+ self._resize_test(queue_name = "very_large_msg_up",
+ num_msgs = 4, msg_size = 2000000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 16, resize_file_size = 48)
+
+ def test_very_large_msg_down(self):
+ self._resize_test(queue_name = "very_large_msg_down",
+ num_msgs = 4, msg_size = 2000000,
+ init_num_files = 16, init_file_size = 64,
+ resize_num_files = 16, resize_file_size = 48)
+
+ def test_very_large_msg_low(self):
+ self._resize_test(queue_name = "very_large_msg_low",
+ num_msgs = 4, msg_size = 2000000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 7, resize_file_size = 20,
+ exp_fail = True)
+
+ def test_very_large_msg_under(self):
+ self._resize_test(queue_name = "very_large_msg_under",
+ num_msgs = 4, msg_size = 2000000,
+ init_num_files = 8, init_file_size = 24,
+ resize_num_files = 6, resize_file_size = 8,
+ exp_fail = True)
diff --git a/qpid/cpp/src/tests/legacystore/python_tests/store_test.py b/qpid/cpp/src/tests/legacystore/python_tests/store_test.py
new file mode 100644
index 0000000000..2fcab4e38e
--- /dev/null
+++ b/qpid/cpp/src/tests/legacystore/python_tests/store_test.py
@@ -0,0 +1,416 @@
+#
+# 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.
+#
+
+import re
+from brokertest import BrokerTest
+from qpid.messaging import Empty
+from qmf.console import Session
+
+
+def store_args(store_dir = None):
+ """Return the broker args necessary to load the async store"""
+ assert BrokerTest.store_lib
+ if store_dir == None:
+ return []
+ return ["--store-dir", store_dir]
+
+class Qmf:
+ """
+ QMF functions not yet available in the new QMF API. Remove this and replace with new API when it becomes available.
+ """
+ def __init__(self, broker):
+ self.__session = Session()
+ self.__broker = self.__session.addBroker("amqp://localhost:%d"%broker.port())
+
+ def add_exchange(self, exchange_name, exchange_type, alt_exchange_name=None, passive=False, durable=False,
+ arguments = None):
+ """Add a new exchange"""
+ amqp_session = self.__broker.getAmqpSession()
+ if arguments == None:
+ arguments = {}
+ if alt_exchange_name:
+ amqp_session.exchange_declare(exchange=exchange_name, type=exchange_type,
+ alternate_exchange=alt_exchange_name, passive=passive, durable=durable,
+ arguments=arguments)
+ else:
+ amqp_session.exchange_declare(exchange=exchange_name, type=exchange_type, passive=passive, durable=durable,
+ arguments=arguments)
+
+ def add_queue(self, queue_name, alt_exchange_name=None, passive=False, durable=False, arguments = None):
+ """Add a new queue"""
+ amqp_session = self.__broker.getAmqpSession()
+ if arguments == None:
+ arguments = {}
+ if alt_exchange_name:
+ amqp_session.queue_declare(queue_name, alternate_exchange=alt_exchange_name, passive=passive,
+ durable=durable, arguments=arguments)
+ else:
+ amqp_session.queue_declare(queue_name, passive=passive, durable=durable, arguments=arguments)
+
+ def delete_queue(self, queue_name):
+ """Delete an existing queue"""
+ amqp_session = self.__broker.getAmqpSession()
+ amqp_session.queue_delete(queue_name)
+
+ def _query(self, name, _class, package, alt_exchange_name=None):
+ """Qmf query function which can optionally look for the presence of an alternate exchange name"""
+ try:
+ obj_list = self.__session.getObjects(_class=_class, _package=package)
+ found = False
+ for obj in obj_list:
+ if obj.name == name:
+ found = True
+ if alt_exchange_name != None:
+ alt_exch_list = self.__session.getObjects(_objectId=obj.altExchange)
+ if len(alt_exch_list) == 0 or alt_exch_list[0].name != alt_exchange_name:
+ return False
+ break
+ return found
+ except Exception:
+ return False
+
+
+ def query_exchange(self, exchange_name, alt_exchange_name=None):
+ """Test for the presence of an exchange, and optionally whether it has an alternate exchange set to a known
+ value."""
+ return self._query(exchange_name, "exchange", "org.apache.qpid.broker", alt_exchange_name)
+
+ def query_queue(self, queue_name, alt_exchange_name=None):
+ """Test for the presence of an exchange, and optionally whether it has an alternate exchange set to a known
+ value."""
+ return self._query(queue_name, "queue", "org.apache.qpid.broker", alt_exchange_name)
+
+ def queue_message_count(self, queue_name):
+ """Query the number of messages on a queue"""
+ queue_list = self.__session.getObjects(_class="queue", _name=queue_name)
+ if len(queue_list):
+ return queue_list[0].msgDepth
+
+ def queue_empty(self, queue_name):
+ """Check if a queue is empty (has no messages waiting)"""
+ return self.queue_message_count(queue_name) == 0
+
+ def get_objects(self, target_class, target_package="org.apache.qpid.broker"):
+ return self.__session.getObjects(_class=target_class, _package=target_package)
+
+
+ def close(self):
+ self.__session.delBroker(self.__broker)
+ self.__session = None
+
+
+class StoreTest(BrokerTest):
+ """
+ This subclass of BrokerTest adds some convenience test/check functions
+ """
+
+ def _chk_empty(self, queue, receiver):
+ """Check if a queue is empty (has no more messages)"""
+ try:
+ msg = receiver.fetch(timeout=0)
+ self.assert_(False, "Queue \"%s\" not empty: found message: %s" % (queue, msg))
+ except Empty:
+ pass
+
+ @staticmethod
+ def make_message(msg_count, msg_size):
+ """Make message content. Format: 'abcdef....' followed by 'msg-NNNN', where NNNN is the message count"""
+ msg = "msg-%04d" % msg_count
+ msg_len = len(msg)
+ buff = ""
+ if msg_size != None and msg_size > msg_len:
+ for index in range(0, msg_size - msg_len):
+ if index == msg_size - msg_len - 1:
+ buff += "-"
+ else:
+ buff += chr(ord('a') + (index % 26))
+ return buff + msg
+
+ # Functions for formatting address strings
+
+ @staticmethod
+ def _fmt_csv(string_list, list_braces = None):
+ """Format a list using comma-separation. Braces are optionally added."""
+ if len(string_list) == 0:
+ return ""
+ first = True
+ str_ = ""
+ if list_braces != None:
+ str_ += list_braces[0]
+ for string in string_list:
+ if string != None:
+ if first:
+ first = False
+ else:
+ str_ += ", "
+ str_ += string
+ if list_braces != None:
+ str_ += list_braces[1]
+ return str_
+
+ def _fmt_map(self, string_list):
+ """Format a map {l1, l2, l3, ...} from a string list. Each item in the list must be a formatted map
+ element('key:val')."""
+ return self._fmt_csv(string_list, list_braces="{}")
+
+ def _fmt_list(self, string_list):
+ """Format a list [l1, l2, l3, ...] from a string list."""
+ return self._fmt_csv(string_list, list_braces="[]")
+
+ def addr_fmt(self, node_name, **kwargs):
+ """Generic AMQP to new address formatter. Takes common (but not all) AMQP options and formats an address
+ string."""
+ # Get keyword args
+ node_subject = kwargs.get("node_subject")
+ create_policy = kwargs.get("create_policy")
+ delete_policy = kwargs.get("delete_policy")
+ assert_policy = kwargs.get("assert_policy")
+ mode = kwargs.get("mode")
+ link = kwargs.get("link", False)
+ link_name = kwargs.get("link_name")
+ node_type = kwargs.get("node_type")
+ durable = kwargs.get("durable", False)
+ link_reliability = kwargs.get("link_reliability")
+ x_declare_list = kwargs.get("x_declare_list", [])
+ x_bindings_list = kwargs.get("x_bindings_list", [])
+ x_subscribe_list = kwargs.get("x_subscribe_list", [])
+
+ node_flag = not link and (node_type != None or durable or len(x_declare_list) > 0 or len(x_bindings_list) > 0)
+ link_flag = link and (link_name != None or durable or link_reliability != None or len(x_declare_list) > 0 or
+ len(x_bindings_list) > 0 or len(x_subscribe_list) > 0)
+ assert not (node_flag and link_flag)
+
+ opt_str_list = []
+ if create_policy != None:
+ opt_str_list.append("create: %s" % create_policy)
+ if delete_policy != None:
+ opt_str_list.append("delete: %s" % delete_policy)
+ if assert_policy != None:
+ opt_str_list.append("assert: %s" % assert_policy)
+ if mode != None:
+ opt_str_list.append("mode: %s" % mode)
+ if node_flag or link_flag:
+ node_str_list = []
+ if link_name != None:
+ node_str_list.append("name: \"%s\"" % link_name)
+ if node_type != None:
+ node_str_list.append("type: %s" % node_type)
+ if durable:
+ node_str_list.append("durable: True")
+ if link_reliability != None:
+ node_str_list.append("reliability: %s" % link_reliability)
+ if len(x_declare_list) > 0:
+ node_str_list.append("x-declare: %s" % self._fmt_map(x_declare_list))
+ if len(x_bindings_list) > 0:
+ node_str_list.append("x-bindings: %s" % self._fmt_list(x_bindings_list))
+ if len(x_subscribe_list) > 0:
+ node_str_list.append("x-subscribe: %s" % self._fmt_map(x_subscribe_list))
+ if node_flag:
+ opt_str_list.append("node: %s" % self._fmt_map(node_str_list))
+ else:
+ opt_str_list.append("link: %s" % self._fmt_map(node_str_list))
+ addr_str = node_name
+ if node_subject != None:
+ addr_str += "/%s" % node_subject
+ if len(opt_str_list) > 0:
+ addr_str += "; %s" % self._fmt_map(opt_str_list)
+ return addr_str
+
+ def snd_addr(self, node_name, **kwargs):
+ """ Create a send (node) address"""
+ # Get keyword args
+ topic = kwargs.get("topic")
+ topic_flag = kwargs.get("topic_flag", False)
+ auto_create = kwargs.get("auto_create", True)
+ auto_delete = kwargs.get("auto_delete", False)
+ durable = kwargs.get("durable", False)
+ exclusive = kwargs.get("exclusive", False)
+ ftd_count = kwargs.get("ftd_count")
+ ftd_size = kwargs.get("ftd_size")
+ policy = kwargs.get("policy", "flow-to-disk")
+ exchage_type = kwargs.get("exchage_type")
+
+ create_policy = None
+ if auto_create:
+ create_policy = "always"
+ delete_policy = None
+ if auto_delete:
+ delete_policy = "always"
+ node_type = None
+ if topic != None or topic_flag:
+ node_type = "topic"
+ x_declare_list = ["\"exclusive\": %s" % exclusive]
+ if ftd_count != None or ftd_size != None:
+ queue_policy = ["\'qpid.policy_type\': %s" % policy]
+ if ftd_count:
+ queue_policy.append("\'qpid.max_count\': %d" % ftd_count)
+ if ftd_size:
+ queue_policy.append("\'qpid.max_size\': %d" % ftd_size)
+ x_declare_list.append("arguments: %s" % self._fmt_map(queue_policy))
+ if exchage_type != None:
+ x_declare_list.append("type: %s" % exchage_type)
+
+ return self.addr_fmt(node_name, topic=topic, create_policy=create_policy, delete_policy=delete_policy,
+ node_type=node_type, durable=durable, x_declare_list=x_declare_list)
+
+ def rcv_addr(self, node_name, **kwargs):
+ """ Create a receive (link) address"""
+ # Get keyword args
+ auto_create = kwargs.get("auto_create", True)
+ auto_delete = kwargs.get("auto_delete", False)
+ link_name = kwargs.get("link_name")
+ durable = kwargs.get("durable", False)
+ browse = kwargs.get("browse", False)
+ exclusive = kwargs.get("exclusive", False)
+ binding_list = kwargs.get("binding_list", [])
+ ftd_count = kwargs.get("ftd_count")
+ ftd_size = kwargs.get("ftd_size")
+ policy = kwargs.get("policy", "flow-to-disk")
+
+ create_policy = None
+ if auto_create:
+ create_policy = "always"
+ delete_policy = None
+ if auto_delete:
+ delete_policy = "always"
+ mode = None
+ if browse:
+ mode = "browse"
+ x_declare_list = ["\"exclusive\": %s" % exclusive]
+ if ftd_count != None or ftd_size != None:
+ queue_policy = ["\'qpid.policy_type\': %s" % policy]
+ if ftd_count:
+ queue_policy.append("\'qpid.max_count\': %d" % ftd_count)
+ if ftd_size:
+ queue_policy.append("\'qpid.max_size\': %d" % ftd_size)
+ x_declare_list.append("arguments: %s" % self._fmt_map(queue_policy))
+ x_bindings_list = []
+ for binding in binding_list:
+ x_bindings_list.append("{exchange: %s, key: %s}" % binding)
+ if durable: reliability = 'at-least-once'
+ else: reliability = None
+ return self.addr_fmt(node_name, create_policy=create_policy, delete_policy=delete_policy, mode=mode, link=True,
+ link_name=link_name, durable=durable, x_declare_list=x_declare_list,
+ x_bindings_list=x_bindings_list, link_reliability=reliability)
+
+ def check_message(self, broker, queue, exp_msg, transactional=False, empty=False, ack=True, browse=False):
+ """Check that a message is on a queue by dequeuing it and comparing it to the expected message"""
+ return self.check_messages(broker, queue, [exp_msg], transactional, empty, ack, browse)
+
+ def check_messages(self, broker, queue, exp_msg_list, transactional=False, empty=False, ack=True, browse=False,
+ emtpy_flag=False):
+ """Check that messages is on a queue by dequeuing them and comparing them to the expected messages"""
+ if emtpy_flag:
+ num_msgs = 0
+ else:
+ num_msgs = len(exp_msg_list)
+ ssn = broker.connect().session(transactional=transactional)
+ rcvr = ssn.receiver(self.rcv_addr(queue, browse=browse), capacity=num_msgs)
+ if num_msgs > 0:
+ try:
+ recieved_msg_list = [rcvr.fetch(timeout=0) for i in range(num_msgs)]
+ except Empty:
+ self.assert_(False, "Queue \"%s\" is empty, unable to retrieve expected message %d." % (queue, i))
+ for i in range(0, len(recieved_msg_list)):
+ self.assertEqual(recieved_msg_list[i].content, exp_msg_list[i].content)
+ self.assertEqual(recieved_msg_list[i].correlation_id, exp_msg_list[i].correlation_id)
+ if empty:
+ self._chk_empty(queue, rcvr)
+ if ack:
+ ssn.acknowledge()
+ if transactional:
+ ssn.commit()
+ ssn.connection.close()
+ else:
+ if transactional:
+ ssn.commit()
+ return ssn
+
+
+ # Functions for finding strings in the broker log file (or other files)
+
+ @staticmethod
+ def _read_file(file_name):
+ """Returns the content of file named file_name as a string"""
+ file_handle = file(file_name)
+ try:
+ return file_handle.read()
+ finally:
+ file_handle.close()
+
+ def _get_hits(self, broker, search):
+ """Find all occurrences of the search in the broker log (eliminating possible duplicates from msgs on multiple
+ queues)"""
+ # TODO: Use sets when RHEL-4 is no longer supported
+ hits = []
+ for hit in search.findall(self._read_file(broker.log)):
+ if hit not in hits:
+ hits.append(hit)
+ return hits
+
+ def _reconsile_hits(self, broker, ftd_msgs, release_hits):
+ """Remove entries from list release_hits if they match the message id in ftd_msgs. Check for remaining
+ release_hits."""
+ for msg in ftd_msgs:
+ found = False
+ for hit in release_hits:
+ if str(msg.id) in hit:
+ release_hits.remove(hit)
+ #print "Found %s in %s" % (msg.id, broker.log)
+ found = True
+ break
+ if not found:
+ self.assert_(False, "Unable to locate released message %s in log %s" % (msg.id, broker.log))
+ if len(release_hits) > 0:
+ err = "Messages were unexpectedly released in log %s:\n" % broker.log
+ for hit in release_hits:
+ err += " %s\n" % hit
+ self.assert_(False, err)
+
+ def check_msg_release(self, broker, ftd_msgs):
+ """ Check for 'Content released' messages in broker log for messages in ftd_msgs"""
+ hits = self._get_hits(broker, re.compile("debug Message id=\"[0-9a-f-]{36}\"; pid=0x[0-9a-f]+: "
+ "Content released$", re.MULTILINE))
+ self._reconsile_hits(broker, ftd_msgs, hits)
+
+ def check_msg_release_on_commit(self, broker, ftd_msgs):
+ """ Check for 'Content released on commit' messages in broker log for messages in ftd_msgs"""
+ hits = self._get_hits(broker, re.compile("debug Message id=\"[0-9a-f-]{36}\"; pid=0x[0-9a-f]+: "
+ "Content released on commit$", re.MULTILINE))
+ self._reconsile_hits(broker, ftd_msgs, hits)
+
+ def check_msg_release_on_recover(self, broker, ftd_msgs):
+ """ Check for 'Content released after recovery' messages in broker log for messages in ftd_msgs"""
+ hits = self._get_hits(broker, re.compile("debug Message id=\"[0-9a-f-]{36}\"; pid=0x[0-9a-f]+: "
+ "Content released after recovery$", re.MULTILINE))
+ self._reconsile_hits(broker, ftd_msgs, hits)
+
+ def check_msg_block(self, broker, ftd_msgs):
+ """Check for 'Content release blocked' messages in broker log for messages in ftd_msgs"""
+ hits = self._get_hits(broker, re.compile("debug Message id=\"[0-9a-f-]{36}\"; pid=0x[0-9a-f]+: "
+ "Content release blocked$", re.MULTILINE))
+ self._reconsile_hits(broker, ftd_msgs, hits)
+
+ def check_msg_block_on_commit(self, broker, ftd_msgs):
+ """Check for 'Content release blocked' messages in broker log for messages in ftd_msgs"""
+ hits = self._get_hits(broker, re.compile("debug Message id=\"[0-9a-f-]{36}\"; pid=0x[0-9a-f]+: "
+ "Content release blocked on commit$", re.MULTILINE))
+ self._reconsile_hits(broker, ftd_msgs, hits)
+
+
diff --git a/qpid/cpp/src/tests/legacystore/run_python_tests b/qpid/cpp/src/tests/legacystore/run_python_tests
index d9dec16963..130dee05f8 100644..100755
--- a/qpid/cpp/src/tests/legacystore/run_python_tests
+++ b/qpid/cpp/src/tests/legacystore/run_python_tests
@@ -18,47 +18,25 @@
# under the License.
#
-if test -z ${QPID_DIR} ; then
- cat <<EOF
+source ../test_env.sh
- =========== WARNING: PYTHON TESTS DISABLED ==============
-
- QPID_DIR not set.
-
- ===========================================================
-
-EOF
- exit
-fi
-
-. `dirname $0`/tests_env.sh
+#Add our directory to the python path
+export PYTHONPATH=$srcdir/legacystore:$PYTHONPATH
MODULENAME=python_tests
echo "Running Python tests in module ${MODULENAME}..."
-case x$1 in
- xSHORT_TEST)
- DEFAULT_PYTHON_TESTS="*.client_persistence.ExchangeQueueTests.* *.flow_to_disk.SimpleMaxSizeCountTest.test_browse_recover *.flow_to_disk.SimpleMaxSizeCountTest.test_durable_browse_recover *.flow_to_disk.MultiDurableQueueDurableMsgBrowseRecoverTxPTxCTest.test_mixed_limit_2" ;;
- xLONG_TEST)
- DEFAULT_PYTHON_TESTS= ;;
- x)
- DEFAULT_PYTHON_TESTS="*.client_persistence.* *.flow_to_disk.SimpleMaxSizeCountTest.* *.flow_to_disk.MultiDurableQueue*.test_mixed_limit_1 *.flow_to_disk.MultiQueue*.test_mixed_limit_1 *.resize.SimpleTest.* *.federation.*" ;;
- *)
- DEFAULT_PYTHON_TESTS=$1
-esac
-
-PYTHON_TESTS=${PYTHON_TESTS:-${DEFAULT_PYTHON_TESTS}}
+test -d $PYTHON_DIR || { echo "Skipping python tests, no python dir."; exit 0; }
+QPID_PORT=${QPID_PORT:-5672}
+FAILING=${FAILING:-/dev/null}
+PYTHON_TESTS=${PYTHON_TESTS:-$*}
OUTDIR=${MODULENAME}.tmp
rm -rf $OUTDIR
# To debug a test, add the following options to the end of the following line:
# -v DEBUG -c qpid.messaging.io.ops [*.testName]
-${PYTHON_DIR}/qpid-python-test -m ${MODULENAME} -I ${FAILING_PYTHON_TESTS} ${PYTHON_TESTS} -DOUTDIR=$OUTDIR #-v DEBUG
-RETCODE=$?
+${QPID_PYTHON_TEST} -m ${MODULENAME} -I $FAILING -DOUTDIR=$OUTDIR \
+ $PYTHON_TEST || exit 1
-if test x${RETCODE} != x0; then
- exit 1;
-fi
-exit 0
diff --git a/qpid/cpp/src/tests/legacystore/run_test b/qpid/cpp/src/tests/legacystore/run_test
deleted file mode 100644
index 1d5c2ae407..0000000000
--- a/qpid/cpp/src/tests/legacystore/run_test
+++ /dev/null
@@ -1,69 +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.
-#
-
-# Set up environment and run a test executable or script.
-#
-# Output nothing if test passes, show the output if it fails and
-# leave output in <test>.log for examination.
-#
-# If qpidd.port exists run test with QPID_PORT=`cat qpidd.port`
-#
-# If $VALGRIND if is set run under valgrind. If there are valgrind
-# erros show valgrind output, also leave it in <test>.valgrind for
-# examination.
-#
-
-source `dirname $0`/vg_check
-
-# Export variables from makefile.
-export VALGRIND srcdir
-
-# Export QPID_PORT if qpidd.port exists.
-test -f qpidd.port && export QPID_PORT=`cat qpidd.port`
-
-# Avoid silly libtool error messages if these are not defined
-test -z "$LC_ALL" && export LC_ALL=
-test -z "$LC_CTYPE" && export LC_CTYPE=
-test -z "$LC_COLLATE" && export LC_COLLATE=
-test -z "$LC_MESSAGES" && export LC_MESSAGES=
-
-VG_LOG="$1.vglog"
-rm -f $VG_LOG*
-
-if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then
- # This is a libtool "executable". Valgrind it if VALGRIND specified.
- test -n "$VALGRIND" && VALGRIND="$VALGRIND --log-file=$VG_LOG --"
- # Hide output unless there's an error.
- libtool --mode=execute $VALGRIND "$@" 2>&1 || ERROR=$?
- test -n "$VALGRIND" && vg_check $VG_LOG*
-else
- # This is a non-libtool shell script, just execute it.
- export VALGRIND srcdir
- exec "$@"
-fi
-
-if test -z "$ERROR"; then
- # Clean up logs if there was no error.
- rm -f $VG_LOG*
- exit 0
-else
- exit $ERROR
-fi
diff --git a/qpid/cpp/src/tests/ping_broker b/qpid/cpp/src/tests/ping_broker
index be99a6ef46..bdf48f3358 100755
--- a/qpid/cpp/src/tests/ping_broker
+++ b/qpid/cpp/src/tests/ping_broker
@@ -57,7 +57,7 @@ def OptionsAndArguments(argv):
parser.add_option("-t", "--timeout", action="store", type="int", default=10, metavar="<secs>",
help="Maximum time to wait for broker connection (in seconds)")
parser.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>",
- help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
parser.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
parser.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
parser.add_option("--ssl-trustfile", action="store", type="string", metavar="<CA>", help="List of trusted CAs (PEM Format)")
diff --git a/qpid/cpp/src/tests/qpid-cluster-benchmark b/qpid/cpp/src/tests/qpid-cluster-benchmark
index b72964c1a7..f20ac6ac30 100755
--- a/qpid/cpp/src/tests/qpid-cluster-benchmark
+++ b/qpid/cpp/src/tests/qpid-cluster-benchmark
@@ -1,5 +1,5 @@
#!/bin/sh
-echo#
+#
# 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
diff --git a/qpid/cpp/src/tests/reject_release.py b/qpid/cpp/src/tests/reject_release.py
new file mode 100644
index 0000000000..d072b8aa78
--- /dev/null
+++ b/qpid/cpp/src/tests/reject_release.py
@@ -0,0 +1,65 @@
+#
+# 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.
+#
+
+from qpid.tests.messaging.implementation import *
+from qpid.tests.messaging import VersionTest
+
+class RejectReleaseTests (VersionTest):
+ """
+ Tests for reject and release with qpidd
+ """
+ def test_reject(self):
+ name = str(uuid4())
+ snd = self.ssn.sender("%s; {create:always, node:{properties:{alternate-exchange:amq.fanout}}}" % name)
+ rcv = self.ssn.receiver(name)
+ rcv2 = self.ssn.receiver("amq.fanout")
+
+ msgs = [Message(content=s, subject = s) for s in ['a','b','c','d']]
+
+ for m in msgs: snd.send(m)
+
+ for expected in msgs:
+ msg = rcv.fetch(0)
+ assert msg.content == expected.content
+ self.ssn.reject(msg)
+
+ for expected in msgs:
+ msg = rcv2.fetch(0)
+ assert msg.content == expected.content
+
+ def test_release(self):
+ snd = self.ssn.sender("#")
+ rcv = self.ssn.receiver(snd.target)
+
+ msgs = [Message(content=s, subject = s) for s in ['a','b','c','d']]
+
+ for m in msgs: snd.send(m)
+
+ msg = rcv.fetch(0)
+ assert msg.content == "a"
+ self.ssn.release(msg)
+
+ msg = rcv.fetch(0)
+ assert msg.content == "a"
+ self.ssn.acknowledge(msg)
+
+ msg = rcv.fetch(0)
+ assert msg.content == "b"
+ self.ssn.release(msg)
+
diff --git a/qpid/cpp/src/tests/swig_python_tests b/qpid/cpp/src/tests/swig_python_tests
index 6f862ffa2d..cfe1c406d2 100755
--- a/qpid/cpp/src/tests/swig_python_tests
+++ b/qpid/cpp/src/tests/swig_python_tests
@@ -50,10 +50,10 @@ start_broker
echo "Running swigged python tests using broker on port $QPID_PORT"
export PYTHONPATH=$PYTHONPATH:$PYTHONPATH_SWIG
+export QPID_USE_SWIG_CLIENT=1
$QPID_PYTHON_TEST -m qpid.tests.messaging.message -m qpid_tests.broker_0_10.priority -m qpid_tests.broker_0_10.lvq -m qpid_tests.broker_0_10.new_api -b localhost:$QPID_PORT -I $srcdir/failing-amqp0-10-python-tests || FAILED=1
-if [[ -a $AMQPC_LIB ]] ; then
- export QPID_LOAD_MODULE=$AMQPC_LIB
- $QPID_PYTHON_TEST --define="protocol_version=amqp1.0" -m qpid_tests.broker_1_0 -m qpid_tests.broker_0_10.new_api -b localhost:$QPID_PORT -I $srcdir/failing-amqp1.0-python-tests || FAILED=1
+if [[ -a $AMQP_LIB ]] ; then
+ $QPID_PYTHON_TEST --define="protocol_version=amqp1.0" -m qpid_tests.broker_1_0 -m qpid_tests.broker_0_10.new_api -m assertions -m reject_release -b localhost:$QPID_PORT -I $srcdir/failing-amqp1.0-python-tests || FAILED=1
fi
stop_broker
if [[ $FAILED -eq 1 ]]; then
diff --git a/qpid/cpp/src/tests/test_env.sh.in b/qpid/cpp/src/tests/test_env.sh.in
index 486034ca3b..f45d3708a2 100644
--- a/qpid/cpp/src/tests/test_env.sh.in
+++ b/qpid/cpp/src/tests/test_env.sh.in
@@ -67,7 +67,6 @@ exportmodule HA_LIB ha.so
exportmodule XML_LIB xml.so
exportmodule STORE_LIB legacystore.so
exportmodule AMQP_LIB amqp.so
-exportmodule AMQPC_LIB amqpc.so
# Qpid options
export QPID_NO_MODULE_DIR=1 # Don't accidentally load installed modules
diff --git a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml b/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml
index 78272b7ef4..e693ee463b 100644
--- a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml
+++ b/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml
@@ -52,9 +52,6 @@
<listitem><para>
<itemizedlist>
<listitem><para>
- <xref linkend="CheatSheetforconfiguringQueueOptions-PersistLastNode"/>
- </para></listitem>
- <listitem><para>
<xref linkend="CheatSheetforconfiguringQueueOptions-Queueeventgeneration"/>
</para></listitem>
</itemizedlist>
@@ -182,37 +179,6 @@
<section role="h3" id="CheatSheetforconfiguringQueueOptions-Settingadditionalbehaviors"><title>
Setting additional behaviors
</title>
- <section role="h4" id="CheatSheetforconfiguringQueueOptions-PersistLastNode"><title>
- Persist
- Last Node
- </title>
- <para>
- This option is used in conjunction with clustering. It allows for
- a queue configured with this option to persist transient messages
- if the cluster fails down to the last node. If additional nodes
- in the cluster are restored it will stop persisting transient
- messages.
- </para><para>
- Note
- </para><itemizedlist>
- <listitem><para>if a cluster is started with only one active node, this mode
- will not be triggered. It is only triggered the first time the
- cluster fails down to 1 node.
- </para></listitem>
- <listitem><para>The queue MUST be configured durable
- </para></listitem>
- </itemizedlist><para>
- Example:
- </para>
- <programlisting>
-#include "qpid/client/QueueOptions.h"
-
- QueueOptions qo;
- qo.clearPersistLastNode();
-
- session.queueDeclare(arg::queue=queue, arg::durable=true, arg::arguments=qo);
-</programlisting>
- <!--h4--></section>
<section role="h4" id="CheatSheetforconfiguringQueueOptions-Queueeventgeneration"><title>
Queue
event generation
diff --git a/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml b/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml
index d2abea4296..d6e52c4fdf 100644
--- a/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml
+++ b/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml
@@ -70,7 +70,6 @@ Options:
Add Queue Options:
--durable Queue is durable
- --cluster-durable Queue becomes durable if there is only one functioning cluster node
--file-count N (8) Number of files in queue's persistence journal
--file-size N (24) File size in pages (64Kib/page)
--max-queue-size N Maximum in-memory queue size as bytes
diff --git a/qpid/doc/book/src/java-broker/Java-Broker-Concepts-Exchanges.xml b/qpid/doc/book/src/java-broker/Java-Broker-Concepts-Exchanges.xml
index 1692fdc038..1018f95b04 100644
--- a/qpid/doc/book/src/java-broker/Java-Broker-Concepts-Exchanges.xml
+++ b/qpid/doc/book/src/java-broker/Java-Broker-Concepts-Exchanges.xml
@@ -22,34 +22,184 @@
<section id="Java-Broker-Concepts-Exchanges">
<title>Exchanges</title>
-<para>An <emphasis>Exchange</emphasis> is a named entity within the <emphasis>Virtual Host</emphasis> which receives
-messages from producers and routes them to matching message <emphasis>Queue</emphasis>s within the <emphasis>Virtual Host</emphasis>.
-Message routing occurs based on the particular Exchange's routing algorithm and its configured queue <emphasis>Binding</emphasis>s.</para>
-<para>
-The following <emphasis>Exchange</emphasis> types are supported by the <emphasis>Broker</emphasis>:
- <itemizedlist>
- <listitem><para><emphasis>Direct</emphasis>: routes messages to queues based on an exact match between
- the routing key of the message, and the binding key used to bind the queue to the exchange
- </para></listitem>
- <listitem><para><emphasis>Topic</emphasis>: routes messages to queues based on heirarchical pattern matching between the routing
- key for each message and the binding keys used to bind Queues to the Exchange. This exchange type is used to support the classic
- publish/subscribe paradigm using a topic namespace as the addressing model to select and deliver messages across multiple
- consumers based on a partial or full match on a topic pattern.
- </para>
- <para>
- Binding and routing keys for this Exchange use a "." deliminator to seperate words representing different levels of the heirarchy,
- with special meaning given to use of * and # as a word within a binding key such that a * matches any single word in a routing
- key and # matches zero or more words, allowing a binding key to match many routing keys for published messages. For example,
- a binding key of <emphasis>a.b.#</emphasis> would match the routing keys <emphasis>a.b</emphasis>, <emphasis>a.b.c</emphasis>, and
- <emphasis>a.b.c.d</emphasis>, but not the routing key <emphasis>a.z</emphasis>.</para></listitem>
- <listitem><para><emphasis>Fanout</emphasis>: routes messages to all queues bound to the exchange, regardless of the message's routing key.
- </para></listitem>
- <listitem><para><emphasis>Headers</emphasis>: routes messages to queues based on header properties within the AMQP message.
- The message is passed to a queue if the header properties of the message satisfy header matching arguments table with which the queue was bound.
- </para></listitem>
- </itemizedlist>
-</para>
-<para>Also, Broker supports the concept of a Default Exchange to which all queues are bound using their name as a binding key.</para>
-<para>Any number of exchanges of any type can be created on <emphasis>Virtual Host</emphasis>.</para>
-<para>Exchange configuration is covered in <xref linkend="Java-Broker-Exchanges"/>.</para>
+ <para>An <emphasis>Exchange</emphasis> is a named entity within the <emphasis>Virtual Host</emphasis> which receives
+ messages from producers and routes them to matching <emphasis>Queue</emphasis>s within the <emphasis>Virtual Host</emphasis>.</para>
+ <para>The server provides a set of exchange types with each exchange type implementing a different routing algorithm. For details of how
+ these exchanges types work see <xref linkend="Java-Broker-Concepts-Exchanges-Types"/> below.</para>
+ <para>The server predeclares a number of exchange instances with names starting with &quot;<literal>amq.</literal>&quot;. These are defined in
+ <xref linkend="Java-Broker-Concepts-Exchanges-Predeclared"/>.</para>
+ <para>Applications can make use the pre-declared exchanges, or they may declare their own. The number of exchanges within a virtual host is
+ limited only by resource constraints.</para>
+ <para>The behaviour when an exchange is unable to route a message to any queue is defined in <xref linkend="Java-Broker-Concepts-Exchanges-UnroutableMessage"/></para>
+ <para>Exchange configuration is covered in <xref linkend="Java-Broker-Exchanges"/>.</para>
+ <section id="Java-Broker-Concepts-Exchanges-Predeclared">
+ <title>Predeclared Exchanges</title>
+ <para>Each virtual host pre-declares the following exchanges:
+ <itemizedlist>
+ <listitem>amq.direct (an instance of a direct exchange)</listitem>
+ <listitem>amq.topic (an instance of a topic exchange)</listitem>
+ <listitem>amq.fanout (an instance of a fanout exchange)</listitem>
+ <listitem>amq.match (an instance of a headers exchange)</listitem>
+ </itemizedlist>
+ </para>
+ <para>The conceptual &quot;<literal>default exchange</literal>&quot; always exists, effectively a special instance of
+ direct exchange which uses the empty string as its name. All queues are automatically bound to it upon their creation
+ using the queue name as the binding key, and unbound upon their deletion. It is not possible to manually add or remove
+ bindings within this exchange.</para>
+ <para>Applications may not declare exchanges with names beginning with &quot;<literal>amq.</literal>&quot;. Such names are reserved for system use.</para>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-Types">
+ <title>Exchange Types</title>
+ <para>
+ The following Exchange types are supported.
+ <itemizedlist>
+ <listitem>Direct</listitem>
+ <listitem>Topic</listitem>
+ <listitem>Fanout</listitem>
+ <listitem>Headers</listitem>
+ </itemizedlist>
+ These exchange types are described in the following sub-sections.</para>
+
+ <section id="Java-Broker-Concepts-Exchanges-Types-Direct">
+ <title>Direct</title>
+ <para>The direct exchange type routes messages to queues based on an exact match between
+ the routing key of the message, and the binding key used to bind the queue to the exchange. Additional
+ filter rules may be specified using a <link linkend="Java-Broker-Concepts-Exchanges-BindingArguments-JMSSelector">
+ binding argument specifying a JMS message selector</link>.
+ </para>
+ <para>This exchange type is often used to implement point to point messaging. When used in this manner, the normal
+ convention is that the binding key matches the name of the queue. It is also possible to use this exchange type
+ for multi-cast, in this case the same binding key is associated with many queues.</para>
+ <figure>
+ <title>Direct exchange</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Exchange-Direct.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The figure above illustrates the operation of direct exchange type. The yellow messages published with the routing key
+ &quot;<literal>myqueue</literal>&quot; match the binding key corresponding to queue &quot;<literal>myqueue</literal>&quot; and so are routed there. The red
+ messages published with the routing key &quot;<literal>foo</literal>&quot; match two bindings in the table so a copy of the message is
+ routed to both the &quot;<literal>bar1</literal>&quot; and &quot;<literal>bar2</literal>&quot; queues.</para>
+ <para>The routing key of the blue message matches no binding keys, so the message is unroutable. It is handled as described
+ in <xref linkend="Java-Broker-Concepts-Exchanges-UnroutableMessage"/>.</para>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-Types-Topic">
+ <title>Topic</title>
+ <para>This exchange type is used to support the classic publish/subscribe paradigm.</para>
+ <para>The topic exchange is capable of routing messages to queues based on wildcard matches between the routing key and the
+ binding key pattern defined by the queue binding. Routing keys are formed from one or more words, with each word delimited
+ by a full-stop (.). The pattern matching characters are the * and # symbols. The * symbol matches a single word and the #
+ symbol matches zero or more words.</para>
+ <para>Additional filter rules may be specified using a <link linkend="Java-Broker-Concepts-Exchanges-BindingArguments-JMSSelector">
+ binding argument specifying a JMS message selector</link>.</para>
+ <para>The following three figures help explain how the topic exchange functions.</para>
+ <para></para>
+ <figure>
+ <title>Topic exchange - exact match on topic name</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Exchange-Topic.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The figure above illustrates publishing messages with routing key &quot;<literal>weather</literal>&quot;. The exchange routes each
+ message to every bound queue whose binding key matches the routing key.</para>
+ <para>In the case illustrated, this means that each subscriber's queue receives every yellow message.</para>
+ <figure>
+ <title>Topic exchange - matching on hierarchical topic patterns</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Exchange-Topic-Hierarchical.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The figure above illustrates publishing messages with hierarchical routing keys. As before, the exchange routes each
+ message to every bound queue whose binding key matches the routing key but as the binding keys contain wildcards, the
+ wildcard rules described above apply.</para>
+ <para>In the case illustrated, <literal>sub1</literal> has received the red and green message as &quot;<literal>news.uk</literal>&quot; and &quot;<literal>news.de</literal>&quot;
+ match binding key &quot;<literal>news.#</literal>&quot;. The red message has also gone to <literal>sub2</literal> and <literal>sub3</literal> as it's routing key
+ is matched exactly by &quot;<literal>news.uk</literal>&quot; and by &quot;<literal>*.uk</literal>&quot;.</para>
+ <para>The routing key of the yellow message matches no binding keys, so the message is unroutable. It is handled as described
+ in <xref linkend="Java-Broker-Concepts-Exchanges-UnroutableMessage"/>.</para>
+ <figure>
+ <title>Topic exchange - matching on JMS message selector</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Exchange-Topic-JMSSelector.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The figure above illustrates messages with properties published with routing key &quot;<literal>shipping</literal>&quot;.</para>
+ <para>As before, the exchange routes each message to every bound queue whose binding key matches the routing key but as a JMS selector
+ argument has been specified, the expression is evaluated against each matching message. Only messages whose message header values or properties
+ match the expression are routed to the queue.</para>
+ <para>In the case illustrated, <literal>sub1</literal> has received the yellow and blue message as their property &quot;<literal>area</literal>&quot;
+ cause expression &quot;<literal>area in ('Forties', 'Cromarty')</literal>&quot; to evaluate true. Similarly, the yellow message has also gone to
+ <literal>gale_alert</literal> as its property &quot;<literal>speed</literal>&quot; causes expression &quot;<literal>speed &gt; 7 and speed &lt; 10</literal>&quot;
+ to evaluate true.</para>
+ <para>The properties of purple message cause no expressions to evaluate true, so the message is unroutable. It is handled as described in
+ <xref linkend="Java-Broker-Concepts-Exchanges-UnroutableMessage"/>.</para>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-Types-Fanout">
+ <title>Fanout</title>
+ <para>The fanout exchange type routes messages to all queues bound to the exchange, regardless of the message's routing key.</para>
+ <para>Filter rules may be specified using a <link linkend="Java-Broker-Concepts-Exchanges-BindingArguments-JMSSelector">
+ binding argument specifying a JMS message selector</link>.</para>
+ <figure>
+ <title>Fanout exchange</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Exchange-Fanout.png" format="PNG" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-Types-Headers">
+ <title>Headers</title>
+ <para>The headers exchange type routes messages to queues based on header properties within the message. The message is passed to
+ a queue if the header properties of the message satisfy the <link linkend="Java-Broker-Concepts-Exchanges-BindingArguments-x-match">
+ x-match expression</link> specified by the binding arguments with which the queue was bound.
+ </para>
+ </section>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-BindingArguments">
+ <title>Binding Arguments</title>
+ <para>Binding arguments are used by certain exchange types to further filter messages.</para>
+ <section id="Java-Broker-Concepts-Exchanges-BindingArguments-JMSSelector">
+ <title>JMS Selector</title>
+ <para>The binding argument <literal>x-filter-jms-selector</literal> specifies a JMS selector conditional expression. The expression
+ is written in terms of message header and message property names. If the expression evaluates to true, the message is routed to the queue.
+ This type of binding argument is understood by exchange types direct, topic and fanout.<footnote><para>
+ This is a Qpid specific extension.</para></footnote>.</para>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-BindingArguments-x-match">
+ <title>x-match</title>
+ <para>The binding argument <literal>x-match</literal> is understood by exchange type headers. It can take two values, dictating how the
+ rest of the name value pairs are treated during matching.</para>
+ <itemizedlist>
+ <listitem><literal>all</literal> implies that all the other pairs must match the headers property of a message for that message to be routed
+ (i.e. an AND match)</listitem>
+ <listitem>any<literal></literal> implies that the message should be routed if any of the fields in the headers property match one of the
+ fields in the arguments table (i.e. an OR match)</listitem>
+ </itemizedlist>
+ <para>A field in the bind arguments matches a field in the message if either the field in the bind arguments has no value and a field of the
+ same name is present in the message headers or if the field in the bind arguments has a value and a field of the same name exists in the
+ message headers and has that same value.</para>
+ </section>
+ </section>
+ <section id="Java-Broker-Concepts-Exchanges-UnroutableMessage">
+ <title>Unrouteable Messages</title>
+ <para>If an exchange is unable to route a message to any queues, the Broker will:
+ <itemizedlist>
+ <listitem>If using AMQP 0-10 protocol, and an alternate exchange has been set on the exchange, the message is routed to the alternate exchange.
+ The alternate exchange routes the message according to its routing algorithm and its binding table. If the messages is still unroutable,
+ the message is discarded.</listitem>
+ <listitem>If using AMQP protocols 0-8..0-9-1, and the publisher set the mandatory flag and the<link linkend="Java-Broker-Close-Connection-When-No-Route">
+ close when no route</link> feature did not close the connection, the message is returned to the Producer.</listitem>
+ <listitem>Otherwise, the message is discarded.</listitem>
+ </itemizedlist>
+ </para>
+ </section>
</section>
diff --git a/qpid/doc/book/src/java-broker/commonEntities.xml b/qpid/doc/book/src/java-broker/commonEntities.xml
index a91a2311bc..0aa8a6514a 100644
--- a/qpid/doc/book/src/java-broker/commonEntities.xml
+++ b/qpid/doc/book/src/java-broker/commonEntities.xml
@@ -40,5 +40,5 @@
<!ENTITY oracleBdbProductOverviewUrl "http://www.oracle.com/technetwork/products/berkeleydb/overview/index-093405.html">
<!ENTITY oracleBdbRepGuideUrl "http://oracle.com/cd/E17277_02/html/ReplicationGuide/">
<!ENTITY oracleBdbJavaDocUrl "http://docs.oracle.com/cd/E17277_02/html/java/">
-<!ENTITY oracleBdbProductVersion "5.0.84">
+<!ENTITY oracleBdbProductVersion "5.0.97">
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Direct.png b/qpid/doc/book/src/java-broker/images/Exchange-Direct.png
new file mode 100644
index 0000000000..184fb80704
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Direct.png
Binary files differ
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Direct.svg b/qpid/doc/book/src/java-broker/images/Exchange-Direct.svg
new file mode 100644
index 0000000000..76d25fa2ab
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Direct.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="17 70 436 355" width="436pt" height="355pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-10-01 22:37Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="black"><g><path d="M 3.2 0 L 0 -1.2 L 0 1.2 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="522.94922" cap-height="717.28516" ascent="770.01953" descent="-229.98047" font-weight="500"><font-face-src><font-face-name name="Helvetica"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="-1333.3334" x-height="539.55078" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-style="italic" font-weight="bold"><font-face-src><font-face-name name="Helvetica-BoldOblique"/></font-face-src></font-face></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><g><use xl:href="#id4_Graphic" filter="url(#Shadow)"/><use xl:href="#id1902_Graphic" filter="url(#Shadow)"/><use xl:href="#id2284_Graphic" filter="url(#Shadow)"/></g><g id="id4_Graphic"><path d="M 66.296997 107.000005 L 160.297 107.000005 C 165.26756 107.000005 169.297 111.02944 169.297 116.000005 L 169.297 136.000005 C 169.297 140.97057 165.26756 145.000005 160.297 145.000005 L 66.296997 145.000005 C 61.326434 145.000005 57.296997 140.97057 57.296997 136.000005 L 57.296997 116.000005 C 57.296997 111.02944 61.326434 107.000005 66.296997 107.000005 Z" fill="#acffa2"/><path d="M 66.296997 107.000005 L 160.297 107.000005 C 165.26756 107.000005 169.297 111.02944 169.297 116.000005 L 169.297 136.000005 C 169.297 140.97057 165.26756 145.000005 160.297 145.000005 L 66.296997 145.000005 C 61.326434 145.000005 57.296997 140.97057 57.296997 136.000005 L 57.296997 116.000005 C 57.296997 111.02944 61.326434 107.000005 66.296997 107.000005 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(62.296997 112.000005)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="56.015625">Producer </tspan><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="55.576172" y="11" textLength="8.6660156">A</tspan></text></g><g id="id1902_Graphic"><path d="M 197.65201 107.500005 L 291.652 107.500005 C 296.62257 107.500005 300.652 111.52944 300.652 116.500005 L 300.652 136.500005 C 300.652 141.47057 296.62257 145.500005 291.652 145.500005 L 197.65201 145.500005 C 192.68144 145.500005 188.65201 141.47057 188.65201 136.500005 L 188.65201 116.500005 C 188.65201 111.52944 192.68144 107.500005 197.65201 107.500005 Z" fill="#acffa2"/><path d="M 197.65201 107.500005 L 291.652 107.500005 C 296.62257 107.500005 300.652 111.52944 300.652 116.500005 L 300.652 136.500005 C 300.652 141.47057 296.62257 145.500005 291.652 145.500005 L 197.65201 145.500005 C 192.68144 145.500005 188.65201 141.47057 188.65201 136.500005 L 188.65201 116.500005 C 188.65201 111.52944 192.68144 107.500005 197.65201 107.500005 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(193.65201 112.500005)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.68164">Producer B</tspan></text></g><rect x="255.297" y="90.000006" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="255.297" y="90.000006" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="256.716" y1="91.375606" x2="263.812" y2="91.375606" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="256.716" y1="92.750806" x2="263.812" y2="92.750806" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="256.716" y1="94.126806" x2="263.812" y2="94.126806" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="265.231" y1="98.253806" x2="276.585" y2="98.253806" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="265.231" y1="99.629806" x2="276.585" y2="99.629806" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="265.231" y1="101.004806" x2="276.585" y2="101.004806" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="282.261" y="91.375606" width="2.83837" height="2.75126" fill="none"/><rect x="282.261" y="91.375606" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="262.297" y="96.08351" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="262.297" y="96.08351" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="263.716" y1="97.45851" x2="270.812" y2="97.45851" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="263.716" y1="98.83451" x2="270.812" y2="98.83451" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="263.716" y1="100.20951" x2="270.812" y2="100.20951" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="272.231" y1="104.33651" x2="283.584" y2="104.33651" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="272.231" y1="105.71251" x2="283.584" y2="105.71251" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="272.231" y1="107.08751" x2="283.584" y2="107.08751" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="289.261" y="97.45851" width="2.83837" height="2.75126" fill="none"/><rect x="289.261" y="97.45851" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="124.296996" y="90.00001" width="31.222" height="16.5076" fill="#ff9"/><rect x="124.296996" y="90.00001" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="125.715996" y1="91.37501" x2="132.812" y2="91.37501" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="125.715996" y1="92.75101" x2="132.812" y2="92.75101" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="125.715996" y1="94.12701" x2="132.812" y2="94.12701" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="134.231" y1="98.25351" x2="145.585" y2="98.25351" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="134.231" y1="99.62951" x2="145.585" y2="99.62951" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="134.231" y1="101.00551" x2="145.585" y2="101.00551" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="151.261" y="91.37501" width="2.83837" height="2.75126" fill="none"/><rect x="151.261" y="91.37501" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="129.084" y="96.08351" width="31.222" height="16.5076" fill="#ff9"/><rect x="129.084" y="96.08351" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="130.503" y1="97.45851" x2="137.599" y2="97.45851" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="130.503" y1="98.83451" x2="137.599" y2="98.83451" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="130.503" y1="100.21051" x2="137.599" y2="100.21051" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="139.018" y1="104.33651" x2="150.372" y2="104.33651" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="139.018" y1="105.71251" x2="150.372" y2="105.71251" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="139.018" y1="107.08851" x2="150.372" y2="107.08851" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="156.048" y="97.45851" width="2.83837" height="2.75126" fill="none"/><rect x="156.048" y="97.45851" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="134.002" y="103.58351" width="31.222" height="16.5076" fill="#ff9"/><rect x="134.002" y="103.58351" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="135.422" y1="104.95951" x2="142.518" y2="104.95951" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="135.422" y1="106.33451" x2="142.518" y2="106.33451" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="135.422" y1="107.71051" x2="142.518" y2="107.71051" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="143.937" y1="111.83751" x2="155.29" y2="111.83751" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="143.937" y1="113.21251" x2="155.29" y2="113.21251" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="143.937" y1="114.58851" x2="155.29" y2="114.58851" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="160.967" y="104.95951" width="2.83837" height="2.75126" fill="none"/><rect x="160.967" y="104.95951" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><path d="M 133.699005 163 L 355.605 163 C 360.57557 163 364.605 167.02944 364.605 172 L 364.605 391.274 C 364.605 396.24457 360.57557 400.274 355.605 400.274 L 133.699005 400.274 C 128.72844 400.274 124.699005 396.24457 124.699005 391.274 L 124.699005 172 C 124.699005 167.02944 128.72844 163 133.699005 163 Z" fill="#78caff"/><path d="M 133.699005 163 L 355.605 163 C 360.57557 163 364.605 167.02944 364.605 172 L 364.605 391.274 C 364.605 396.24457 360.57557 400.274 355.605 400.274 L 133.699005 400.274 C 128.72844 400.274 124.699005 396.24457 124.699005 391.274 L 124.699005 172 C 124.699005 167.02944 128.72844 163 133.699005 163 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(129.699005 168)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="69.345703">Qpid Broker</tspan></text><path d="M 148.554005 211.5 L 255.554 211.5 C 260.52457 211.5 264.554 215.52944 264.554 220.5 L 264.554 311.5 C 264.554 316.47057 260.52457 320.5 255.554 320.5 L 148.554005 320.5 C 143.58344 320.5 139.554005 316.47057 139.554005 311.5 L 139.554005 220.5 C 139.554005 215.52944 143.58344 211.5 148.554005 211.5 Z" fill="#a788ff"/><path d="M 148.554005 211.5 L 255.554 211.5 C 260.52457 211.5 264.554 215.52944 264.554 220.5 L 264.554 311.5 C 264.554 316.47057 260.52457 320.5 255.554 320.5 L 148.554005 320.5 C 143.58344 320.5 139.554005 316.47057 139.554005 311.5 L 139.554005 220.5 C 139.554005 215.52944 143.58344 211.5 148.554005 211.5 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(144.554005 216.5)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="60.685547">amq.direct</tspan></text><path d="M 282.554 211.5 L 341.554 211.5 C 346.52457 211.5 350.554 215.52944 350.554 220.5 L 350.554 255.5 C 350.554 260.47057 346.52457 264.5 341.554 264.5 L 282.554 264.5 C 277.58344 264.5 273.554 260.47057 273.554 255.5 L 273.554 220.5 C 273.554 215.52944 277.58344 211.5 282.554 211.5 Z" fill="#93d9ff"/><path d="M 282.554 211.5 L 341.554 211.5 C 346.52457 211.5 350.554 215.52944 350.554 220.5 L 350.554 255.5 C 350.554 260.47057 346.52457 264.5 341.554 264.5 L 282.554 264.5 C 277.58344 264.5 273.554 260.47057 273.554 255.5 L 273.554 220.5 C 273.554 215.52944 277.58344 211.5 282.554 211.5 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(278.554 216.5)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="7.1591797" y="11" textLength="52.68164">myqueue</tspan></text><path d="M 250.19663 211.12414 C 257.98164 202.25032 264.9523 188.93692 273.554 184.5 C 282.1557 180.06309 296.25709 180.08229 301.812 184.5 C 303.83 186.10487 304.82832 188.87613 305.36258 192.17813" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 282.554 274.425 L 341.554 274.425 C 346.52457 274.425 350.554 278.45444 350.554 283.425 L 350.554 318.425 C 350.554 323.39557 346.52457 327.425 341.554 327.425 L 282.554 327.425 C 277.58344 327.425 273.554 323.39557 273.554 318.425 L 273.554 283.425 C 273.554 278.45444 277.58344 274.425 282.554 274.425 Z" fill="#93d9ff"/><path d="M 282.554 274.425 L 341.554 274.425 C 346.52457 274.425 350.554 278.45444 350.554 283.425 L 350.554 318.425 C 350.554 323.39557 346.52457 327.425 341.554 327.425 L 282.554 327.425 C 277.58344 327.425 273.554 323.39557 273.554 318.425 L 273.554 283.425 C 273.554 278.45444 277.58344 274.425 282.554 274.425 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(278.554 279.425)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="20.826172" y="11" textLength="25.347656">bar1</tspan></text><rect x="210.054" y="291.18696" width="48" height="13.6119385" fill="white"/><rect x="210.054" y="291.18696" width="48" height="13.6119385" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(215.054 292.49293)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="13.249756" y="9" textLength="11.500488">….</tspan></text><rect x="146.05401" y="291.18696" width="63.999992" height="13.6119385" fill="white"/><rect x="146.05401" y="291.18696" width="63.999992" height="13.6119385" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(151.05401 292.49293)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="23.249264" y="9" textLength="7.501465">...</tspan></text><rect x="210.054" y="277.57496" width="48" height="13.6119995" fill="white"/><rect x="210.054" y="277.57496" width="48" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(215.054 278.88096)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.993408" y="9" textLength="18.013184">bar2</tspan></text><rect x="146.05401" y="277.57496" width="63.999992" height="13.6119995" fill="white"/><rect x="146.05401" y="277.57496" width="63.999992" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(151.05401 278.88096)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="20.744381" y="9" textLength="12.5112305">foo</tspan></text><rect x="210.054" y="263.96296" width="48" height="13.6119995" fill="white"/><rect x="210.054" y="263.96296" width="48" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(215.054 265.26896)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.993408" y="9" textLength="18.013184">bar1</tspan></text><rect x="146.05401" y="263.96296" width="63.999992" height="13.6119995" fill="white"/><rect x="146.05401" y="263.96296" width="63.999992" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(151.05401 265.26896)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="20.744381" y="9" textLength="12.5112305">foo</tspan></text><rect x="210.054" y="250.35105" width="48" height="13.611908" fill="white"/><rect x="210.054" y="250.35105" width="48" height="13.611908" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(215.054 251.65701)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x=".4880371" y="9" textLength="37.023926">myqueue</tspan></text><rect x="146.05401" y="250.35105" width="63.999992" height="13.611908" fill="white"/><rect x="146.05401" y="250.35105" width="63.999992" height="13.611908" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(151.05401 251.65701)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="8.4880333" y="9" textLength="37.023926">myqueue</tspan></text><rect x="210.054" y="239.57501" width="48" height="10.776047" fill="white"/><rect x="210.054" y="239.57501" width="48" height="10.776047" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(215.054 239.46303)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="5.748291" y="9" textLength="26.503418">queue</tspan></text><rect x="146.05401" y="239.57501" width="63.999992" height="10.776047" fill="white"/><rect x="146.05401" y="239.57501" width="63.999992" height="10.776047" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(151.05401 239.46303)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x=".74486923" y="9" textLength="52.510254">binding_key</tspan></text><path d="M 222.4567 320.96876 C 224.43994 326.31197 225.22727 333.49515 228.407 337 C 231.58674 340.50486 233.90403 344.3383 241.537 342 C 245.68743 340.72856 251.76463 337.0884 258.19681 333.01168" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 282.554 337.349 L 341.554 337.349 C 346.52457 337.349 350.554 341.37844 350.554 346.349 L 350.554 381.349 C 350.554 386.31957 346.52457 390.349 341.554 390.349 L 282.554 390.349 C 277.58344 390.349 273.554 386.31957 273.554 381.349 L 273.554 346.349 C 273.554 341.37844 277.58344 337.349 282.554 337.349 Z" fill="#93d9ff"/><path d="M 282.554 337.349 L 341.554 337.349 C 346.52457 337.349 350.554 341.37844 350.554 346.349 L 350.554 381.349 C 350.554 386.31957 346.52457 390.349 341.554 390.349 L 282.554 390.349 C 277.58344 390.349 273.554 386.31957 273.554 381.349 L 273.554 346.349 C 273.554 341.37844 277.58344 337.349 282.554 337.349 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(278.554 342.349)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="20.826172" y="11" textLength="25.347656">bar2</tspan></text><path d="M 217.1713 320.98211 C 219.37232 328.98728 220.64087 338.99762 223.775 345 C 226.90914 351.00239 227.76532 354.44391 235.978 357 C 240.33458 358.35593 247.02521 358.89955 254.1924 359.2772" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="307.659" y="230.333" width="31.222" height="16.5076" fill="#ff9"/><rect x="307.659" y="230.333" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="309.078" y1="231.708" x2="316.174" y2="231.708" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="309.078" y1="233.084" x2="316.174" y2="233.084" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="309.078" y1="234.46" x2="316.174" y2="234.46" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="317.593" y1="238.587" x2="328.947" y2="238.587" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="317.593" y1="239.963" x2="328.947" y2="239.963" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="317.593" y1="241.339" x2="328.947" y2="241.339" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="334.623" y="231.708" width="2.83837" height="2.75126" fill="none"/><rect x="334.623" y="231.708" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="312.446" y="236.417" width="31.222" height="16.5076" fill="#ff9"/><rect x="312.446" y="236.417" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="313.865" y1="237.792" x2="320.961" y2="237.792" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="313.865" y1="239.168" x2="320.961" y2="239.168" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="313.865" y1="240.544" x2="320.961" y2="240.544" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="322.38" y1="244.67" x2="333.734" y2="244.67" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.38" y1="246.046" x2="333.734" y2="246.046" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.38" y1="247.422" x2="333.734" y2="247.422" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="339.41" y="237.792" width="2.83837" height="2.75126" fill="none"/><rect x="339.41" y="237.792" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="317.364" y="243.917" width="31.222" height="16.5076" fill="#ff9"/><rect x="317.364" y="243.917" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="318.783" y1="245.293" x2="325.879" y2="245.293" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="318.783" y1="246.668" x2="325.879" y2="246.668" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="318.783" y1="248.044" x2="325.879" y2="248.044" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="327.298" y1="252.171" x2="338.652" y2="252.171" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="327.298" y1="253.546" x2="338.652" y2="253.546" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="327.298" y1="254.922" x2="338.652" y2="254.922" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="344.328" y="245.293" width="2.83837" height="2.75126" fill="none"/><rect x="344.328" y="245.293" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="309.079" y="294.564" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="309.079" y="294.564" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="310.498" y1="295.94" x2="317.594" y2="295.94" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="310.498" y1="297.316" x2="317.594" y2="297.316" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="310.498" y1="298.691" x2="317.594" y2="298.691" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="319.013" y1="302.818" x2="330.366" y2="302.818" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="319.013" y1="304.194" x2="330.366" y2="304.194" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="319.013" y1="305.569" x2="330.366" y2="305.569" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="336.043" y="295.94" width="2.83837" height="2.75126" fill="none"/><rect x="336.043" y="295.94" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="312.873" y="300.984" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="312.873" y="300.984" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="314.292" y1="302.359" x2="321.388" y2="302.359" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="314.292" y1="303.736" x2="321.388" y2="303.736" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="314.292" y1="305.111" x2="321.388" y2="305.111" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="322.807" y1="309.238" x2="334.16" y2="309.238" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.807" y1="310.614" x2="334.16" y2="310.614" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.807" y1="311.989" x2="334.16" y2="311.989" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="339.837" y="302.359" width="2.83837" height="2.75126" fill="none"/><rect x="339.837" y="302.359" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="308.652" y="359.347" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="308.652" y="359.347" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="310.071" y1="360.723" x2="317.167" y2="360.723" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="310.071" y1="362.099" x2="317.167" y2="362.099" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="310.071" y1="363.474" x2="317.167" y2="363.474" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="318.586" y1="367.601" x2="329.939" y2="367.601" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="318.586" y1="368.977" x2="329.939" y2="368.977" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="318.586" y1="370.352" x2="329.939" y2="370.352" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="335.616" y="360.723" width="2.83837" height="2.75126" fill="none"/><rect x="335.616" y="360.723" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="312.446" y="365.767" width="31.222" height="16.5076" fill="#ff0b22"/><rect x="312.446" y="365.767" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="313.865" y1="367.142" x2="320.961" y2="367.142" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="313.865" y1="368.519" x2="320.961" y2="368.519" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="313.865" y1="369.894" x2="320.961" y2="369.894" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="322.38" y1="374.021" x2="333.733" y2="374.021" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.38" y1="375.397" x2="333.733" y2="375.397" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="322.38" y1="376.772" x2="333.733" y2="376.772" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="339.41" y="367.142" width="2.83837" height="2.75126" fill="none"/><rect x="339.41" y="367.142" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><text transform="translate(26.796997 79.00001)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="42.09546" y="9" textLength="88.80908">routing_key=myqueue</tspan></text><text transform="translate(202.031 79.00001)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="10.472812" y="9" textLength="64.296387">routing_key=foo</tspan></text><g id="id2284_Graphic"><path d="M 329.00702 107.000005 L 423.00702 107.000005 C 427.97758 107.000005 432.00702 111.02944 432.00702 116.000005 L 432.00702 136.000005 C 432.00702 140.97057 427.97758 145.000005 423.00702 145.000005 L 329.00702 145.000005 C 324.03645 145.000005 320.00702 140.97057 320.00702 136.000005 L 320.00702 116.000005 C 320.00702 111.02944 324.03645 107.000005 329.00702 107.000005 Z" fill="#acffa2"/><path d="M 329.00702 107.000005 L 423.00702 107.000005 C 427.97758 107.000005 432.00702 111.02944 432.00702 116.000005 L 432.00702 136.000005 C 432.00702 140.97057 427.97758 145.000005 423.00702 145.000005 L 329.00702 145.000005 C 324.03645 145.000005 320.00702 140.97057 320.00702 136.000005 L 320.00702 116.000005 C 320.00702 111.02944 324.03645 107.000005 329.00702 107.000005 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(325.00702 112.000005)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.68164">Producer C</tspan></text></g><text transform="translate(333.38602 79.00001)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.473056" y="9" textLength="66.2959">routing_key=qux</tspan></text><path d="M 348.5369 145.28732 C 342.97682 149.191155 347.46709 154.21483 331.855 157 C 316.24291 159.78517 271.83745 152.99187 254.855 162 C 243.4814 168.03298 239.89471 180.65409 236.27266 193.24423" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 147.98082 145.24257 C 161.65251 152.82762 181.23191 161.374425 189 168 C 196.76809 174.62558 193.26267 177.8337 194.594 185 C 194.99444 187.15549 195.29843 189.58266 195.54949 192.1589" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 240.89769 145.99098 C 240.38351 148.66039 243.08474 149.24897 239.355 154 C 235.62526 158.75103 223.08431 164.99963 218.517 174.5 C 216.17447 179.37265 215.08286 185.64978 214.27983 192.25062" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="393" y="96.08351" width="31.222" height="16.5076" fill="#0d46ff"/><rect x="393" y="96.08351" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="394.419" y1="97.45851" x2="401.515" y2="97.45851" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="394.419" y1="98.83451" x2="401.515" y2="98.83451" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="394.419" y1="100.20951" x2="401.515" y2="100.20951" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="402.934" y1="104.33651" x2="414.287" y2="104.33651" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.934" y1="105.71251" x2="414.287" y2="105.71251" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.934" y1="107.08751" x2="414.287" y2="107.08751" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="419.964" y="97.45851" width="2.83837" height="2.75126" fill="none"/><rect x="419.964" y="97.45851" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/></g></g></svg>
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Fanout.png b/qpid/doc/book/src/java-broker/images/Exchange-Fanout.png
new file mode 100644
index 0000000000..1e7f8ca397
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Fanout.png
Binary files differ
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Fanout.svg b/qpid/doc/book/src/java-broker/images/Exchange-Fanout.svg
new file mode 100644
index 0000000000..2768886c48
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Fanout.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="139 112 321 304" width="321pt" height="304pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-10-01 22:37Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="black"><g><path d="M 3.2 0 L 0 -1.2 L 0 1.2 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 5</title><g><title>Layer 1</title><g><use xl:href="#id2069_Graphic" filter="url(#Shadow)"/><use xl:href="#id2082_Graphic" filter="url(#Shadow)"/><use xl:href="#id2083_Graphic" filter="url(#Shadow)"/><use xl:href="#id2120_Graphic" filter="url(#Shadow)"/><use xl:href="#id2158_Graphic" filter="url(#Shadow)"/><use xl:href="#id2196_Graphic" filter="url(#Shadow)"/></g><g id="id2069_Graphic"><path d="M 170.145 132 L 431 132 C 435.97056 132 440 136.02944 440 141 L 440 161 C 440 165.97056 435.97056 170 431 170 L 170.145 170 C 165.17444 170 161.145 165.97056 161.145 161 L 161.145 141 C 161.145 136.02944 165.17444 132 170.145 132 Z" fill="#acffa2"/><path d="M 170.145 132 L 431 132 C 435.97056 132 440 136.02944 440 141 L 440 161 C 440 165.97056 435.97056 170 431 170 L 170.145 170 C 165.17444 170 161.145 165.97056 161.145 161 L 161.145 141 C 161.145 136.02944 165.17444 132 170.145 132 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(166.145 137)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="52.68164">Producer</tspan></text></g><g id="id2082_Graphic"><path d="M 168 191.924 L 431 191.924 C 435.97056 191.924 440 195.95344 440 200.924 L 440 383 C 440 387.97056 435.97056 392 431 392 L 168 392 C 163.02944 392 159 387.97056 159 383 L 159 200.924 C 159 195.95344 163.02944 191.924 168 191.924 Z" fill="#78caff"/><path d="M 168 191.924 L 431 191.924 C 435.97056 191.924 440 195.95344 440 200.924 L 440 383 C 440 387.97056 435.97056 392 431 392 L 168 392 C 163.02944 392 159 387.97056 159 383 L 159 200.924 C 159 195.95344 163.02944 191.924 168 191.924 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(164 196.924)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="69.345703">Qpid Broker</tspan></text></g><g id="id2083_Graphic"><path d="M 175.42 240.5 L 312.5 240.5 C 317.47056 240.5 321.5 244.52944 321.5 249.5 L 321.5 269.5 C 321.5 274.47056 317.47056 278.5 312.5 278.5 L 175.42 278.5 C 170.44944 278.5 166.42 274.47056 166.42 269.5 L 166.42 249.5 C 166.42 244.52944 170.44944 240.5 175.42 240.5 Z" fill="#a788ff"/><path d="M 175.42 240.5 L 312.5 240.5 C 317.47056 240.5 321.5 244.52944 321.5 249.5 L 321.5 269.5 C 321.5 274.47056 317.47056 278.5 312.5 278.5 L 175.42 278.5 C 170.44944 278.5 166.42 274.47056 166.42 269.5 L 166.42 249.5 C 166.42 244.52944 170.44944 240.5 175.42 240.5 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(171.42 245.5)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.664062">amq.fanout</tspan></text></g><path d="M 280.99889 170.35153 C 276.90333 174.40062 273.73998 175.77393 268.711 182.5 C 263.68202 189.22607 254.4898 201.12881 250.822 210.712 C 249.50102 214.16344 248.77526 217.662 248.32317 221.18214" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2120_Graphic"><path d="M 364.92 200.5 L 423.92 200.5 C 428.89056 200.5 432.92 204.52944 432.92 209.5 L 432.92 244.5 C 432.92 249.47056 428.89056 253.5 423.92 253.5 L 364.92 253.5 C 359.94944 253.5 355.92 249.47056 355.92 244.5 L 355.92 209.5 C 355.92 204.52944 359.94944 200.5 364.92 200.5 Z" fill="#93d9ff"/><path d="M 364.92 200.5 L 423.92 200.5 C 428.89056 200.5 432.92 204.52944 432.92 209.5 L 432.92 244.5 C 432.92 249.47056 428.89056 253.5 423.92 253.5 L 364.92 253.5 C 359.94944 253.5 355.92 249.47056 355.92 244.5 L 355.92 209.5 C 355.92 204.52944 359.94944 200.5 364.92 200.5 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(360.92 205.5)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub1</tspan></text></g><path d="M 298.44469 240.33408 C 310.86446 235.96522 327.14095 230.28589 337.56869 226.59386" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2158_Graphic"><path d="M 364.92 262.848 L 423.92 262.848 C 428.89056 262.848 432.92 266.87744 432.92 271.848 L 432.92 306.848 C 432.92 311.81856 428.89056 315.848 423.92 315.848 L 364.92 315.848 C 359.94944 315.848 355.92 311.81856 355.92 306.848 L 355.92 271.848 C 355.92 266.87744 359.94944 262.848 364.92 262.848 Z" fill="#93d9ff"/><path d="M 364.92 262.848 L 423.92 262.848 C 428.89056 262.848 432.92 266.87744 432.92 271.848 L 432.92 306.848 C 432.92 311.81856 428.89056 315.848 423.92 315.848 L 364.92 315.848 C 359.94944 315.848 355.92 311.81856 355.92 306.848 L 355.92 271.848 C 355.92 266.87744 359.94944 262.848 364.92 262.848 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(360.92 267.848)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub2</tspan></text></g><path d="M 295.42725 278.67456 C 308.7835 283.65054 326.71209 291.09168 335.5 293.604 C 335.857 293.70606 336.20043 293.80022 336.53099 293.88695" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2196_Graphic"><path d="M 364.92 325.196 L 423.92 325.196 C 428.89056 325.196 432.92 329.22544 432.92 334.196 L 432.92 369.196 C 432.92 374.16656 428.89056 378.196 423.92 378.196 L 364.92 378.196 C 359.94944 378.196 355.92 374.16656 355.92 369.196 L 355.92 334.196 C 355.92 329.22544 359.94944 325.196 364.92 325.196 Z" fill="#93d9ff"/><path d="M 364.92 325.196 L 423.92 325.196 C 428.89056 325.196 432.92 329.22544 432.92 334.196 L 432.92 369.196 C 432.92 374.16656 428.89056 378.196 423.92 378.196 L 364.92 378.196 C 359.94944 378.196 355.92 374.16656 355.92 369.196 L 355.92 334.196 C 355.92 329.22544 359.94944 325.196 364.92 325.196 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(360.92 330.196)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub3</tspan></text></g><path d="M 266.10958 278.82875 C 290.2373 299.88373 323.68641 329.52704 338.5 342 C 338.934 342.36542 339.3543 342.71778 339.76141 343.05758" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="293.017" y="123" width="31.222" height="16.5076" fill="#ee0026"/><rect x="293.017" y="123" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="294.436" y1="124.376" x2="301.532" y2="124.376" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="294.436" y1="125.752" x2="301.532" y2="125.752" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="294.436" y1="127.127" x2="301.532" y2="127.127" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="302.951" y1="131.254" x2="314.305" y2="131.254" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="302.951" y1="132.63" x2="314.305" y2="132.63" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="302.951" y1="134.005" x2="314.305" y2="134.005" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="319.981" y="124.376" width="2.83837" height="2.75126" fill="none"/><rect x="319.981" y="124.376" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="283.295" y="128.508" width="31.222" height="16.5076" fill="#17ee07"/><rect x="283.295" y="128.508" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="284.715" y1="129.884" x2="291.811" y2="129.884" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="284.715" y1="131.26" x2="291.811" y2="131.26" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="284.715" y1="132.635" x2="291.811" y2="132.635" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="293.23" y1="136.762" x2="304.583" y2="136.762" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="293.23" y1="138.138" x2="304.583" y2="138.138" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="293.23" y1="139.513" x2="304.583" y2="139.513" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="310.26" y="129.884" width="2.83837" height="2.75126" fill="none"/><rect x="310.26" y="129.884" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="276.906" y="133.722" width="31.222" height="16.5076" fill="#ff9"/><rect x="276.906" y="133.722" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="278.325" y1="135.098" x2="285.421" y2="135.098" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="278.325" y1="136.474" x2="285.421" y2="136.474" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="278.325" y1="137.849" x2="285.421" y2="137.849" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="286.84" y1="141.976" x2="298.193" y2="141.976" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="286.84" y1="143.352" x2="298.193" y2="143.352" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="286.84" y1="144.727" x2="298.193" y2="144.727" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="303.87" y="135.098" width="2.83837" height="2.75126" fill="none"/><rect x="303.87" y="135.098" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="392.111" y="217.97" width="31.222" height="16.5076" fill="#ee0026"/><rect x="392.111" y="217.97" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="393.53" y1="219.346" x2="400.626" y2="219.346" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="220.722" x2="400.626" y2="220.722" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="222.097" x2="400.626" y2="222.097" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="402.045" y1="226.224" x2="413.399" y2="226.224" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="227.6" x2="413.399" y2="227.6" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="228.975" x2="413.399" y2="228.975" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="419.075" y="219.346" width="2.83837" height="2.75126" fill="none"/><rect x="419.075" y="219.346" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.389" y="223.477" width="31.222" height="16.5076" fill="#17ee07"/><rect x="382.389" y="223.477" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="383.809" y1="224.853" x2="390.905" y2="224.853" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="226.229" x2="390.905" y2="226.229" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="227.604" x2="390.905" y2="227.604" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="392.324" y1="231.731" x2="403.677" y2="231.731" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="233.107" x2="403.677" y2="233.107" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="234.482" x2="403.677" y2="234.482" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="409.354" y="224.853" width="2.83837" height="2.75126" fill="none"/><rect x="409.354" y="224.853" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="376" y="228.691" width="31.222" height="16.5076" fill="#ff9"/><rect x="376" y="228.691" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="377.419" y1="230.067" x2="384.515" y2="230.067" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="231.443" x2="384.515" y2="231.443" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="232.818" x2="384.515" y2="232.818" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="385.934" y1="236.945" x2="397.287" y2="236.945" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="238.321" x2="397.287" y2="238.321" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="239.696" x2="397.287" y2="239.696" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="402.964" y="230.067" width="2.83837" height="2.75126" fill="none"/><rect x="402.964" y="230.067" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="392.111" y="284" width="31.222" height="16.5076" fill="#ee0026"/><rect x="392.111" y="284" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="393.53" y1="285.376" x2="400.626" y2="285.376" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="286.752" x2="400.626" y2="286.752" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="288.127" x2="400.626" y2="288.127" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="402.045" y1="292.254" x2="413.399" y2="292.254" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="293.63" x2="413.399" y2="293.63" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="295.005" x2="413.399" y2="295.005" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="419.075" y="285.376" width="2.83837" height="2.75126" fill="none"/><rect x="419.075" y="285.376" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.389" y="289.507" width="31.222" height="16.5076" fill="#17ee07"/><rect x="382.389" y="289.507" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="383.809" y1="290.883" x2="390.905" y2="290.883" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="292.259" x2="390.905" y2="292.259" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="293.634" x2="390.905" y2="293.634" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="392.324" y1="297.761" x2="403.677" y2="297.761" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="299.137" x2="403.677" y2="299.137" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="300.512" x2="403.677" y2="300.512" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="409.354" y="290.883" width="2.83837" height="2.75126" fill="none"/><rect x="409.354" y="290.883" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="376" y="294.721" width="31.222" height="16.5076" fill="#ff9"/><rect x="376" y="294.721" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="377.419" y1="296.097" x2="384.515" y2="296.097" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="297.473" x2="384.515" y2="297.473" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="298.848" x2="384.515" y2="298.848" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="385.934" y1="302.975" x2="397.287" y2="302.975" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="304.351" x2="397.287" y2="304.351" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="305.726" x2="397.287" y2="305.726" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="402.964" y="296.097" width="2.83837" height="2.75126" fill="none"/><rect x="402.964" y="296.097" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="392.111" y="344.523" width="31.222" height="16.5076" fill="#ee0026"/><rect x="392.111" y="344.523" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="393.53" y1="345.899" x2="400.626" y2="345.899" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="347.275" x2="400.626" y2="347.275" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.53" y1="348.65" x2="400.626" y2="348.65" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="402.045" y1="352.777" x2="413.399" y2="352.777" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="354.153" x2="413.399" y2="354.153" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.045" y1="355.528" x2="413.399" y2="355.528" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="419.075" y="345.899" width="2.83837" height="2.75126" fill="none"/><rect x="419.075" y="345.899" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.389" y="350.03" width="31.222" height="16.5076" fill="#17ee07"/><rect x="382.389" y="350.03" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="383.809" y1="351.406" x2="390.905" y2="351.406" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="352.782" x2="390.905" y2="352.782" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="383.809" y1="354.157" x2="390.905" y2="354.157" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="392.324" y1="358.284" x2="403.677" y2="358.284" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="359.66" x2="403.677" y2="359.66" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="392.324" y1="361.035" x2="403.677" y2="361.035" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="409.354" y="351.406" width="2.83837" height="2.75126" fill="none"/><rect x="409.354" y="351.406" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="376" y="355.244" width="31.222" height="16.5076" fill="#ff9"/><rect x="376" y="355.244" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="377.419" y1="356.62" x2="384.515" y2="356.62" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="357.996" x2="384.515" y2="357.996" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="377.419" y1="359.371" x2="384.515" y2="359.371" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="385.934" y1="363.498" x2="397.287" y2="363.498" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="364.874" x2="397.287" y2="364.874" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="385.934" y1="366.249" x2="397.287" y2="366.249" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="402.964" y="356.62" width="2.83837" height="2.75126" fill="none"/><rect x="402.964" y="356.62" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/></g></g></svg>
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.png b/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.png
new file mode 100644
index 0000000000..faa7507dad
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.png
Binary files differ
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.svg b/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.svg
new file mode 100644
index 0000000000..28ac5a072b
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic-Hierarchical.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="52 209 464 364" width="464pt" height="364pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-10-01 22:37Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="522.94922" cap-height="717.28516" ascent="770.01953" descent="-229.98047" font-weight="500"><font-face-src><font-face-name name="Helvetica"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="-1333.3334" x-height="539.55078" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-style="italic" font-weight="bold"><font-face-src><font-face-name name="Helvetica-BoldOblique"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="black"><g><path d="M 3.2 0 L 0 -1.2 L 0 1.2 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 3</title><g><title>Layer 1</title><g><use xl:href="#id2069_Graphic" filter="url(#Shadow)"/><use xl:href="#id2082_Graphic" filter="url(#Shadow)"/><use xl:href="#id2083_Graphic" filter="url(#Shadow)"/><use xl:href="#id2120_Graphic" filter="url(#Shadow)"/><use xl:href="#id2158_Graphic" filter="url(#Shadow)"/><use xl:href="#id2196_Graphic" filter="url(#Shadow)"/><use xl:href="#id2235_Graphic" filter="url(#Shadow)"/><use xl:href="#id2236_Graphic" filter="url(#Shadow)"/><use xl:href="#id2237_Graphic" filter="url(#Shadow)"/></g><g id="id2069_Graphic"><path d="M 81.699857 247.80647 L 163.69994 247.80647 C 168.6705 247.80647 172.69994 251.83591 172.69994 256.80647 L 172.69994 276.80647 C 172.69994 281.77704 168.6705 285.80647 163.69994 285.80647 L 81.699857 285.80647 C 76.729294 285.80647 72.699857 281.77704 72.699857 276.80647 L 72.699857 256.80647 C 72.699857 251.83591 76.729294 247.80647 81.699857 247.80647 Z" fill="#acffa2"/><path d="M 81.699857 247.80647 L 163.69994 247.80647 C 168.6705 247.80647 172.69994 251.83591 172.69994 256.80647 L 172.69994 276.80647 C 172.69994 281.77704 168.6705 285.80647 163.69994 285.80647 L 81.699857 285.80647 C 76.729294 285.80647 72.699857 281.77704 72.699857 276.80647 L 72.699857 256.80647 C 72.699857 251.83591 76.729294 247.80647 81.699857 247.80647 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(77.699857 252.80647)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="56.015625">Producer </tspan><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="55.576172" y="11" textLength="8.6660156">A</tspan></text></g><g id="id2082_Graphic"><path d="M 170.34993 308.80649 L 389.34993 308.80649 C 394.3205 308.80649 398.34993 312.83592 398.34993 317.80649 L 398.34993 539.7315 C 398.34993 544.70205 394.3205 548.7315 389.34993 548.7315 L 170.34993 548.7315 C 165.37937 548.7315 161.34993 544.70205 161.34993 539.7315 L 161.34993 317.80649 C 161.34993 312.83592 165.37937 308.80649 170.34993 308.80649 Z" fill="#78caff"/><path d="M 170.34993 308.80649 L 389.34993 308.80649 C 394.3205 308.80649 398.34993 312.83592 398.34993 317.80649 L 398.34993 539.7315 C 398.34993 544.70205 394.3205 548.7315 389.34993 548.7315 L 170.34993 548.7315 C 165.37937 548.7315 161.34993 544.70205 161.34993 539.7315 L 161.34993 317.80649 C 161.34993 312.83592 165.37937 308.80649 170.34993 308.80649 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(166.34993 313.80649)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="69.345703">Qpid Broker</tspan></text></g><g id="id2083_Graphic"><path d="M 178.70493 355.91948 L 285.70493 355.91948 C 290.67549 355.91948 294.70493 359.94892 294.70493 364.91948 L 294.70493 432.91948 C 294.70493 437.89005 290.67549 441.91948 285.70493 441.91948 L 178.70493 441.91948 C 173.73437 441.91948 169.70493 437.89005 169.70493 432.91948 L 169.70493 364.91948 C 169.70493 359.94892 173.73437 355.91948 178.70493 355.91948 Z" fill="#a788ff"/><path d="M 178.70493 355.91948 L 285.70493 355.91948 C 290.67549 355.91948 294.70493 359.94892 294.70493 364.91948 L 294.70493 432.91948 C 294.70493 437.89005 290.67549 441.91948 285.70493 441.91948 L 178.70493 441.91948 C 173.73437 441.91948 169.70493 437.89005 169.70493 432.91948 L 169.70493 364.91948 C 169.70493 359.94892 173.73437 355.91948 178.70493 355.91948 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(174.70493 360.91948)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="56.671875">amq.topic</tspan></text></g><rect x="176.20493" y="419.31606" width="64" height="13.6119995" fill="white"/><rect x="176.20493" y="419.31606" width="64" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(181.20493 420.62206)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="19.24585" y="9" textLength="15.508301">*.uk</tspan></text><rect x="240.20493" y="419.31606" width="48.000015" height="13.6119995" fill="white"/><rect x="240.20493" y="419.31606" width="48.000015" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(245.20493 420.62206)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub3</tspan></text><rect x="240.20493" y="405.70406" width="48.000015" height="13.6119995" fill="white"/><rect x="240.20493" y="405.70406" width="48.000015" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(245.20493 407.01006)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub2</tspan></text><rect x="176.20493" y="405.70406" width="64" height="13.6119995" fill="white"/><rect x="176.20493" y="405.70406" width="64" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(181.20493 407.01006)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="10.4919434" y="9" textLength="33.016113">news.uk</tspan></text><rect x="240.20493" y="392.09218" width="48.000015" height="13.6118774" fill="white"/><rect x="240.20493" y="392.09218" width="48.000015" height="13.6118774" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(245.20493 393.39812)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub1</tspan></text><rect x="176.20493" y="392.09218" width="64" height="13.6118774" fill="white"/><rect x="176.20493" y="392.09218" width="64" height="13.6118774" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(181.20493 393.39812)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="12.741943" y="9" textLength="28.516113">news.#</tspan></text><rect x="240.20493" y="381.31612" width="48.000015" height="10.776062" fill="white"/><rect x="240.20493" y="381.31612" width="48.000015" height="10.776062" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(245.20493 381.20415)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="5.7482986" y="9" textLength="26.503418">queue</tspan></text><rect x="176.20493" y="381.31612" width="64" height="10.776062" fill="white"/><rect x="176.20493" y="381.31612" width="64" height="10.776062" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(181.20493 381.20415)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x=".74487305" y="9" textLength="52.510254">binding_key</tspan></text><path d="M 153.46981 286.07181 C 161.04743 290.81623 166.92217 293.43473 176.20493 300.30649 C 185.48769 307.17824 202.16984 318.1179 209.17193 327.30649 C 211.60625 330.50095 213.07719 333.74156 214.08712 337.0042" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2120_Graphic"><path d="M 323.26993 354.34449 L 382.26993 354.34449 C 387.2405 354.34449 391.26993 358.37392 391.26993 363.34449 L 391.26993 398.34449 C 391.26993 403.31505 387.2405 407.34449 382.26993 407.34449 L 323.26993 407.34449 C 318.29937 407.34449 314.26993 403.31505 314.26993 398.34449 L 314.26993 363.34449 C 314.26993 358.37392 318.29937 354.34449 323.26993 354.34449 Z" fill="#93d9ff"/><path d="M 323.26993 354.34449 L 382.26993 354.34449 C 387.2405 354.34449 391.26993 358.37392 391.26993 363.34449 L 391.26993 398.34449 C 391.26993 403.31505 387.2405 407.34449 382.26993 407.34449 L 323.26993 407.34449 C 318.29937 407.34449 314.26993 403.31505 314.26993 398.34449 L 314.26993 363.34449 C 314.26993 358.37392 318.29937 354.34449 323.26993 354.34449 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(319.26993 359.34449)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub1</tspan></text></g><path d="M 283.20617 355.59578 C 289.20516 350.49986 296.27813 343.43139 301.20493 340.30649 C 306.13173 337.18158 308.24742 334.5667 312.76993 336.84449 C 313.84402 337.38546 314.99355 338.31366 316.19163 339.49113" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2158_Graphic"><path d="M 323.26993 417.26849 L 382.26993 417.26849 C 387.2405 417.26849 391.26993 421.29792 391.26993 426.26849 L 391.26993 461.26849 C 391.26993 466.23905 387.2405 470.2685 382.26993 470.2685 L 323.26993 470.2685 C 318.29937 470.2685 314.26993 466.23905 314.26993 461.26849 L 314.26993 426.26849 C 314.26993 421.29792 318.29937 417.26849 323.26993 417.26849 Z" fill="#93d9ff"/><path d="M 323.26993 417.26849 L 382.26993 417.26849 C 387.2405 417.26849 391.26993 421.29792 391.26993 426.26849 L 391.26993 461.26849 C 391.26993 466.23905 387.2405 470.2685 382.26993 470.2685 L 323.26993 470.2685 C 318.29937 470.2685 314.26993 466.23905 314.26993 461.26849 L 314.26993 426.26849 C 314.26993 421.29792 318.29937 417.26849 323.26993 417.26849 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(319.26993 422.26849)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub2</tspan></text></g><path d="M 295.20184 391.88853 C 299.9174 391.36223 302.1593 387.06715 309.34993 390.30949 C 313.65869 392.25235 321.3357 397.83387 327.92422 402.946" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2196_Graphic"><path d="M 323.26993 480.1935 L 382.26993 480.1935 C 387.2405 480.1935 391.26993 484.22292 391.26993 489.1935 L 391.26993 524.1935 C 391.26993 529.16405 387.2405 533.1935 382.26993 533.1935 L 323.26993 533.1935 C 318.29937 533.1935 314.26993 529.16405 314.26993 524.1935 L 314.26993 489.1935 C 314.26993 484.22292 318.29937 480.1935 323.26993 480.1935 Z" fill="#93d9ff"/><path d="M 323.26993 480.1935 L 382.26993 480.1935 C 387.2405 480.1935 391.26993 484.22292 391.26993 489.1935 L 391.26993 524.1935 C 391.26993 529.16405 387.2405 533.1935 382.26993 533.1935 L 323.26993 533.1935 C 318.29937 533.1935 314.26993 529.16405 314.26993 524.1935 L 314.26993 489.1935 C 314.26993 484.22292 318.29937 480.1935 323.26993 480.1935 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(319.26993 485.1935)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub3</tspan></text></g><path d="M 272.52525 442.28566 C 276.13311 446.16607 278.5463 451.01454 283.34993 453.92806 C 288.15356 456.84157 294.6819 455.44752 301.34993 459.76849 C 303.9937 461.48168 306.84803 463.9417 309.78764 466.7043" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2235_Graphic"><path d="M 190.46685 247.91247 L 272.46693 247.91247 C 277.4375 247.91247 281.46693 251.94191 281.46693 256.91247 L 281.46693 276.91247 C 281.46693 281.88304 277.4375 285.91247 272.46693 285.91247 L 190.46685 285.91247 C 185.49629 285.91247 181.46685 281.88304 181.46685 276.91247 L 181.46685 256.91247 C 181.46685 251.94191 185.49629 247.91247 190.46685 247.91247 Z" fill="#acffa2"/><path d="M 190.46685 247.91247 L 272.46693 247.91247 C 277.4375 247.91247 281.46693 251.94191 281.46693 256.91247 L 281.46693 276.91247 C 281.46693 281.88304 277.4375 285.91247 272.46693 285.91247 L 190.46685 285.91247 C 185.49629 285.91247 181.46685 281.88304 181.46685 276.91247 L 181.46685 256.91247 C 181.46685 251.94191 185.49629 247.91247 190.46685 247.91247 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(186.46685 252.91247)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.68164">Producer B</tspan></text></g><g id="id2236_Graphic"><path d="M 296.99493 247.80649 L 378.99501 247.80649 C 383.96558 247.80649 387.99501 251.83592 387.99501 256.80649 L 387.99501 276.80649 C 387.99501 281.77705 383.96558 285.80649 378.99501 285.80649 L 296.99493 285.80649 C 292.02437 285.80649 287.99493 281.77705 287.99493 276.80649 L 287.99493 256.80649 C 287.99493 251.83592 292.02437 247.80649 296.99493 247.80649 Z" fill="#acffa2"/><path d="M 296.99493 247.80649 L 378.99501 247.80649 C 383.96558 247.80649 387.99501 251.83592 387.99501 256.80649 L 387.99501 276.80649 C 387.99501 281.77705 383.96558 285.80649 378.99501 285.80649 L 296.99493 285.80649 C 292.02437 285.80649 287.99493 281.77705 287.99493 276.80649 L 287.99493 256.80649 C 287.99493 251.83592 292.02437 247.80649 296.99493 247.80649 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(292.99493 252.80649)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.68164">Producer C</tspan></text></g><rect x="107.088896" y="232.4977" width="31.222" height="16.5076" fill="#ee0026"/><rect x="107.088896" y="232.4977" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="108.507896" y1="233.8737" x2="115.603896" y2="233.8737" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="108.507896" y1="235.2497" x2="115.603896" y2="235.2497" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="108.507896" y1="236.6247" x2="115.603896" y2="236.6247" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="117.022896" y1="240.7517" x2="128.3769" y2="240.7517" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="117.022896" y1="242.1277" x2="128.3769" y2="242.1277" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="117.022896" y1="243.5027" x2="128.3769" y2="243.5027" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="134.0529" y="233.8737" width="2.83837" height="2.75126" fill="none"/><rect x="134.0529" y="233.8737" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><g id="id2237_Graphic"><path d="M 404.967 247.91247 L 486.96707 247.91247 C 491.93764 247.91247 495.96707 251.94191 495.96707 256.91247 L 495.96707 276.91247 C 495.96707 281.88304 491.93764 285.91247 486.96707 285.91247 L 404.967 285.91247 C 399.99643 285.91247 395.967 281.88304 395.967 276.91247 L 395.967 256.91247 C 395.967 251.94191 399.99643 247.91247 404.967 247.91247 Z" fill="#acffa2"/><path d="M 404.967 247.91247 L 486.96707 247.91247 C 491.93764 247.91247 495.96707 251.94191 495.96707 256.91247 L 495.96707 276.91247 C 495.96707 281.88304 491.93764 285.91247 486.96707 285.91247 L 404.967 285.91247 C 399.99643 285.91247 395.967 281.88304 395.967 276.91247 L 395.967 256.91247 C 395.967 251.94191 399.99643 247.91247 404.967 247.91247 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(400.967 252.91247)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="64.68164">Producer D</tspan></text></g><text transform="translate(81.111363 218.61297)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x=".099365234" y="9" textLength="84.80127">routing_key=news.uk</tspan></text><text transform="translate(189.37836 218.61297)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x=".34667969" y="9" textLength="85.30664">routing_key=news.de</tspan></text><text transform="translate(292.90649 218.61297)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x=".3413086" y="9" textLength="83.80371">routing_key=weather</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="83.65283" y="9" textLength="12.0058594">.uk</tspan></text><text transform="translate(398.87849 218.61297)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x=".088623047" y="9" textLength="83.80371">routing_key=weather</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="83.400146" y="9" textLength="12.5112305">.de</tspan></text><rect x="215.85588" y="232.4977" width="31.222" height="16.5076" fill="#17ee07"/><rect x="215.85588" y="232.4977" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="217.27588" y1="233.8737" x2="224.37188" y2="233.8737" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="217.27588" y1="235.2497" x2="224.37188" y2="235.2497" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="217.27588" y1="236.6247" x2="224.37188" y2="236.6247" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="225.79088" y1="240.7517" x2="237.14388" y2="240.7517" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="225.79088" y1="242.1277" x2="237.14388" y2="242.1277" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="225.79088" y1="243.5027" x2="237.14388" y2="243.5027" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="242.82088" y="233.8737" width="2.83837" height="2.75126" fill="none"/><rect x="242.82088" y="233.8737" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="322.38399" y="234.99617" width="31.222" height="16.5076" fill="#151fee"/><rect x="322.38399" y="234.99617" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="323.80299" y1="236.37217" x2="330.89899" y2="236.37217" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="323.80299" y1="237.74817" x2="330.89899" y2="237.74817" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="323.80299" y1="239.12317" x2="330.89899" y2="239.12317" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="332.31799" y1="243.25017" x2="343.67199" y2="243.25017" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="332.31799" y1="244.62617" x2="343.67199" y2="244.62617" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="332.31799" y1="246.00117" x2="343.67199" y2="246.00117" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="349.34799" y="236.37217" width="2.83837" height="2.75126" fill="none"/><rect x="349.34799" y="236.37217" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="430.35602" y="233.30401" width="31.222" height="16.5076" fill="#ff9"/><rect x="430.35602" y="233.30401" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="431.77502" y1="234.68001" x2="438.87102" y2="234.68001" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="431.77502" y1="236.056" x2="438.87102" y2="236.056" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="431.77502" y1="237.431" x2="438.87102" y2="237.431" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="440.29002" y1="241.558" x2="451.64302" y2="241.558" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="440.29002" y1="242.934" x2="451.64302" y2="242.934" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="440.29002" y1="244.309" x2="451.64302" y2="244.309" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="457.32002" y="234.68001" width="2.83837" height="2.75126" fill="none"/><rect x="457.32002" y="234.68001" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><path d="M 238.00501 286.38647 C 239.78647 291.69261 242.7925 295.82047 243.34993 302.30649 C 243.90736 308.7925 242.30674 316.45457 241.34993 325.30649 C 240.97244 328.79884 240.50454 332.66089 239.99976 336.67375" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 321.99586 286.19211 C 317.01305 292.22963 315.81937 297.62143 307.04593 304.30649 C 298.27248 310.99155 278.11851 317.77936 269.34993 326.30649 C 265.69521 329.86056 263.35894 333.83017 261.51688 337.95542" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><path d="M 402.4166 285.86763 C 389.06238 291.68 380.30008 296.0674 362.34993 303.30649 C 344.39978 310.54557 309.90419 320.60053 294.70493 329.30649 C 288.48867 332.86708 284.7298 336.44155 281.92084 340.0213" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="349.73893" y="379.80949" width="31.222" height="16.5076" fill="#17ee07"/><rect x="349.73893" y="379.80949" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="351.15893" y1="381.18549" x2="358.25493" y2="381.18549" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="351.15893" y1="382.56149" x2="358.25493" y2="382.56149" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="351.15893" y1="383.93649" x2="358.25493" y2="383.93649" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="359.67393" y1="388.06349" x2="371.02693" y2="388.06349" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="359.67393" y1="389.43949" x2="371.02693" y2="389.43949" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="359.67393" y1="390.81449" x2="371.02693" y2="390.81449" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="376.70393" y="381.18549" width="2.83837" height="2.75126" fill="none"/><rect x="376.70393" y="381.18549" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="355.41593" y="386.30949" width="31.222" height="16.5076" fill="#ee0026"/><rect x="355.41593" y="386.30949" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="356.83493" y1="387.68549" x2="363.93093" y2="387.68549" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="389.06149" x2="363.93093" y2="389.06149" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="390.43649" x2="363.93093" y2="390.43649" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="365.34993" y1="394.56349" x2="376.70393" y2="394.56349" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="395.93949" x2="376.70393" y2="395.93949" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="397.31449" x2="376.70393" y2="397.31449" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.37993" y="387.68549" width="2.83837" height="2.75126" fill="none"/><rect x="382.37993" y="387.68549" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="355.41593" y="441.28849" width="31.222" height="16.5076" fill="#ee0026"/><rect x="355.41593" y="441.28849" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="356.83493" y1="442.66449" x2="363.93093" y2="442.66449" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="444.04049" x2="363.93093" y2="444.04049" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="445.41549" x2="363.93093" y2="445.41549" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="365.34993" y1="449.54249" x2="376.70393" y2="449.54249" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="450.91849" x2="376.70393" y2="450.91849" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="452.29349" x2="376.70393" y2="452.29349" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.37993" y="442.66449" width="2.83837" height="2.75126" fill="none"/><rect x="382.37993" y="442.66449" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="349.73893" y="498.4395" width="31.222" height="16.5076" fill="#ee0026"/><rect x="349.73893" y="498.4395" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="351.15793" y1="499.8155" x2="358.25393" y2="499.8155" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="351.15793" y1="501.1915" x2="358.25393" y2="501.1915" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="351.15793" y1="502.5665" x2="358.25393" y2="502.5665" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="359.67293" y1="506.6935" x2="371.02693" y2="506.6935" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="359.67293" y1="508.0695" x2="371.02693" y2="508.0695" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="359.67293" y1="509.4445" x2="371.02693" y2="509.4445" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="376.70293" y="499.8155" width="2.83837" height="2.75126" fill="none"/><rect x="376.70293" y="499.8155" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="355.41593" y="505.8065" width="31.222" height="16.5076" fill="#151fee"/><rect x="355.41593" y="505.8065" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="356.83493" y1="507.1825" x2="363.93093" y2="507.1825" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="508.5585" x2="363.93093" y2="508.5585" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="356.83493" y1="509.9335" x2="363.93093" y2="509.9335" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="365.34993" y1="514.0605" x2="376.70393" y2="514.0605" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="515.4365" x2="376.70393" y2="515.4365" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.34993" y1="516.8115" x2="376.70393" y2="516.8115" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.37993" y="507.1825" width="2.83837" height="2.75126" fill="none"/><rect x="382.37993" y="507.1825" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/></g></g></svg>
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.png b/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.png
new file mode 100644
index 0000000000..7272949204
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.png
Binary files differ
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.svg b/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.svg
new file mode 100644
index 0000000000..568761a18d
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic-JMSSelector.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="100 43 404 422" width="404pt" height="422pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-10-01 22:37Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="522.94922" cap-height="717.28516" ascent="770.01953" descent="-229.98047" font-weight="500"><font-face-src><font-face-name name="Helvetica"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="-1333.3334" x-height="539.55078" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-style="italic" font-weight="bold"><font-face-src><font-face-name name="Helvetica-BoldOblique"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="black"><g><path d="M 3.2 0 L 0 -1.2 L 0 1.2 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 4</title><g><title>Layer 1</title><g><use xl:href="#id2069_Graphic" filter="url(#Shadow)"/><use xl:href="#id2082_Graphic" filter="url(#Shadow)"/><use xl:href="#id2083_Graphic" filter="url(#Shadow)"/><use xl:href="#id2120_Graphic" filter="url(#Shadow)"/><use xl:href="#id2158_Graphic" filter="url(#Shadow)"/><use xl:href="#id2196_Graphic" filter="url(#Shadow)"/><use xl:href="#id2711_Graphic" filter="url(#Shadow)"/></g><g id="id2069_Graphic"><path d="M 139 132 L 451.288 132 C 456.25856 132 460.288 136.02944 460.288 141 L 460.288 161 C 460.288 165.97056 456.25856 170 451.288 170 L 139 170 C 134.02944 170 130 165.97056 130 161 L 130 141 C 130 136.02944 134.02944 132 139 132 Z" fill="#acffa2"/><path d="M 139 132 L 451.288 132 C 456.25856 132 460.288 136.02944 460.288 141 L 460.288 161 C 460.288 165.97056 456.25856 170 451.288 170 L 139 170 C 134.02944 170 130 165.97056 130 161 L 130 141 C 130 136.02944 134.02944 132 139 132 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(135 137)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="52.68164">Producer</tspan></text></g><g id="id2082_Graphic"><path d="M 143.000015 185.848 L 451.288 185.848 C 456.25857 185.848 460.288 189.87744 460.288 194.848 L 460.288 431.424 C 460.288 436.39456 456.25857 440.424 451.288 440.424 L 143.000015 440.424 C 138.02945 440.424 134.000015 436.39456 134.000015 431.424 L 134.000015 194.848 C 134.000015 189.87744 138.02945 185.848 143.000015 185.848 Z" fill="#78caff"/><path d="M 143.000015 185.848 L 451.288 185.848 C 456.25857 185.848 460.288 189.87744 460.288 194.848 L 460.288 431.424 C 460.288 436.39456 456.25857 440.424 451.288 440.424 L 143.000015 440.424 C 138.02945 440.424 134.000015 436.39456 134.000015 431.424 L 134.000015 194.848 C 134.000015 189.87744 138.02945 185.848 143.000015 185.848 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(139.000015 190.848)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="69.345703">Qpid Broker</tspan></text></g><g id="id2083_Graphic"><path d="M 152.39604 234.424 L 312 234.424 C 316.97056 234.424 321 238.45344 321 243.424 L 321 409 C 321 413.97057 316.97056 418 312 418 L 152.39604 418 C 147.42548 418 143.39604 413.97057 143.39604 409 L 143.39604 243.424 C 143.39604 238.45344 147.42548 234.424 152.39604 234.424 Z" fill="#a788ff"/><path d="M 152.39604 234.424 L 312 234.424 C 316.97056 234.424 321 238.45344 321 243.424 L 321 409 C 321 413.97057 316.97056 418 312 418 L 152.39604 418 C 147.42548 418 143.39604 413.97057 143.39604 409 L 143.39604 243.424 C 143.39604 238.45344 147.42548 234.424 152.39604 234.424 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(148.39604 239.424)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="56.671875">amq.topic</tspan></text></g><rect x="149.727025" y="391.12524" width="49.897038" height="21.874771" fill="white"/><rect x="149.727025" y="391.12524" width="49.897038" height="21.874771" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(154.72703 396.56262)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="3.1855793" y="9" textLength="33.525879">shipping</tspan></text><rect x="239.35857" y="391.12524" width="72.732437" height="21.874771" fill="white"/><rect x="239.35857" y="391.12524" width="72.732437" height="21.874771" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(244.35857 396.56262)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="6.3437576" y="9" textLength="50.044922">speed &gt;= 10</tspan></text><rect x="199.62406" y="391.12523" width="39.734509" height="21.874771" fill="white"/><rect x="199.62406" y="391.12523" width="39.734509" height="21.874771" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(204.62406 391.06261)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="1.1145687" y="9" textLength="27.505371">storm_</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="6.113348" y="20" textLength="17.507812">alert</tspan></text><rect x="239.35857" y="353.12523" width="72.732437" height="37.999992" fill="white"/><rect x="239.35857" y="353.12523" width="72.732437" height="37.999992" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(244.35857 361.12523)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="2.7160721" y="9" textLength="59.80078">speed &gt; 7 and </tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="8.9716873" y="20" textLength="44.789062">speed &lt; 10</tspan></text><rect x="239.35857" y="280" width="72.732437" height="35.125237" fill="white"/><rect x="239.35857" y="280" width="72.732437" height="35.125237" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(244.35857 281.06262)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.606941" y="9" textLength="30.019043">area in </tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="13.146492" y="20" textLength="38.939941">('Forties', </tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.648445" y="31" textLength="43.435547">'Cromarty')</tspan></text><rect x="239.35857" y="315.12524" width="72.732437" height="38" fill="white"/><rect x="239.35857" y="315.12524" width="72.732437" height="38" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(244.35857 317.62524)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.606941" y="9" textLength="30.019043">area in </tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="12.144539" y="20" textLength="40.943848">('Rockall', </tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.396004" y="31" textLength="27.94043">'Malin')</tspan></text><rect x="239.35857" y="256.772" width="72.732437" height="23.227997" fill="white"/><rect x="239.35857" y="256.772" width="72.732437" height="23.227997" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(244.35857 262.886)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="8.3608475" y="9" textLength="46.010742">arguments</tspan></text><rect x="149.727025" y="353.12523" width="49.897038" height="37.999992" fill="white"/><rect x="149.727025" y="353.12523" width="49.897038" height="37.999992" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(154.72703 366.62523)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="3.1855793" y="9" textLength="33.525879">shipping</tspan></text><rect x="199.62406" y="353.12523" width="39.734509" height="37.999992" fill="white"/><rect x="199.62406" y="353.12523" width="39.734509" height="37.999992" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(204.62406 361.12523)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="3.8567562" y="9" textLength="22.020996">gale_</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="6.113348" y="20" textLength="17.507812">alert</tspan></text><rect x="199.62406" y="315.12524" width="39.734509" height="38" fill="white"/><rect x="199.62406" y="315.12524" width="39.734509" height="38" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(204.62406 328.62524)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="5.1091976" y="9" textLength="19.516113">sub2</tspan></text><rect x="149.727025" y="315.12524" width="49.897038" height="38" fill="white"/><rect x="149.727025" y="315.12524" width="49.897038" height="38" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(154.72703 328.62524)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="3.1855793" y="9" textLength="33.525879">shipping</tspan></text><rect x="199.62406" y="280" width="39.734509" height="35.125237" fill="white"/><rect x="199.62406" y="280" width="39.734509" height="35.125237" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(204.62406 292.06262)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="5.1091976" y="9" textLength="19.516113">sub1</tspan></text><rect x="149.727025" y="280" width="49.897038" height="35.125237" fill="white"/><rect x="149.727025" y="280" width="49.897038" height="35.125237" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(154.72703 292.06262)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="3.1855793" y="9" textLength="33.525879">shipping</tspan></text><rect x="199.62406" y="256.772" width="39.734509" height="23.227997" fill="white"/><rect x="199.62406" y="256.772" width="39.734509" height="23.227997" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(204.62406 262.886)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="1.6155453" y="9" textLength="26.503418">queue</tspan></text><rect x="149.727025" y="256.772" width="49.897038" height="23.227997" fill="white"/><rect x="149.727025" y="256.772" width="49.897038" height="23.227997" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(154.72703 257.386)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="1.20144844" y="9" textLength="37.49414">binding_</tspan><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="12.440462" y="20" textLength="15.016113">key</tspan></text><path d="M 272.37818 170.32356 C 269.9827 172.35684 269.36995 170.70583 265.19101 176.424 C 261.01207 182.14217 250.88966 195.05299 247.30201 204.636 C 246.0141 208.07615 245.33821 211.56306 244.94479 215.07148" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2120_Graphic"><path d="M 361.40001 194.424 L 420.4 194.424 C 425.37057 194.424 429.4 198.45344 429.4 203.424 L 429.4 238.424 C 429.4 243.39456 425.37057 247.424 420.4 247.424 L 361.40001 247.424 C 356.42945 247.424 352.40001 243.39456 352.40001 238.424 L 352.40001 203.424 C 352.40001 198.45344 356.42945 194.424 361.40001 194.424 Z" fill="#93d9ff"/><path d="M 361.40001 194.424 L 420.4 194.424 C 425.37057 194.424 429.4 198.45344 429.4 203.424 L 429.4 238.424 C 429.4 243.39456 425.37057 247.424 420.4 247.424 L 361.40001 247.424 C 356.42945 247.424 352.40001 243.39456 352.40001 238.424 L 352.40001 203.424 C 352.40001 198.45344 356.42945 194.424 361.40001 194.424 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(357.40001 199.424)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub1</tspan></text></g><path d="M 319.89446 238.15621 C 324.70855 233.3224 330.2482 227.10227 334.897 222.58499" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2158_Graphic"><path d="M 361.40001 256.772 L 420.4 256.772 C 425.37057 256.772 429.4 260.80144 429.4 265.772 L 429.4 300.772 C 429.4 305.74256 425.37057 309.772 420.4 309.772 L 361.40001 309.772 C 356.42945 309.772 352.40001 305.74256 352.40001 300.772 L 352.40001 265.772 C 352.40001 260.80144 356.42945 256.772 361.40001 256.772 Z" fill="#93d9ff"/><path d="M 361.40001 256.772 L 420.4 256.772 C 425.37057 256.772 429.4 260.80144 429.4 265.772 L 429.4 300.772 C 429.4 305.74256 425.37057 309.772 420.4 309.772 L 361.40001 309.772 C 356.42945 309.772 352.40001 305.74256 352.40001 300.772 L 352.40001 265.772 C 352.40001 260.80144 356.42945 256.772 361.40001 256.772 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(357.40001 261.772)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub2</tspan></text></g><path d="M 321.4662 291.60405 C 324.97045 290.2455 328.1181 288.18294 331.98001 287.528 C 332.3119 287.47172 332.65571 287.42685 333.00907 287.39181" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2196_Graphic"><path d="M 361.40001 319.12 L 420.4 319.12 C 425.37057 319.12 429.4 323.14944 429.4 328.12 L 429.4 363.12 C 429.4 368.09056 425.37057 372.12 420.4 372.12 L 361.40001 372.12 C 356.42945 372.12 352.40001 368.09056 352.40001 363.12 L 352.40001 328.12 C 352.40001 323.14944 356.42945 319.12 361.40001 319.12 Z" fill="#93d9ff"/><path d="M 361.40001 319.12 L 420.4 319.12 C 425.37057 319.12 429.4 323.14944 429.4 328.12 L 429.4 363.12 C 429.4 368.09056 425.37057 372.12 420.4 372.12 L 361.40001 372.12 C 356.42945 372.12 352.40001 368.09056 352.40001 363.12 L 352.40001 328.12 C 352.40001 323.14944 356.42945 319.12 361.40001 319.12 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(357.40001 324.12)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="5.4833984" y="11" textLength="56.033203">gale_alert</tspan></text></g><path d="M 321.49778 334.65005 C 325.9914 335.07466 329.98347 333.76622 334.98001 335.924 C 335.44844 336.1263 335.94927 336.37619 336.47464 336.66459" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="143.39604" y="111.60699" width="31.222" height="16.5076" fill="#ee0026"/><rect x="143.39604" y="111.60699" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="144.81504" y1="112.98299" x2="151.91104" y2="112.98299" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="144.81504" y1="114.35899" x2="151.91104" y2="114.35899" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="144.81504" y1="115.73399" x2="151.91104" y2="115.73399" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="153.33004" y1="119.86099" x2="164.68404" y2="119.86099" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="153.33004" y1="121.23699" x2="164.68404" y2="121.23699" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="153.33004" y1="122.61199" x2="164.68404" y2="122.61199" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="170.36004" y="112.98299" width="2.83837" height="2.75126" fill="none"/><rect x="170.36004" y="112.98299" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="214.53399" y="111.60699" width="31.222" height="16.5076" fill="#17ee07"/><rect x="214.53399" y="111.60699" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="215.95399" y1="112.98299" x2="223.04999" y2="112.98299" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="215.95399" y1="114.35899" x2="223.04999" y2="114.35899" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="215.95399" y1="115.73399" x2="223.04999" y2="115.73399" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="224.46899" y1="119.86099" x2="235.82199" y2="119.86099" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="224.46899" y1="121.23699" x2="235.82199" y2="121.23699" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="224.46899" y1="122.61199" x2="235.82199" y2="122.61199" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="241.49899" y="112.98299" width="2.83837" height="2.75126" fill="none"/><rect x="241.49899" y="112.98299" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="280.869" y="111.607" width="31.222" height="16.5076" fill="#151fee"/><rect x="280.869" y="111.607" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="282.288" y1="112.983" x2="289.384" y2="112.983" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="282.288" y1="114.359" x2="289.384" y2="114.359" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="282.288" y1="115.734" x2="289.384" y2="115.734" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="290.803" y1="119.861" x2="302.157" y2="119.861" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="290.803" y1="121.237" x2="302.157" y2="121.237" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="290.803" y1="122.612" x2="302.157" y2="122.612" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="307.833" y="112.983" width="2.83837" height="2.75126" fill="none"/><rect x="307.833" y="112.983" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="355.61097" y="111.60699" width="31.222" height="16.5076" fill="#ff9"/><rect x="355.61097" y="111.60699" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="357.02997" y1="112.98299" x2="364.12597" y2="112.98299" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="357.02997" y1="114.35899" x2="364.12597" y2="114.35899" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="357.02997" y1="115.73399" x2="364.12597" y2="115.73399" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="365.54497" y1="119.86099" x2="376.89797" y2="119.86099" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.54497" y1="121.23699" x2="376.89797" y2="121.23699" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="365.54497" y1="122.61199" x2="376.89797" y2="122.61199" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="382.57497" y="112.98299" width="2.83837" height="2.75126" fill="none"/><rect x="382.57497" y="112.98299" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="385.98" y="281.028" width="31.222" height="16.5076" fill="#17ee07"/><rect x="385.98" y="281.028" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="387.4" y1="282.404" x2="394.496" y2="282.404" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.4" y1="283.78" x2="394.496" y2="283.78" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.4" y1="285.155" x2="394.496" y2="285.155" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="395.915" y1="289.282" x2="407.268" y2="289.282" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.915" y1="290.658" x2="407.268" y2="290.658" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.915" y1="292.033" x2="407.268" y2="292.033" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="412.945" y="282.404" width="2.83837" height="2.75126" fill="none"/><rect x="412.945" y="282.404" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="391.657" y="287.528" width="31.222" height="16.5076" fill="#ee0026"/><rect x="391.657" y="287.528" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="393.076" y1="288.904" x2="400.172" y2="288.904" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.076" y1="290.28" x2="400.172" y2="290.28" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.076" y1="291.655" x2="400.172" y2="291.655" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="401.591" y1="295.782" x2="412.945" y2="295.782" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="401.591" y1="297.158" x2="412.945" y2="297.158" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="401.591" y1="298.533" x2="412.945" y2="298.533" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="418.621" y="288.904" width="2.83837" height="2.75126" fill="none"/><rect x="418.621" y="288.904" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><text transform="translate(109.50705 74.72158)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="16.138916" y="9" textLength="66.722168">{area = 'Rockall',</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="28.35791" y="20" textLength="42.28418">speed = 5,</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.898926" y="31" textLength="63.20215">visibility = 'Fair'}</tspan></text><text transform="translate(180.64499 74.72158)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="20.140137" y="9" textLength="58.719727">{area = 'Malin',</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="28.35791" y="20" textLength="42.28418">speed = 6,</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.898926" y="31" textLength="63.20215">visibility = 'Fair'}</tspan></text><text transform="translate(250 74.7216)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.140869" y="9" textLength="64.71826">{area = 'Forties',</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="28.35791" y="20" textLength="42.28418">speed = 7,</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="16.143311" y="31" textLength="66.71338">visibility = 'Poor'}</tspan></text><text transform="translate(321.72198 74.7216)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="12.392578" y="9" textLength="74.214844">{area = 'Cromarty',</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="28.35791" y="20" textLength="42.28418">speed = 8,</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="16.143311" y="31" textLength="66.71338">visibility = 'Poor'}</tspan></text><rect x="385.98" y="215.22" width="31.222" height="16.5076" fill="#151fee"/><rect x="385.98" y="215.22" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="387.399" y1="216.596" x2="394.495" y2="216.596" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.399" y1="217.972" x2="394.495" y2="217.972" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.399" y1="219.347" x2="394.495" y2="219.347" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="395.914" y1="223.474" x2="407.268" y2="223.474" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.914" y1="224.85" x2="407.268" y2="224.85" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.914" y1="226.225" x2="407.268" y2="226.225" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="412.944" y="216.596" width="2.83837" height="2.75126" fill="none"/><rect x="412.944" y="216.596" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="392.501" y="222.674" width="31.222" height="16.5076" fill="#ff9"/><rect x="392.501" y="222.674" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="393.92" y1="224.05" x2="401.016" y2="224.05" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.92" y1="225.426" x2="401.016" y2="225.426" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="393.92" y1="226.801" x2="401.016" y2="226.801" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="402.435" y1="230.928" x2="413.788" y2="230.928" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.435" y1="232.304" x2="413.788" y2="232.304" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="402.435" y1="233.679" x2="413.788" y2="233.679" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="419.465" y="224.05" width="2.83837" height="2.75126" fill="none"/><rect x="419.465" y="224.05" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="430.485" y1="112.983" x2="437.581" y2="112.983" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><rect x="429.066" y="111.607" width="31.222" height="16.5076" fill="#ff07f9"/><rect x="429.066" y="111.607" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="430.485" y1="114.359" x2="437.581" y2="114.359" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="430.485" y1="115.734" x2="437.581" y2="115.734" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="439" y1="119.861" x2="450.353" y2="119.861" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="439" y1="121.237" x2="450.353" y2="121.237" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="439" y1="122.612" x2="450.353" y2="122.612" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="456.03" y="112.983" width="2.83837" height="2.75126" fill="none"/><rect x="456.03" y="112.983" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><text transform="translate(395.177 74.721577)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="20.390625" y="9" textLength="58.21875">{area = 'Forth',</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="28.35791" y="20" textLength="42.28418">speed = 6,</tspan><tspan font-family="Helvetica" font-size="9" font-weight="500" x="17.894531" y="31" textLength="63.210938">visibility = 'Fog'}</tspan></text><rect x="385.98" y="344.14" width="31.222" height="16.5076" fill="#ff9"/><rect x="385.98" y="344.14" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="387.399" y1="345.516" x2="394.495" y2="345.516" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.399" y1="346.892" x2="394.495" y2="346.892" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="387.399" y1="348.267" x2="394.495" y2="348.267" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="395.914" y1="352.394" x2="407.267" y2="352.394" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.914" y1="353.77" x2="407.267" y2="353.77" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="395.914" y1="355.145" x2="407.267" y2="355.145" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="412.944" y="345.516" width="2.83837" height="2.75126" fill="none"/><rect x="412.944" y="345.516" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><g id="id2711_Graphic"><path d="M 361.40001 378.924 L 420.4 378.924 C 425.37057 378.924 429.4 382.95344 429.4 387.924 L 429.4 422.924 C 429.4 427.89456 425.37057 431.924 420.4 431.924 L 361.40001 431.924 C 356.42945 431.924 352.40001 427.89456 352.40001 422.924 L 352.40001 387.924 C 352.40001 382.95344 356.42945 378.924 361.40001 378.924 Z" fill="#93d9ff"/><path d="M 361.40001 378.924 L 420.4 378.924 C 425.37057 378.924 429.4 382.95344 429.4 387.924 L 429.4 422.924 C 429.4 427.89456 425.37057 431.924 420.4 431.924 L 361.40001 431.924 C 356.42945 431.924 352.40001 427.89456 352.40001 422.924 L 352.40001 387.924 C 352.40001 382.95344 356.42945 378.924 361.40001 378.924 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(357.40001 383.924)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x=".81933594" y="11" textLength="65.36133">storm_alert</tspan></text></g><text transform="translate(208.64398 52)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="43.844482" y="9" textLength="85.311035">routing_key=shipping</tspan></text></g></g></svg>
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic.png b/qpid/doc/book/src/java-broker/images/Exchange-Topic.png
new file mode 100644
index 0000000000..f631d73a12
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic.png
Binary files differ
diff --git a/qpid/doc/book/src/java-broker/images/Exchange-Topic.svg b/qpid/doc/book/src/java-broker/images/Exchange-Topic.svg
new file mode 100644
index 0000000000..4240be5594
--- /dev/null
+++ b/qpid/doc/book/src/java-broker/images/Exchange-Topic.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="123 62 277 368" width="277pt" height="368pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-10-01 22:37Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="522.94922" cap-height="717.28516" ascent="770.01953" descent="-229.98047" font-weight="500"><font-face-src><font-face-name name="Helvetica"/></font-face-src></font-face><font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="-1333.3334" x-height="539.55078" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-style="italic" font-weight="bold"><font-face-src><font-face-name name="Helvetica-BoldOblique"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="black"><g><path d="M 3.2 0 L 0 -1.2 L 0 1.2 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 6</title><g><title>Layer 1</title><g><use xl:href="#id2467_Graphic" filter="url(#Shadow)"/><use xl:href="#id1779_Graphic" filter="url(#Shadow)"/><use xl:href="#id1780_Graphic" filter="url(#Shadow)"/><use xl:href="#id1917_Graphic" filter="url(#Shadow)"/><use xl:href="#id1991_Graphic" filter="url(#Shadow)"/><use xl:href="#id2031_Graphic" filter="url(#Shadow)"/></g><g id="id2467_Graphic"><path d="M 152 105 L 371 105 C 375.97056 105 380 109.02944 380 114 L 380 134 C 380 138.97056 375.97056 143 371 143 L 152 143 C 147.02944 143 143 138.97056 143 134 L 143 114 C 143 109.02944 147.02944 105 152 105 Z" fill="#acffa2"/><path d="M 152 105 L 371 105 C 375.97056 105 380 109.02944 380 114 L 380 134 C 380 138.97056 375.97056 143 371 143 L 152 143 C 147.02944 143 143 138.97056 143 134 L 143 114 C 143 109.02944 147.02944 105 152 105 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(148 110)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="52.68164">Producer</tspan></text></g><g id="id1779_Graphic"><path d="M 152 166 L 371 166 C 375.97056 166 380 170.02944 380 175 L 380 396.925 C 380 401.89556 375.97056 405.925 371 405.925 L 152 405.925 C 147.02944 405.925 143 401.89556 143 396.925 L 143 175 C 143 170.02944 147.02944 166 152 166 Z" fill="#78caff"/><path d="M 152 166 L 371 166 C 375.97056 166 380 170.02944 380 175 L 380 396.925 C 380 401.89556 375.97056 405.925 371 405.925 L 152 405.925 C 147.02944 405.925 143 401.89556 143 396.925 L 143 175 C 143 170.02944 147.02944 166 152 166 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(148 171)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="69.345703">Qpid Broker</tspan></text></g><g id="id1780_Graphic"><path d="M 166.855 214.5 L 273.855 214.5 C 278.82556 214.5 282.855 218.52944 282.855 223.5 L 282.855 296 C 282.855 300.97056 278.82556 305 273.855 305 L 166.855 305 C 161.88444 305 157.855 300.97056 157.855 296 L 157.855 223.5 C 157.855 218.52944 161.88444 214.5 166.855 214.5 Z" fill="#a788ff"/><path d="M 166.855 214.5 L 273.855 214.5 C 278.82556 214.5 282.855 218.52944 282.855 223.5 L 282.855 296 C 282.855 300.97056 278.82556 305 273.855 305 L 166.855 305 C 161.88444 305 157.855 300.97056 157.855 296 L 157.855 223.5 C 157.855 218.52944 161.88444 214.5 166.855 214.5 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(162.855 219.5)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="0" y="11" textLength="56.671875">amq.topic</tspan></text></g><rect x="164.355" y="281.19395" width="64" height="13.6119385" fill="white"/><rect x="164.355" y="281.19395" width="64" height="13.6119385" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.355 282.49992)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="10.9907227" y="9" textLength="32.018555">weather</tspan></text><rect x="228.355" y="281.19395" width="48.000015" height="13.6119385" fill="white"/><rect x="228.355" y="281.19395" width="48.000015" height="13.6119385" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(233.355 282.49992)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub3</tspan></text><rect x="228.355" y="267.58195" width="48.000015" height="13.6119995" fill="white"/><rect x="228.355" y="267.58195" width="48.000015" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(233.355 268.88795)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub2</tspan></text><rect x="164.355" y="267.58195" width="64" height="13.6119995" fill="white"/><rect x="164.355" y="267.58195" width="64" height="13.6119995" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.355 268.88795)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="10.9907227" y="9" textLength="32.018555">weather</tspan></text><rect x="228.355" y="253.97005" width="48.000015" height="13.611908" fill="white"/><rect x="228.355" y="253.97005" width="48.000015" height="13.611908" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(233.355 255.276)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="9.241951" y="9" textLength="19.516113">sub1</tspan></text><rect x="164.355" y="253.97005" width="64" height="13.611908" fill="white"/><rect x="164.355" y="253.97005" width="64" height="13.611908" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.355 255.276)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="10.9907227" y="9" textLength="32.018555">weather</tspan></text><rect x="228.355" y="243.194" width="48.000015" height="10.776047" fill="white"/><rect x="228.355" y="243.194" width="48.000015" height="10.776047" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(233.355 243.08202)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x="5.7482986" y="9" textLength="26.503418">queue</tspan></text><rect x="164.355" y="243.194" width="64" height="10.776047" fill="white"/><rect x="164.355" y="243.194" width="64" height="10.776047" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.355 243.08202)" fill="black"><tspan font-family="Helvetica" font-size="9" font-style="italic" font-weight="bold" x=".74487305" y="9" textLength="52.510254">binding_key</tspan></text><path d="M 248.15424 143.41202 C 245.26978 147.60759 241.94213 150.23591 239.5 156 C 237.05787 161.76409 235.46474 168.33324 233.5 178 C 232.50765 182.88247 231.53304 188.95676 230.56277 195.31969" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id1917_Graphic"><path d="M 304.92 211.538 L 363.92 211.538 C 368.89056 211.538 372.92 215.56744 372.92 220.538 L 372.92 255.538 C 372.92 260.50856 368.89056 264.538 363.92 264.538 L 304.92 264.538 C 299.94944 264.538 295.92 260.50856 295.92 255.538 L 295.92 220.538 C 295.92 215.56744 299.94944 211.538 304.92 211.538 Z" fill="#93d9ff"/><path d="M 304.92 211.538 L 363.92 211.538 C 368.89056 211.538 372.92 215.56744 372.92 220.538 L 372.92 255.538 C 372.92 260.50856 368.89056 264.538 363.92 264.538 L 304.92 264.538 C 299.94944 264.538 295.92 260.50856 295.92 255.538 L 295.92 220.538 C 295.92 215.56744 299.94944 211.538 304.92 211.538 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(300.92 216.538)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub1</tspan></text></g><path d="M 256.27227 214.10707 C 261.53599 207.41805 265.70768 197.38251 272.065 194.038 C 278.42232 190.69349 288.09934 191.18328 294.42 194.038 C 295.73351 194.63125 296.94947 195.47113 298.09827 196.48077" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id1991_Graphic"><path d="M 304.92 274.462 L 363.92 274.462 C 368.89056 274.462 372.92 278.49144 372.92 283.462 L 372.92 318.462 C 372.92 323.43256 368.89056 327.462 363.92 327.462 L 304.92 327.462 C 299.94944 327.462 295.92 323.43256 295.92 318.462 L 295.92 283.462 C 295.92 278.49144 299.94944 274.462 304.92 274.462 Z" fill="#93d9ff"/><path d="M 304.92 274.462 L 363.92 274.462 C 368.89056 274.462 372.92 278.49144 372.92 283.462 L 372.92 318.462 C 372.92 323.43256 368.89056 327.462 363.92 327.462 L 304.92 327.462 C 299.94944 327.462 295.92 323.43256 295.92 318.462 L 295.92 283.462 C 295.92 278.49144 299.94944 274.462 304.92 274.462 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(300.92 279.462)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub2</tspan></text></g><path d="M 283.32046 235.0457 C 286.85328 233.6596 288.61394 227.05533 293.92 230.887 C 298.95247 234.5211 309.28699 249.22118 314.37788 256.858" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><g id="id2031_Graphic"><path d="M 304.92 337.387 L 363.92 337.387 C 368.89056 337.387 372.92 341.41644 372.92 346.387 L 372.92 381.387 C 372.92 386.35756 368.89056 390.387 363.92 390.387 L 304.92 390.387 C 299.94944 390.387 295.92 386.35756 295.92 381.387 L 295.92 346.387 C 295.92 341.41644 299.94944 337.387 304.92 337.387 Z" fill="#93d9ff"/><path d="M 304.92 337.387 L 363.92 337.387 C 368.89056 337.387 372.92 341.41644 372.92 346.387 L 372.92 381.387 C 372.92 386.35756 368.89056 390.387 363.92 390.387 L 304.92 390.387 C 299.94944 390.387 295.92 386.35756 295.92 381.387 L 295.92 346.387 C 295.92 341.41644 299.94944 337.387 304.92 337.387 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(300.92 342.387)" fill="black"><tspan font-family="Helvetica" font-size="12" font-weight="bold" x="19.496094" y="11" textLength="28.007812">sub3</tspan></text></g><path d="M 283.343 273.8093 C 286.89497 274.60212 290.22421 272.49625 294 276.188 C 297.77579 279.87975 301.14393 285.84005 306 295.962 C 308.90226 302.01144 312.41698 310.58504 315.99492 319.41948" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/><rect x="237.296" y="89.2331" width="31.222" height="16.5076" fill="#ff9"/><rect x="237.296" y="89.2331" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="238.715" y1="90.6081" x2="245.811" y2="90.6081" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="238.715" y1="91.9841" x2="245.811" y2="91.9841" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="238.715" y1="93.3601" x2="245.811" y2="93.3601" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="247.23" y1="97.4866" x2="258.584" y2="97.4866" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="247.23" y1="98.8626" x2="258.584" y2="98.8626" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="247.23" y1="100.2386" x2="258.584" y2="100.2386" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="264.26" y="90.6081" width="2.83837" height="2.75126" fill="none"/><rect x="264.26" y="90.6081" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="242.083" y="95.3166" width="31.222" height="16.5076" fill="#ff9"/><rect x="242.083" y="95.3166" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="243.502" y1="96.6916" x2="250.598" y2="96.6916" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="243.502" y1="98.0676" x2="250.598" y2="98.0676" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="243.502" y1="99.4436" x2="250.598" y2="99.4436" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="252.017" y1="103.5696" x2="263.371" y2="103.5696" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="252.017" y1="104.9456" x2="263.371" y2="104.9456" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="252.017" y1="106.3216" x2="263.371" y2="106.3216" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="269.047" y="96.6916" width="2.83837" height="2.75126" fill="none"/><rect x="269.047" y="96.6916" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="247.001" y="102.8166" width="31.222" height="16.5076" fill="#ff9"/><rect x="247.001" y="102.8166" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="248.421" y1="104.1926" x2="255.517" y2="104.1926" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="248.421" y1="105.5676" x2="255.517" y2="105.5676" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="248.421" y1="106.9436" x2="255.517" y2="106.9436" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="256.936" y1="111.0706" x2="268.289" y2="111.0706" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="256.936" y1="112.4456" x2="268.289" y2="112.4456" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="256.936" y1="113.8216" x2="268.289" y2="113.8216" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="273.966" y="104.1926" width="2.83837" height="2.75126" fill="none"/><rect x="273.966" y="104.1926" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="327.296" y="231.594" width="31.222" height="16.5076" fill="#ff9"/><rect x="327.296" y="231.594" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="328.715" y1="232.969" x2="335.811" y2="232.969" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.715" y1="234.345" x2="335.811" y2="234.345" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.715" y1="235.721" x2="335.811" y2="235.721" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="337.23" y1="239.848" x2="348.584" y2="239.848" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.23" y1="241.224" x2="348.584" y2="241.224" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.23" y1="242.6" x2="348.584" y2="242.6" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="354.26" y="232.969" width="2.83837" height="2.75126" fill="none"/><rect x="354.26" y="232.969" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="332.083" y="237.678" width="31.222" height="16.5076" fill="#ff9"/><rect x="332.083" y="237.678" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="333.502" y1="239.053" x2="340.598" y2="239.053" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.502" y1="240.429" x2="340.598" y2="240.429" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.502" y1="241.805" x2="340.598" y2="241.805" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="342.017" y1="245.931" x2="353.371" y2="245.931" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.017" y1="247.307" x2="353.371" y2="247.307" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.017" y1="248.683" x2="353.371" y2="248.683" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="359.047" y="239.053" width="2.83837" height="2.75126" fill="none"/><rect x="359.047" y="239.053" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="337.001" y="245.178" width="31.222" height="16.5076" fill="#ff9"/><rect x="337.001" y="245.178" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="338.421" y1="246.554" x2="345.517" y2="246.554" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.421" y1="247.929" x2="345.517" y2="247.929" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.421" y1="249.305" x2="345.517" y2="249.305" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="346.936" y1="253.432" x2="358.289" y2="253.432" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="346.936" y1="254.807" x2="358.289" y2="254.807" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="346.936" y1="256.183" x2="358.289" y2="256.183" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="363.966" y="246.554" width="2.83837" height="2.75126" fill="none"/><rect x="363.966" y="246.554" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="327.361" y="293.409" width="31.222" height="16.5076" fill="#ff9"/><rect x="327.361" y="293.409" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="328.78" y1="294.784" x2="335.876" y2="294.784" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.78" y1="296.16" x2="335.876" y2="296.16" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.78" y1="297.536" x2="335.876" y2="297.536" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="337.295" y1="301.662" x2="348.649" y2="301.662" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.295" y1="303.038" x2="348.649" y2="303.038" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.295" y1="304.414" x2="348.649" y2="304.414" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="354.325" y="294.784" width="2.83837" height="2.75126" fill="none"/><rect x="354.325" y="294.784" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="332.148" y="299.492" width="31.222" height="16.5076" fill="#ff9"/><rect x="332.148" y="299.492" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="333.567" y1="300.867" x2="340.663" y2="300.867" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.567" y1="302.243" x2="340.663" y2="302.243" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.567" y1="303.619" x2="340.663" y2="303.619" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="342.082" y1="307.745" x2="353.436" y2="307.745" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.082" y1="309.121" x2="353.436" y2="309.121" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.082" y1="310.497" x2="353.436" y2="310.497" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="359.112" y="300.867" width="2.83837" height="2.75126" fill="none"/><rect x="359.112" y="300.867" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="337.066" y="306.992" width="31.222" height="16.5076" fill="#ff9"/><rect x="337.066" y="306.992" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="338.486" y1="308.368" x2="345.582" y2="308.368" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.486" y1="309.743" x2="345.582" y2="309.743" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.486" y1="311.119" x2="345.582" y2="311.119" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="347.001" y1="315.246" x2="358.354" y2="315.246" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="347.001" y1="316.621" x2="358.354" y2="316.621" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="347.001" y1="317.997" x2="358.354" y2="317.997" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="364.031" y="308.368" width="2.83837" height="2.75126" fill="none"/><rect x="364.031" y="308.368" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="327.361" y="355.223" width="31.222" height="16.5076" fill="#ff9"/><rect x="327.361" y="355.223" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="328.78" y1="356.598" x2="335.876" y2="356.598" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.78" y1="357.974" x2="335.876" y2="357.974" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="328.78" y1="359.35" x2="335.876" y2="359.35" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="337.295" y1="363.477" x2="348.649" y2="363.477" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.295" y1="364.853" x2="348.649" y2="364.853" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="337.295" y1="366.229" x2="348.649" y2="366.229" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="354.325" y="356.598" width="2.83837" height="2.75126" fill="none"/><rect x="354.325" y="356.598" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="332.148" y="361.307" width="31.222" height="16.5076" fill="#ff9"/><rect x="332.148" y="361.307" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="333.567" y1="362.682" x2="340.663" y2="362.682" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.567" y1="364.058" x2="340.663" y2="364.058" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="333.567" y1="365.434" x2="340.663" y2="365.434" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="342.082" y1="369.56" x2="353.436" y2="369.56" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.082" y1="370.936" x2="353.436" y2="370.936" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="342.082" y1="372.312" x2="353.436" y2="372.312" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="359.112" y="362.682" width="2.83837" height="2.75126" fill="none"/><rect x="359.112" y="362.682" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="337.066" y="368.807" width="31.222" height="16.5076" fill="#ff9"/><rect x="337.066" y="368.807" width="31.222" height="16.5076" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="338.486" y1="370.183" x2="345.582" y2="370.183" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.486" y1="371.558" x2="345.582" y2="371.558" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="338.486" y1="372.934" x2="345.582" y2="372.934" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".72000003"/><line x1="347.001" y1="377.061" x2="358.354" y2="377.061" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="347.001" y1="378.436" x2="358.354" y2="378.436" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><line x1="347.001" y1="379.812" x2="358.354" y2="379.812" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><rect x="364.031" y="370.183" width="2.83837" height="2.75126" fill="none"/><rect x="364.031" y="370.183" width="2.83837" height="2.75126" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width=".24"/><text transform="translate(198.89749 71)" fill="black"><tspan font-family="Helvetica" font-size="9" font-weight="500" x="16.894638" y="9" textLength="83.80371">routing_key=weather</tspan></text></g></g></svg>
diff --git a/qpid/extras/dispatch/CMakeLists.txt b/qpid/extras/dispatch/CMakeLists.txt
index ae0e126be7..a55de067f9 100644
--- a/qpid/extras/dispatch/CMakeLists.txt
+++ b/qpid/extras/dispatch/CMakeLists.txt
@@ -51,6 +51,7 @@ set(INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory")
set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library object file directory")
set(SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration directory")
set(SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory")
+set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc CACHE PATH "Shared read-only data directory")
set(MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory")
# determine the location for installing the python packages
@@ -61,13 +62,6 @@ if (PYTHONLIBS_FOUND)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (PYTHONLIBS_FOUND)
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${proton_include}
- ${PYTHON_INCLUDE_PATH}
- )
-
##
## Find dependencies
##
@@ -76,6 +70,13 @@ find_library(pthread_lib pthread)
find_library(rt_lib rt)
find_path(proton_include proton/driver.h)
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${proton_include}
+ ${PYTHON_INCLUDE_PATH}
+ )
+
set(CMAKE_C_FLAGS "-pthread -Wall -Werror -std=gnu99")
set(CATCH_UNDEFINED "-Wl,--no-undefined")
@@ -85,6 +86,8 @@ set(CATCH_UNDEFINED "-Wl,--no-undefined")
set(server_SOURCES
src/agent.c
src/alloc.c
+ src/amqp.c
+ src/bitmask.c
src/buffer.c
src/compose.c
src/config.c
@@ -98,12 +101,18 @@ set(server_SOURCES
src/parse.c
src/posix/threading.c
src/python_embedded.c
+ src/router_agent.c
src/router_node.c
+ src/router_pynode.c
src/server.c
src/timer.c
src/work_queue.c
)
+set_property(SOURCE src/python_embedded.c src/router_pynode.c
+ PROPERTY COMPILE_FLAGS -Wno-strict-aliasing
+ )
+
add_library(qpid-dispatch SHARED ${server_SOURCES})
target_link_libraries(qpid-dispatch ${proton_lib} ${pthread_lib} ${rt_lib} ${PYTHON_LIBRARIES})
set_target_properties(qpid-dispatch PROPERTIES
@@ -116,7 +125,7 @@ install(TARGETS qpid-dispatch
file(GLOB headers "include/qpid/dispatch/*.h")
install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/qpid/dispatch)
install(FILES include/qpid/dispatch.h DESTINATION ${INCLUDE_INSTALL_DIR}/qpid)
-install(FILES etc/qpid-dispatch.conf DESTINATION ${SYSCONF_INSTALL_DIR})
+install(FILES etc/qpid-dispatch.conf DESTINATION ${SYSCONF_INSTALL_DIR}/qpid)
##
## Python modules installation
@@ -149,6 +158,13 @@ set(PYTHON_CONFIG_SOURCES
python/qpid/dispatch/__init__.py
)
+set(DOC_FILES
+ ChangeLog
+ LICENSE
+ README.md
+ TODO
+)
+
install(FILES ${PYTHON_STUBS_SOURCES}
DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch/stubs)
@@ -163,6 +179,9 @@ install(FILES python/qpid/__init__.py
install(FILES python/qpid/dispatch/__init__.py
DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch)
+
+install(FILES ${DOC_FILES}
+ DESTINATION ${DOC_INSTALL_DIR}/qpid-dispatch)
##
## Build Tests
##
diff --git a/qpid/extras/dispatch/ChangeLog b/qpid/extras/dispatch/ChangeLog
index a171f0eb11..2a5b4bc4b7 100644
--- a/qpid/extras/dispatch/ChangeLog
+++ b/qpid/extras/dispatch/ChangeLog
@@ -1,2 +1,26 @@
Version 0.1:
* Initial development work.
+ * QPID-5186: Install documentation files.
+ * QPID-5185: Install qpid-dispatch.conf to /etc/qpid
+ * QPID-4612: Dispatch - Change server and container pattern to be consistent with other objects
+ * QPID-4613: Dispatch Message API Improvement
+ * QPID-4614: CTEST for Dispatch
+ * QPID-4913: Dispatch - Add a configuration file reader to configure the service
+ * QPID-4968: Dispatch - Generalized framework for embedded Python modules
+ * QPID-4974: Dispatch - Improve the API for parsing and composing AMQP-typed fields
+ * QPID-5066: Dispatch - move Python code into the qpid.dispatch package
+ * QPID-5068: Dispatch - Internal feature to easily add and update Delivery Annotations
+ * QPID-5096: Dispatch - Install the configuration file
+ * QPID-5097: Dispatch - create a source tarball
+ * QPID-5181: Dispatch - Assign temporary source addresses for dynamic listener links
+ * QPID-5185: Move the qpid-dispatch.conf file to /etc/qpid
+ * QPID-5186: Installing Dispatch should also install the LICENSE, TODO and related files
+ * QPID-5189: Add a config.sh file for Qpid Dispatch to set an environment for running the router
+
+ * QPID-4788: Dispatch - Re-schedule of an "immediate" timer causes crash
+ * QPID-4816: dispatch-router crashes when incomplete (but valid) url specified by client.
+ * QPID-4997: Dispatch - Thread safety issues in the usage of Proton
+ * QPID-5064: Dispatch - make-install doesn't install the Python artifacts
+ * QPID-5173: [dispatch] cmake ignores overrides to CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH
+ * QPID-5201: Dispatch - Fix build errors in Release mode
+ * QPID-5218: [dispatch] Crash when outgoing window > 0 and multiple subscribed Messenger clients
diff --git a/qpid/extras/dispatch/README.md b/qpid/extras/dispatch/README.md
index 22e1a68570..1a4438fdf9 100644
--- a/qpid/extras/dispatch/README.md
+++ b/qpid/extras/dispatch/README.md
@@ -13,8 +13,18 @@ $ mkdir build
$ cd build
$ cmake ..
$ make
-$ make test
+$ make test # see below
Note: Your PYTHONPATH _must_ include <dispatch>/python in its list of paths in order
to test and run Dispatch.
+Running The Tests
+=================
+
+Prior to running the unit tests, you should source the file config.sh which is
+found in the root directory.
+
+$ . config.sh
+
+The file sets up the environment so that the tests can find the Python
+libraries, etc.
diff --git a/qpid/extras/dispatch/TODO b/qpid/extras/dispatch/TODO
index ab0c1a951e..5bb334a6ca 100644
--- a/qpid/extras/dispatch/TODO
+++ b/qpid/extras/dispatch/TODO
@@ -5,3 +5,50 @@ enhancements to be fixed by going to the Apache Qpid JIRA instance:
http://issues.apache.org/jira/browse/QPID
==============================================================================
+
+- Router Mode:
+ o Stand-Alone-Router - Does not participate in routing protocol, does not permit inter-router
+ links, acts as a normal interior-router otherwise.
+ o Interior-Router - Participates in the routing protocol
+ o Edge-Concentrator - Does not participate in routing protocol, requires uplink connection(s)
+ This mode should be used when Dispatch is integrated into an endpoint
+ application or when it is acting as a connection concentrator.
+ Proxy and access-protocol functions will be available in this mode.
+
+- Connection Annotation:
+ o Type: Inter-router, uplink, endpoint, etc. This formal annotation can be accessed internally
+ by the connection handlers to guide Dispatch's handling of new connections.
+ o Weight-{in,out}: Weight/Cost metrics for inter-router links
+
+- Statistics for Instrumentation:
+ o Link
+ . delivery count {unsettled, pre-settled}
+ . deliveries {accepted, rejected, released, modified}
+ . octets of delivery {accepted, rejected, released, modified}
+ . flow frame count
+ . disposition frame count {forward, backward}
+ o Address
+ . deliveries {ingress, egress, transit}
+ . octets of delivery {ingress, egress, transit}
+
+- Infrastructure
+ o Router_Link - Buffer and Iterator for a copy of the link's target address (for use
+ as an address for messages with no 'to' field).
+ o Router Event Queue - Event queue to feed alerts to the Python router code.
+ Neighbor-link-loss is a valuable event because it accelerates the
+ detection of topology change.
+ o All PyRouter stimulus through a work queue.
+ o Router Code Updates
+ . Report address mappings to routers
+ . Generate RA immediately after updating routing tables
+ . Generate unsolicited updates for mobile addresses?
+ o Expose idle-timeout/keepalive on connectors and listeners
+
+- Major Roadmap Features
+ o Security Policy Enforcement
+ o Proxy (Translation Node) Capability
+ o Address Provisioning with variable semantics
+ o Link Routing
+ o Management, Instrumentation, and Accounting
+ o Link Cost
+ o Area Routing
diff --git a/qpid/extras/dispatch/config.sh b/qpid/extras/dispatch/config.sh
new file mode 100644
index 0000000000..3c96464ea9
--- /dev/null
+++ b/qpid/extras/dispatch/config.sh
@@ -0,0 +1,27 @@
+#!/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.
+#
+
+cd $(dirname ${BASH_SOURCE[0]}) > /dev/null
+export QPID_DISPATCH_HOME=$(pwd)
+cd - > /dev/null
+
+export PYTHONPATH=$QPID_DISPATCH_HOME/python:$QPID_DISPATCH_HOME/tools/src/py:$PYTHONPATH
+export PATH=$QPID_DISPATCH_HOME/tools/src/py:$PATH
+
diff --git a/qpid/extras/dispatch/etc/qpid-dispatch.conf b/qpid/extras/dispatch/etc/qpid-dispatch.conf
index ce7f5ed4c1..83fa98af60 100644
--- a/qpid/extras/dispatch/etc/qpid-dispatch.conf
+++ b/qpid/extras/dispatch/etc/qpid-dispatch.conf
@@ -102,6 +102,7 @@ listener {
listener {
label: Router Interconnect Access
+ role: inter-router
addr: 0.0.0.0
port: 5671
sasl-mechanisms: EXTERNAL
@@ -112,6 +113,7 @@ listener {
connector {
label: Router Uplink
+ role: inter-router
addr: backbone.enterprise.com
port: amqps
sasl-mechanisms: EXTERNAL
@@ -125,49 +127,27 @@ connector {
##
router {
##
- ## area and router-id - Each router is assigned an area name and a
- ## router-id that is unique within the area.
- ##
- area: all
- router-id: Router.A
-
- ##
- ## hello-interval - The interval, in seconds, between HELLO messages
- ## sent between connected routers. This interval can be relatively
- ## fast because HELLO messages do not propagate beyond one hop on the
- ## network. A good value is 1 second.
- ##
- hello-interval: 1
-
+ ## Router Mode:
##
- ## hello-max-age - The maximum time, in seconds, that can elapse
- ## without receiving a HELLO message from a neighbor before that
- ## neighbor is declared absent. A good value is 3 seconds.
+ ## standalone - Standalone router. In standalone mode, the router operates as
+ ## a single component. It does not participate in the routing protocol
+ ## and therefore will not coorperate with other routers.
+ ## interior - Interior router. The router operates in cooreration with other
+ ## interior routers in an interconnected network.
+ ## edge - Edge router. The router operates with an uplink into an interior
+ ## router network. Edge routers are typically used as connection concentrators
+ ## or as security firewalls for access into the interior network.
##
- hello-max-age: 3
+ mode: standalone
##
- ## ra-interval - The interval, in seconds, between RA (Router
- ## Advertisement) messages sent by this router. This interval should
- ## be considerably longer than the hello interval because RA messages
- ## propagate across the area. A good value is 30 seconds.
+ ## For Interior router mode only.
##
- ra-interval: 30
-
- ##
- ## remote-ls-max-age - The maximum age, in seconds, of a remote
- ## link-state record. Any such records that are not updated and time
- ## out shall be removed from the set and the topology shall be
- ## recomputed. A good value is 60 seconds.
- ##
- remote-ls-max-age: 60
-
- ##
- ## mobile-addr-max-age - The maximum age, in seconds, of a remote
- ## mobile address record. Any record that exceeds this age shall be
- ## removed from the routing table. A good value is 60 seconds.
+ ## area and router-id - Each router is assigned an area name and a
+ ## router-id that is unique within the area.
##
- mobile-addr-max-age: 60
+ area: all
+ router-id: Router.A
}
diff --git a/qpid/extras/dispatch/include/qpid/dispatch.h b/qpid/extras/dispatch/include/qpid/dispatch.h
index 72b3456099..6b3d6a963f 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch.h
@@ -20,6 +20,7 @@
*/
#include <qpid/dispatch/alloc.h>
+#include <qpid/dispatch/bitmask.h>
#include <qpid/dispatch/buffer.h>
#include <qpid/dispatch/ctools.h>
#include <qpid/dispatch/hash.h>
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/amqp.h b/qpid/extras/dispatch/include/qpid/dispatch/amqp.h
index 9babeb930d..c27eec6589 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/amqp.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/amqp.h
@@ -76,5 +76,23 @@
#define DX_AMQP_ARRAY8 0xe0
#define DX_AMQP_ARRAY32 0xf0
+/**
+ * Delivery Annotation Headers
+ */
+const char * const DX_DA_INGRESS; // Ingress Router
+const char * const DX_DA_TRACE; // Trace
+const char * const DX_DA_TO; // To-Override
+
+/**
+ * Link Terminus Capabilities
+ */
+const char * const DX_CAPABILITY_ROUTER;
+
+/**
+ * Miscellaneous Strings
+ */
+const char * const DX_INTERNODE_LINK_NAME_1;
+const char * const DX_INTERNODE_LINK_NAME_2;
+
#endif
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/bitmask.h b/qpid/extras/dispatch/include/qpid/dispatch/bitmask.h
new file mode 100644
index 0000000000..fe436bc19b
--- /dev/null
+++ b/qpid/extras/dispatch/include/qpid/dispatch/bitmask.h
@@ -0,0 +1,37 @@
+#ifndef __dispatch_bitmask_h__
+#define __dispatch_bitmask_h__ 1
+/*
+ * 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.
+ */
+
+typedef struct dx_bitmask_t dx_bitmask_t;
+
+int dx_bitmask_width();
+dx_bitmask_t *dx_bitmask(int initial);
+void dx_bitmask_free(dx_bitmask_t *b);
+void dx_bitmask_set_all(dx_bitmask_t *b);
+void dx_bitmask_clear_all(dx_bitmask_t *b);
+void dx_bitmask_set_bit(dx_bitmask_t *b, int bitnum);
+void dx_bitmask_clear_bit(dx_bitmask_t *b, int bitnum);
+int dx_bitmask_value(dx_bitmask_t *b, int bitnum);
+int dx_bitmask_first_set(dx_bitmask_t *b, int *bitnum);
+
+
+
+#endif
+
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/buffer.h b/qpid/extras/dispatch/include/qpid/dispatch/buffer.h
index 1c372b265d..fadded4d74 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/buffer.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/buffer.h
@@ -36,12 +36,12 @@ void dx_buffer_set_size(size_t size);
/**
*/
-dx_buffer_t *dx_allocate_buffer(void);
+dx_buffer_t *dx_buffer(void);
/**
* @param buf A pointer to an allocated buffer
*/
-void dx_free_buffer(dx_buffer_t *buf);
+void dx_buffer_free(dx_buffer_t *buf);
/**
* @param buf A pointer to an allocated buffer
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/compose.h b/qpid/extras/dispatch/include/qpid/dispatch/compose.h
index 7d668f0ac0..d68f6be746 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/compose.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/compose.h
@@ -167,7 +167,8 @@ void dx_compose_insert_string(dx_composed_field_t *field, const char *value);
* Insert a utf8-encoded string into the field from an iterator
*
* @param field A field created by dx_compose.
- * @param value A pointer to a null-terminated string.
+ * @param iter An iterator for a string value. The caller is responsible for freeing
+ * this iterator after the call is complete.
*/
void dx_compose_insert_string_iterator(dx_composed_field_t *field, dx_field_iterator_t *iter);
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/container.h b/qpid/extras/dispatch/include/qpid/dispatch/container.h
index a306895b50..03fdd0c4cc 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/container.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/container.h
@@ -152,8 +152,21 @@ dx_dist_mode_t dx_container_node_get_dist_modes(const dx_node_t *node);
dx_lifetime_policy_t dx_container_node_get_life_policy(const dx_node_t *node);
dx_link_t *dx_link(dx_node_t *node, dx_connection_t *conn, dx_direction_t dir, const char *name);
+
+/**
+ * Context associated with the link for storing link-specific state.
+ */
void dx_link_set_context(dx_link_t *link, void *link_context);
void *dx_link_get_context(dx_link_t *link);
+
+/**
+ * Link context associated with the link's connection for storing state shared across
+ * all links in a connection.
+ */
+void dx_link_set_conn_context(dx_link_t *link, void *link_context);
+void *dx_link_get_conn_context(dx_link_t *link);
+
+dx_connection_t *dx_link_connection(dx_link_t *link);
pn_link_t *dx_link_pn(dx_link_t *link);
pn_terminus_t *dx_link_source(dx_link_t *link);
pn_terminus_t *dx_link_target(dx_link_t *link);
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/hash.h b/qpid/extras/dispatch/include/qpid/dispatch/hash.h
index bfad142517..4f079f6993 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/hash.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/hash.h
@@ -23,16 +23,23 @@
#include <qpid/dispatch/iterator.h>
#include <qpid/dispatch/error.h>
-typedef struct hash_t hash_t;
+typedef struct dx_hash_t dx_hash_t;
+typedef struct dx_hash_handle_t dx_hash_handle_t;
-hash_t *hash(int bucket_exponent, int batch_size, int value_is_const);
-void hash_free(hash_t *h);
+dx_hash_t *dx_hash(int bucket_exponent, int batch_size, int value_is_const);
+void dx_hash_free(dx_hash_t *h);
+
+size_t dx_hash_size(dx_hash_t *h);
+dx_error_t dx_hash_insert(dx_hash_t *h, dx_field_iterator_t *key, void *val, dx_hash_handle_t **handle);
+dx_error_t dx_hash_insert_const(dx_hash_t *h, dx_field_iterator_t *key, const void *val, dx_hash_handle_t **handle);
+dx_error_t dx_hash_retrieve(dx_hash_t *h, dx_field_iterator_t *key, void **val);
+dx_error_t dx_hash_retrieve_const(dx_hash_t *h, dx_field_iterator_t *key, const void **val);
+dx_error_t dx_hash_remove(dx_hash_t *h, dx_field_iterator_t *key);
+
+void dx_hash_handle_free(dx_hash_handle_t *handle);
+const unsigned char *dx_hash_key_by_handle(const dx_hash_handle_t *handle);
+dx_error_t dx_hash_remove_by_handle(dx_hash_t *h, dx_hash_handle_t *handle);
+dx_error_t dx_hash_remove_by_handle2(dx_hash_t *h, dx_hash_handle_t *handle, unsigned char **key);
-size_t hash_size(hash_t *h);
-dx_error_t hash_insert(hash_t *h, dx_field_iterator_t *key, void *val);
-dx_error_t hash_insert_const(hash_t *h, dx_field_iterator_t *key, const void *val);
-dx_error_t hash_retrieve(hash_t *h, dx_field_iterator_t *key, void **val);
-dx_error_t hash_retrieve_const(hash_t *h, dx_field_iterator_t *key, const void **val);
-dx_error_t hash_remove(hash_t *h, dx_field_iterator_t *key);
#endif
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/message.h b/qpid/extras/dispatch/include/qpid/dispatch/message.h
index 34a7933f9f..8702e509b3 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/message.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/message.h
@@ -96,7 +96,7 @@ typedef enum {
* @return A pointer to a dx_message_t that is the sole reference to a newly allocated
* message.
*/
-dx_message_t *dx_allocate_message(void);
+dx_message_t *dx_message(void);
/**
* Free a message reference. If this is the last reference to the message, free the
@@ -104,7 +104,7 @@ dx_message_t *dx_allocate_message(void);
*
* @param msg A pointer to a dx_message_t that is no longer needed.
*/
-void dx_free_message(dx_message_t *msg);
+void dx_message_free(dx_message_t *msg);
/**
* Make a new reference to an existing message.
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/python_embedded.h b/qpid/extras/dispatch/include/qpid/dispatch/python_embedded.h
index 644885bbd7..aad0453c24 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/python_embedded.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/python_embedded.h
@@ -71,4 +71,11 @@ void dx_py_to_composed(PyObject *value, dx_composed_field_t *field);
*/
PyObject *dx_field_to_py(dx_parsed_field_t *field);
+/**
+ * These are temporary and will eventually be replaced by having an internal python
+ * work queue that feeds a dedicated embedded-python thread.
+ */
+void dx_python_lock();
+void dx_python_unlock();
+
#endif
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/router.h b/qpid/extras/dispatch/include/qpid/dispatch/router.h
index c900d93615..1dadc8d119 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/router.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/router.h
@@ -27,7 +27,7 @@
typedef struct dx_address_t dx_address_t;
-typedef void (*dx_router_message_cb)(void *context, dx_message_t *msg);
+typedef void (*dx_router_message_cb)(void *context, dx_message_t *msg, int link_id);
const char *dx_router_id(const dx_dispatch_t *dx);
diff --git a/qpid/extras/dispatch/include/qpid/dispatch/server.h b/qpid/extras/dispatch/include/qpid/dispatch/server.h
index 7b2d4a2432..e50f9ac75b 100644
--- a/qpid/extras/dispatch/include/qpid/dispatch/server.h
+++ b/qpid/extras/dispatch/include/qpid/dispatch/server.h
@@ -186,7 +186,7 @@ typedef struct dx_connector_t dx_connector_t;
typedef struct dx_connection_t dx_connection_t;
/**
- * Event type for the connection callback.
+ * \brief Event type for the connection callback.
*/
typedef enum {
/// The connection just opened via a listener (inbound).
@@ -204,79 +204,6 @@ typedef enum {
/**
- * \brief Connection Event Handler
- *
- * Callback invoked when processing is needed on a proton connection. This
- * callback shall be invoked on one of the server's worker threads. The
- * server guarantees that no two threads shall be allowed to process a single
- * connection concurrently. The implementation of this handler may assume
- * that it has exclusive access to the connection and its subservient
- * components (sessions, links, deliveries, etc.).
- *
- * @param handler_context The handler context supplied in dx_server_set_conn_handler.
- * @param conn_context The handler context supplied in dx_server_{connect,listen}.
- * @param event The event/reason for the invocation of the handler.
- * @param conn The connection that requires processing by the handler.
- * @return A value greater than zero if the handler did any proton processing for
- * the connection. If no work was done, zero is returned.
- */
-typedef int (*dx_conn_handler_cb_t)(void *handler_context, void* conn_context, dx_conn_event_t event, dx_connection_t *conn);
-
-
-/**
- * \brief Set the connection event handler callback.
- *
- * Set the connection handler callback for the server. This callback is
- * mandatory and must be set prior to the invocation of dx_server_run.
- *
- * @param dx The dispatch handle returned by dx_dispatch.
- * @param conn_hander The handler for processing connection-related events.
- */
-void dx_server_set_conn_handler(dx_dispatch_t *dx, dx_conn_handler_cb_t conn_handler, void *handler_context);
-
-
-/**
- * \brief Set the user context for a connection.
- *
- * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
- * @param context User context to be stored with the connection.
- */
-void dx_connection_set_context(dx_connection_t *conn, void *context);
-
-
-/**
- * \brief Get the user context from a connection.
- *
- * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
- * @return The user context stored with the connection.
- */
-void *dx_connection_get_context(dx_connection_t *conn);
-
-
-/**
- * \brief Activate a connection for output.
- *
- * This function is used to request that the server activate the indicated
- * connection. It is assumed that the connection is one that the caller does
- * not have permission to access (i.e. it may be owned by another thread
- * currently). An activated connection will, when writable, appear in the
- * internal work list and be invoked for processing by a worker thread.
- *
- * @param conn The connection over which the application wishes to send data
- */
-void dx_server_activate(dx_connection_t *conn);
-
-
-/**
- * \brief Get the wrapped proton-engine connection object.
- *
- * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
- * @return The proton connection object.
- */
-pn_connection_t *dx_connection_pn(dx_connection_t *conn);
-
-
-/**
* \brief Configuration block for a connector or a listener.
*/
typedef struct dx_server_config_t {
@@ -367,10 +294,116 @@ typedef struct dx_server_config_t {
* meaningful for outgoing (connector) connections only.
*/
int allow_redirect;
+
+ /**
+ * The specified role of the connection. This can be used to control the behavior and
+ * capabilities of the connections.
+ */
+ const char *role;
} dx_server_config_t;
/**
+ * \brief Connection Event Handler
+ *
+ * Callback invoked when processing is needed on a proton connection. This
+ * callback shall be invoked on one of the server's worker threads. The
+ * server guarantees that no two threads shall be allowed to process a single
+ * connection concurrently. The implementation of this handler may assume
+ * that it has exclusive access to the connection and its subservient
+ * components (sessions, links, deliveries, etc.).
+ *
+ * @param handler_context The handler context supplied in dx_server_set_conn_handler.
+ * @param conn_context The handler context supplied in dx_server_{connect,listen}.
+ * @param event The event/reason for the invocation of the handler.
+ * @param conn The connection that requires processing by the handler.
+ * @return A value greater than zero if the handler did any proton processing for
+ * the connection. If no work was done, zero is returned.
+ */
+typedef int (*dx_conn_handler_cb_t)(void *handler_context, void* conn_context, dx_conn_event_t event, dx_connection_t *conn);
+
+
+/**
+ * \brief Set the connection event handler callback.
+ *
+ * Set the connection handler callback for the server. This callback is
+ * mandatory and must be set prior to the invocation of dx_server_run.
+ *
+ * @param dx The dispatch handle returned by dx_dispatch.
+ * @param conn_hander The handler for processing connection-related events.
+ */
+void dx_server_set_conn_handler(dx_dispatch_t *dx, dx_conn_handler_cb_t conn_handler, void *handler_context);
+
+
+/**
+ * \brief Set the user context for a connection.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @param context User context to be stored with the connection.
+ */
+void dx_connection_set_context(dx_connection_t *conn, void *context);
+
+
+/**
+ * \brief Get the user context from a connection.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @return The user context stored with the connection.
+ */
+void *dx_connection_get_context(dx_connection_t *conn);
+
+
+/**
+ * \brief Set the link context for a connection.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @param context Link context to be stored with the connection.
+ */
+void dx_connection_set_link_context(dx_connection_t *conn, void *context);
+
+
+/**
+ * \brief Get the link context from a connection.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @return The link context stored with the connection.
+ */
+void *dx_connection_get_link_context(dx_connection_t *conn);
+
+
+/**
+ * \brief Activate a connection for output.
+ *
+ * This function is used to request that the server activate the indicated
+ * connection. It is assumed that the connection is one that the caller does
+ * not have permission to access (i.e. it may be owned by another thread
+ * currently). An activated connection will, when writable, appear in the
+ * internal work list and be invoked for processing by a worker thread.
+ *
+ * @param conn The connection over which the application wishes to send data
+ */
+void dx_server_activate(dx_connection_t *conn);
+
+
+/**
+ * \brief Get the wrapped proton-engine connection object.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @return The proton connection object.
+ */
+pn_connection_t *dx_connection_pn(dx_connection_t *conn);
+
+
+/**
+ * \brief Get the configuration that was used in the setup of this connection.
+ *
+ * @param conn Connection object supplied in DX_CONN_EVENT_{LISTENER,CONNETOR}_OPEN
+ * @return A pointer to the server configuration used in the establishment of this connection.
+ */
+const dx_server_config_t *dx_connection_config(const dx_connection_t *conn);
+
+
+/**
* \brief Create a listener for incoming connections.
*
* @param dx The dispatch handle returned by dx_dispatch.
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/config/schema.py b/qpid/extras/dispatch/python/qpid/dispatch/config/schema.py
index 545139f0df..7b00000c99 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/config/schema.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/config/schema.py
@@ -57,6 +57,7 @@ config_schema = {
'addr' : (str, 0, "M"),
'port' : (str, 1, "M"),
'label' : (str, None, "", None),
+ 'role' : (str, None, "", 'normal'),
'sasl-mechanisms' : (str, None, "M"),
'ssl-profile' : (str, None, "E", None),
'require-peer-auth' : (bool, None, "", True),
@@ -66,11 +67,13 @@ config_schema = {
'addr' : (str, 0, "M"),
'port' : (str, 1, "M"),
'label' : (str, None, "", None),
+ 'role' : (str, None, "", 'normal'),
'sasl-mechanisms' : (str, None, "M"),
'ssl-profile' : (str, None, "E", None),
'allow-redirect' : (bool, None, "", True)
}),
'router' : (True, {
+ 'mode' : (str, None, "", 'standalone'),
'router-id' : (str, None, "M"),
'area' : (str, None, "", None),
'hello-interval' : (int, None, "", 1),
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/adapter.py b/qpid/extras/dispatch/python/qpid/dispatch/router/adapter.py
deleted file mode 100644
index 7f7f6c9e8e..0000000000
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/adapter.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# 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.
-#
-
-try:
- from dispatch import *
-except ImportError:
- from ..stubs import *
-
-ENTRY_OLD = 1
-ENTRY_CURRENT = 2
-ENTRY_NEW = 3
-
-class AdapterEngine(object):
- """
- This module is responsible for managing the Adapter's key bindings (list of address-subject:next-hop).
- Key binding lists are kept in disjoint key-classes that can come from different parts of the router
- (i.e. topological keys for inter-router communication and mobile keys for end users).
-
- For each key-class, a mirror copy of what the adapter has is kept internally. This allows changes to the
- routing tables to be efficiently communicated to the adapter in the form of table deltas.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.key_classes = {} # map [key_class] => (addr-key, next-hop)
-
-
- def tick(self, now):
- """
- There is no periodic processing needed for this module.
- """
- pass
-
-
- def remote_routes_changed(self, key_class, new_table):
- old_table = []
- if key_class in self.key_classes:
- old_table = self.key_classes[key_class]
-
- # flag all of the old entries
- old_flags = {}
- for a,b in old_table:
- old_flags[(a,b)] = ENTRY_OLD
-
- # flag the new entries
- new_flags = {}
- for a,b in new_table:
- new_flags[(a,b)] = ENTRY_NEW
-
- # calculate the differences from old to new
- for a,b in new_table:
- if old_table.count((a,b)) > 0:
- old_flags[(a,b)] = ENTRY_CURRENT
- new_flags[(a,b)] = ENTRY_CURRENT
-
- # make to_add and to_delete lists
- to_add = []
- to_delete = []
- for (a,b),f in old_flags.items():
- if f == ENTRY_OLD:
- to_delete.append((a,b))
- for (a,b),f in new_flags.items():
- if f == ENTRY_NEW:
- to_add.append((a,b))
-
- # set the routing table to the new contents
- self.key_classes[key_class] = new_table
-
- # update the adapter's routing tables
- # Note: Do deletions before adds to avoid overlapping routes that may cause
- # messages to be duplicated. It's better to have gaps in the routing
- # tables momentarily because unroutable messages are stored for retry.
- for a,b in to_delete:
- self.container.router_adapter.remote_unbind(a, b)
- for a,b in to_add:
- self.container.router_adapter.remote_bind(a, b)
-
- self.container.log(LOG_INFO, "New Routing Table (class=%s):" % key_class)
- for a,b in new_table:
- self.container.log(LOG_INFO, " %s => %s" % (a, b))
-
-
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/binding.py b/qpid/extras/dispatch/python/qpid/dispatch/router/binding.py
deleted file mode 100644
index a37b585e3e..0000000000
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/binding.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# 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.
-#
-
-try:
- from dispatch import *
-except ImportError:
- from ..stubs import *
-
-
-class BindingEngine(object):
- """
- This module is responsible for responding to two different events:
- 1) The learning of new remote mobile addresses
- 2) The change of topology (i.e. different next-hops for remote routers)
- When these occur, this module converts the mobile routing table (address => router)
- to a next-hop routing table (address => next-hop), compresses the keys in case there
- are wild-card overlaps, and notifies outbound of changes in the "mobile-key" address class.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.current_keys = {}
-
-
- def tick(self, now):
- pass
-
-
- def mobile_keys_changed(self, keys):
- self.current_keys = keys
- next_hop_keys = self._convert_ids_to_next_hops(keys)
- routing_table = self._compress_keys(next_hop_keys)
- self.container.remote_routes_changed('mobile-key', routing_table)
-
-
- def next_hops_changed(self):
- next_hop_keys = self._convert_ids_to_next_hops(self.current_keys)
- routing_table = self._compress_keys(next_hop_keys)
- self.container.remote_routes_changed('mobile-key', routing_table)
-
-
- def _convert_ids_to_next_hops(self, keys):
- next_hops = self.container.get_next_hops()
- new_keys = {}
- for _id, value in keys.items():
- if _id in next_hops:
- next_hop = next_hops[_id]
- if next_hop not in new_keys:
- new_keys[next_hop] = []
- new_keys[next_hop].extend(value)
- return new_keys
-
-
- def _compress_keys(self, keys):
- trees = {}
- for _id, key_list in keys.items():
- trees[_id] = TopicElementList()
- for key in key_list:
- trees[_id].add_key(key)
- routing_table = []
- for _id, tree in trees.items():
- tree_keys = tree.get_list()
- for tk in tree_keys:
- routing_table.append((tk, _id))
- return routing_table
-
-
-class TopicElementList(object):
- """
- """
- def __init__(self):
- self.elements = {} # map text => (terminal, sub-list)
-
- def __repr__(self):
- return "%r" % self.elements
-
- def add_key(self, key):
- self.add_tokens(key.split('.'))
-
- def add_tokens(self, tokens):
- first = tokens.pop(0)
- terminal = len(tokens) == 0
-
- if terminal and first == '#':
- ## Optimization #1A (A.B.C.D followed by A.B.#)
- self.elements = {'#':(True, TopicElementList())}
- return
-
- if '#' in self.elements:
- _t,_el = self.elements['#']
- if _t:
- ## Optimization #1B (A.B.# followed by A.B.C.D)
- return
-
- if first not in self.elements:
- self.elements[first] = (terminal, TopicElementList())
- else:
- _t,_el = self.elements[first]
- if terminal and not _t:
- self.elements[first] = (terminal, _el)
-
- if not terminal:
- _t,_el = self.elements[first]
- _el.add_tokens(tokens)
-
- def get_list(self):
- keys = []
- for token, (_t,_el) in self.elements.items():
- if _t: keys.append(token)
- _el.build_list(token, keys)
- return keys
-
- def build_list(self, prefix, keys):
- for token, (_t,_el) in self.elements.items():
- if _t: keys.append("%s.%s" % (prefix, token))
- _el.build_list("%s.%s" % (prefix, token), keys)
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/configuration.py b/qpid/extras/dispatch/python/qpid/dispatch/router/configuration.py
index f87d2ee7d2..e0fd060b82 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/configuration.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/configuration.py
@@ -18,30 +18,30 @@
#
class Configuration(object):
- """
- This module manages and holds the configuration and tuning parameters for a router.
- """
- def __init__(self, overrides={}):
- ##
- ## Load default values
- ##
- self.values = { 'hello_interval' : 1.0,
- 'hello_max_age' : 3.0,
- 'ra_interval' : 30.0,
- 'remote_ls_max_age' : 60.0,
- 'mobile_addr_max_age' : 60.0 }
+ """
+ This module manages and holds the configuration and tuning parameters for a router.
+ """
+ def __init__(self, overrides={}):
+ ##
+ ## Load default values
+ ##
+ self.values = { 'hello_interval' : 1.0,
+ 'hello_max_age' : 3.0,
+ 'ra_interval' : 30.0,
+ 'remote_ls_max_age' : 60.0,
+ 'mobile_addr_max_age' : 60.0 }
- ##
- ## Apply supplied overrides
- ##
- for k, v in overrides.items():
- self.values[k] = v
+ ##
+ ## Apply supplied overrides
+ ##
+ for k, v in overrides.items():
+ self.values[k] = v
- def __getattr__(self, key):
- if key in self.values:
- return self.values[key]
- raise KeyError
+ def __getattr__(self, key):
+ if key in self.values:
+ return self.values[key]
+ raise KeyError
- def __repr__(self):
- return "%r" % self.values
+ def __repr__(self):
+ return "%r" % self.values
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/data.py b/qpid/extras/dispatch/python/qpid/dispatch/router/data.py
index 89e347a29e..812369768f 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/data.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/data.py
@@ -19,257 +19,257 @@
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
def getMandatory(data, key, cls=None):
- """
- Get the value mapped to the requested key. If it's not present, raise an exception.
- """
- if key in data:
- value = data[key]
- if cls and value.__class__ != cls:
- raise Exception("Protocol field has wrong data type: '%s' type=%r expected=%r" % (key, value.__class__, cls))
- return value
- raise Exception("Mandatory protocol field missing: '%s'" % key)
+ """
+ Get the value mapped to the requested key. If it's not present, raise an exception.
+ """
+ if key in data:
+ value = data[key]
+ if cls and value.__class__ != cls:
+ raise Exception("Protocol field has wrong data type: '%s' type=%r expected=%r" % (key, value.__class__, cls))
+ return value
+ raise Exception("Mandatory protocol field missing: '%s'" % key)
def getOptional(data, key, default=None, cls=None):
- """
- Get the value mapped to the requested key. If it's not present, return the default value.
- """
- if key in data:
- value = data[key]
- if cls and value.__class__ != cls:
- raise Exception("Protocol field has wrong data type: '%s' type=%r expected=%r" % (key, value.__class__, cls))
- return value
- return default
+ """
+ Get the value mapped to the requested key. If it's not present, return the default value.
+ """
+ if key in data:
+ value = data[key]
+ if cls and value.__class__ != cls:
+ raise Exception("Protocol field has wrong data type: '%s' type=%r expected=%r" % (key, value.__class__, cls))
+ return value
+ return default
class LinkState(object):
- """
- The link-state of a single router. The link state consists of a list of neighbor routers reachable from
- the reporting router. The link-state-sequence number is incremented each time the link state changes.
- """
- def __init__(self, body, _id=None, _area=None, _ls_seq=None, _peers=None):
- self.last_seen = 0
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.ls_seq = getMandatory(body, 'ls_seq', long)
- self.peers = getMandatory(body, 'peers', list)
- else:
- self.id = _id
- self.area = _area
- self.ls_seq = long(_ls_seq)
- self.peers = _peers
-
- def __repr__(self):
- return "LS(id=%s area=%s ls_seq=%d peers=%r)" % (self.id, self.area, self.ls_seq, self.peers)
-
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area,
- 'ls_seq' : self.ls_seq,
- 'peers' : self.peers}
-
- def add_peer(self, _id):
- if self.peers.count(_id) == 0:
- self.peers.append(_id)
- return True
- return False
-
- def del_peer(self, _id):
- if self.peers.count(_id) > 0:
- self.peers.remove(_id)
- return True
- return False
-
- def bump_sequence(self):
- self.ls_seq += 1
+ """
+ The link-state of a single router. The link state consists of a list of neighbor routers reachable from
+ the reporting router. The link-state-sequence number is incremented each time the link state changes.
+ """
+ def __init__(self, body, _id=None, _area=None, _ls_seq=None, _peers=None):
+ self.last_seen = 0
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.ls_seq = getMandatory(body, 'ls_seq', long)
+ self.peers = getMandatory(body, 'peers', list)
+ else:
+ self.id = _id
+ self.area = _area
+ self.ls_seq = long(_ls_seq)
+ self.peers = _peers
+
+ def __repr__(self):
+ return "LS(id=%s area=%s ls_seq=%d peers=%r)" % (self.id, self.area, self.ls_seq, self.peers)
+
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area,
+ 'ls_seq' : self.ls_seq,
+ 'peers' : self.peers}
+
+ def add_peer(self, _id):
+ if self.peers.count(_id) == 0:
+ self.peers.append(_id)
+ return True
+ return False
+
+ def del_peer(self, _id):
+ if self.peers.count(_id) > 0:
+ self.peers.remove(_id)
+ return True
+ return False
+
+ def bump_sequence(self):
+ self.ls_seq += 1
class MessageHELLO(object):
- """
- HELLO Message
- scope: neighbors only - HELLO messages travel at most one hop
- This message is used by directly connected routers to determine with whom they have
- bidirectional connectivity.
- """
- def __init__(self, body, _id=None, _area=None, _seen_peers=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.seen_peers = getMandatory(body, 'seen', list)
- else:
- self.id = _id
- self.area = _area
- self.seen_peers = _seen_peers
-
- def __repr__(self):
- return "HELLO(id=%s area=%s seen=%r)" % (self.id, self.area, self.seen_peers)
-
- def get_opcode(self):
- return 'HELLO'
-
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area,
- 'seen' : self.seen_peers}
-
- def is_seen(self, _id):
- return self.seen_peers.count(_id) > 0
+ """
+ HELLO Message
+ scope: neighbors only - HELLO messages travel at most one hop
+ This message is used by directly connected routers to determine with whom they have
+ bidirectional connectivity.
+ """
+ def __init__(self, body, _id=None, _area=None, _seen_peers=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.seen_peers = getMandatory(body, 'seen', list)
+ else:
+ self.id = _id
+ self.area = _area
+ self.seen_peers = _seen_peers
+
+ def __repr__(self):
+ return "HELLO(id=%s area=%s seen=%r)" % (self.id, self.area, self.seen_peers)
+
+ def get_opcode(self):
+ return 'HELLO'
+
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area,
+ 'seen' : self.seen_peers}
+
+ def is_seen(self, _id):
+ return self.seen_peers.count(_id) > 0
class MessageRA(object):
- """
- Router Advertisement (RA) Message
- scope: all routers in the area and all designated routers
- This message is sent periodically to indicate the originating router's sequence numbers
- for link-state and mobile-address-state.
- """
- def __init__(self, body, _id=None, _area=None, _ls_seq=None, _mobile_seq=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.ls_seq = getMandatory(body, 'ls_seq', long)
- self.mobile_seq = getMandatory(body, 'mobile_seq', long)
- else:
- self.id = _id
- self.area = _area
- self.ls_seq = long(_ls_seq)
- self.mobile_seq = long(_mobile_seq)
-
- def get_opcode(self):
- return 'RA'
-
- def __repr__(self):
- return "RA(id=%s area=%s ls_seq=%d mobile_seq=%d)" % \
- (self.id, self.area, self.ls_seq, self.mobile_seq)
-
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area,
- 'ls_seq' : self.ls_seq,
- 'mobile_seq' : self.mobile_seq}
+ """
+ Router Advertisement (RA) Message
+ scope: all routers in the area and all designated routers
+ This message is sent periodically to indicate the originating router's sequence numbers
+ for link-state and mobile-address-state.
+ """
+ def __init__(self, body, _id=None, _area=None, _ls_seq=None, _mobile_seq=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.ls_seq = getMandatory(body, 'ls_seq', long)
+ self.mobile_seq = getMandatory(body, 'mobile_seq', long)
+ else:
+ self.id = _id
+ self.area = _area
+ self.ls_seq = long(_ls_seq)
+ self.mobile_seq = long(_mobile_seq)
+
+ def get_opcode(self):
+ return 'RA'
+
+ def __repr__(self):
+ return "RA(id=%s area=%s ls_seq=%d mobile_seq=%d)" % \
+ (self.id, self.area, self.ls_seq, self.mobile_seq)
+
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area,
+ 'ls_seq' : self.ls_seq,
+ 'mobile_seq' : self.mobile_seq}
class MessageLSU(object):
- """
- """
- def __init__(self, body, _id=None, _area=None, _ls_seq=None, _ls=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.ls_seq = getMandatory(body, 'ls_seq', long)
- self.ls = LinkState(getMandatory(body, 'ls', dict))
- else:
- self.id = _id
- self.area = _area
- self.ls_seq = long(_ls_seq)
- self.ls = _ls
-
- def get_opcode(self):
- return 'LSU'
-
- def __repr__(self):
- return "LSU(id=%s area=%s ls_seq=%d ls=%r)" % \
- (self.id, self.area, self.ls_seq, self.ls)
-
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area,
- 'ls_seq' : self.ls_seq,
- 'ls' : self.ls.to_dict()}
+ """
+ """
+ def __init__(self, body, _id=None, _area=None, _ls_seq=None, _ls=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.ls_seq = getMandatory(body, 'ls_seq', long)
+ self.ls = LinkState(getMandatory(body, 'ls', dict))
+ else:
+ self.id = _id
+ self.area = _area
+ self.ls_seq = long(_ls_seq)
+ self.ls = _ls
+
+ def get_opcode(self):
+ return 'LSU'
+
+ def __repr__(self):
+ return "LSU(id=%s area=%s ls_seq=%d ls=%r)" % \
+ (self.id, self.area, self.ls_seq, self.ls)
+
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area,
+ 'ls_seq' : self.ls_seq,
+ 'ls' : self.ls.to_dict()}
class MessageLSR(object):
- """
- """
- def __init__(self, body, _id=None, _area=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- else:
- self.id = _id
- self.area = _area
+ """
+ """
+ def __init__(self, body, _id=None, _area=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ else:
+ self.id = _id
+ self.area = _area
- def get_opcode(self):
- return 'LSR'
+ def get_opcode(self):
+ return 'LSR'
- def __repr__(self):
- return "LSR(id=%s area=%s)" % (self.id, self.area)
+ def __repr__(self):
+ return "LSR(id=%s area=%s)" % (self.id, self.area)
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area}
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area}
class MessageMAU(object):
- """
- """
- def __init__(self, body, _id=None, _area=None, _seq=None, _add_list=None, _del_list=None, _exist_list=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.mobile_seq = getMandatory(body, 'mobile_seq', long)
- self.add_list = getOptional(body, 'add', None, list)
- self.del_list = getOptional(body, 'del', None, list)
- self.exist_list = getOptional(body, 'exist', None, list)
- else:
- self.id = _id
- self.area = _area
- self.mobile_seq = long(_seq)
- self.add_list = _add_list
- self.del_list = _del_list
- self.exist_list = _exist_list
-
- def get_opcode(self):
- return 'MAU'
-
- def __repr__(self):
- _add = ''
- _del = ''
- _exist = ''
- if self.add_list: _add = ' add=%r' % self.add_list
- if self.del_list: _del = ' del=%r' % self.del_list
- if self.exist_list: _exist = ' exist=%r' % self.exist_list
- return "MAU(id=%s area=%s mobile_seq=%d%s%s%s)" % \
- (self.id, self.area, self.mobile_seq, _add, _del, _exist)
-
- def to_dict(self):
- body = { 'id' : self.id,
- 'area' : self.area,
- 'mobile_seq' : self.mobile_seq }
- if self.add_list: body['add'] = self.add_list
- if self.del_list: body['del'] = self.del_list
- if self.exist_list: body['exist'] = self.exist_list
- return body
+ """
+ """
+ def __init__(self, body, _id=None, _area=None, _seq=None, _add_list=None, _del_list=None, _exist_list=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.mobile_seq = getMandatory(body, 'mobile_seq', long)
+ self.add_list = getOptional(body, 'add', None, list)
+ self.del_list = getOptional(body, 'del', None, list)
+ self.exist_list = getOptional(body, 'exist', None, list)
+ else:
+ self.id = _id
+ self.area = _area
+ self.mobile_seq = long(_seq)
+ self.add_list = _add_list
+ self.del_list = _del_list
+ self.exist_list = _exist_list
+
+ def get_opcode(self):
+ return 'MAU'
+
+ def __repr__(self):
+ _add = ''
+ _del = ''
+ _exist = ''
+ if self.add_list: _add = ' add=%r' % self.add_list
+ if self.del_list: _del = ' del=%r' % self.del_list
+ if self.exist_list: _exist = ' exist=%r' % self.exist_list
+ return "MAU(id=%s area=%s mobile_seq=%d%s%s%s)" % \
+ (self.id, self.area, self.mobile_seq, _add, _del, _exist)
+
+ def to_dict(self):
+ body = { 'id' : self.id,
+ 'area' : self.area,
+ 'mobile_seq' : self.mobile_seq }
+ if self.add_list: body['add'] = self.add_list
+ if self.del_list: body['del'] = self.del_list
+ if self.exist_list: body['exist'] = self.exist_list
+ return body
class MessageMAR(object):
- """
- """
- def __init__(self, body, _id=None, _area=None, _have_seq=None):
- if body:
- self.id = getMandatory(body, 'id', str)
- self.area = getMandatory(body, 'area', str)
- self.have_seq = getMandatory(body, 'have_seq', long)
- else:
- self.id = _id
- self.area = _area
- self.have_seq = long(_have_seq)
-
- def get_opcode(self):
- return 'MAR'
-
- def __repr__(self):
- return "MAR(id=%s area=%s have_seq=%d)" % (self.id, self.area, self.have_seq)
-
- def to_dict(self):
- return {'id' : self.id,
- 'area' : self.area,
- 'have_seq' : self.have_seq}
+ """
+ """
+ def __init__(self, body, _id=None, _area=None, _have_seq=None):
+ if body:
+ self.id = getMandatory(body, 'id', str)
+ self.area = getMandatory(body, 'area', str)
+ self.have_seq = getMandatory(body, 'have_seq', long)
+ else:
+ self.id = _id
+ self.area = _area
+ self.have_seq = long(_have_seq)
+
+ def get_opcode(self):
+ return 'MAR'
+
+ def __repr__(self):
+ return "MAR(id=%s area=%s have_seq=%d)" % (self.id, self.area, self.have_seq)
+
+ def to_dict(self):
+ return {'id' : self.id,
+ 'area' : self.area,
+ 'have_seq' : self.have_seq}
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/link.py b/qpid/extras/dispatch/python/qpid/dispatch/router/link.py
index fb23177e2f..11307cd079 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/link.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/link.py
@@ -21,123 +21,124 @@ from data import MessageRA, MessageLSU, MessageLSR
from time import time
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class LinkStateEngine(object):
- """
- This module is responsible for running the Link State protocol and maintaining the set
- of link states that are gathered from the domain. It notifies outbound when changes to
- the link-state-collection are detected.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.ra_interval = self.container.config.ra_interval
- self.remote_ls_max_age = self.container.config.remote_ls_max_age
- self.last_ra_time = 0
- self.collection = {}
- self.collection_changed = False
- self.mobile_seq = 0
- self.needed_lsrs = {}
-
-
- def tick(self, now):
- self._expire_ls(now)
- self._send_lsrs()
-
- if now - self.last_ra_time >= self.ra_interval:
- self.last_ra_time = now
- self._send_ra()
-
- if self.collection_changed:
- self.collection_changed = False
- self.container.log(LOG_INFO, "New Link-State Collection:")
- for a,b in self.collection.items():
- self.container.log(LOG_INFO, " %s => %r" % (a, b.peers))
- self.container.ls_collection_changed(self.collection)
-
-
- def handle_ra(self, msg, now):
- if msg.id == self.id:
- return
- if msg.id in self.collection:
- ls = self.collection[msg.id]
- ls.last_seen = now
- if ls.ls_seq < msg.ls_seq:
- self.needed_lsrs[(msg.area, msg.id)] = None
- else:
- self.needed_lsrs[(msg.area, msg.id)] = None
-
-
- def handle_lsu(self, msg, now):
- if msg.id == self.id:
- return
- if msg.id in self.collection:
- ls = self.collection[msg.id]
- if ls.ls_seq < msg.ls_seq:
- ls = msg.ls
- self.collection[msg.id] = ls
+ """
+ This module is responsible for running the Link State protocol and maintaining the set
+ of link states that are gathered from the domain. It notifies outbound when changes to
+ the link-state-collection are detected.
+ """
+ def __init__(self, container):
+ self.container = container
+ self.id = self.container.id
+ self.area = self.container.area
+ self.ra_interval = self.container.config.ra_interval
+ self.remote_ls_max_age = self.container.config.remote_ls_max_age
+ self.last_ra_time = 0
+ self.collection = {}
+ self.collection_changed = False
+ self.mobile_seq = 0
+ self.needed_lsrs = {}
+
+
+ def tick(self, now):
+ self._expire_ls(now)
+ self._send_lsrs()
+
+ if now - self.last_ra_time >= self.ra_interval:
+ self.last_ra_time = now
+ self._send_ra()
+
+ if self.collection_changed:
+ self.collection_changed = False
+ self.container.log(LOG_INFO, "New Link-State Collection:")
+ for a,b in self.collection.items():
+ self.container.log(LOG_INFO, " %s => %r" % (a, b.peers))
+ self.container.ls_collection_changed(self.collection)
+
+
+ def handle_ra(self, msg, now):
+ if msg.id == self.id:
+ return
+ if msg.id in self.collection:
+ ls = self.collection[msg.id]
+ ls.last_seen = now
+ if ls.ls_seq < msg.ls_seq:
+ self.needed_lsrs[(msg.area, msg.id)] = None
+ else:
+ self.needed_lsrs[(msg.area, msg.id)] = None
+
+
+ def handle_lsu(self, msg, now):
+ if msg.id == self.id:
+ return
+ if msg.id in self.collection:
+ ls = self.collection[msg.id]
+ if ls.ls_seq < msg.ls_seq:
+ ls = msg.ls
+ self.collection[msg.id] = ls
+ self.collection_changed = True
+ ls.last_seen = now
+ else:
+ ls = msg.ls
+ self.collection[msg.id] = ls
+ self.collection_changed = True
+ ls.last_seen = now
+ self.container.new_node(msg.id)
+ self.container.log(LOG_INFO, "Learned link-state from new router: %s" % msg.id)
+ # Schedule LSRs for any routers referenced in this LS that we don't know about
+ for _id in msg.ls.peers:
+ if _id not in self.collection:
+ self.container.new_node(_id)
+ self.needed_lsrs[(msg.area, _id)] = None
+
+
+ def handle_lsr(self, msg, now):
+ if msg.id == self.id:
+ return
+ if self.id not in self.collection:
+ return
+ my_ls = self.collection[self.id]
+ self.container.send('amqp:/_topo/%s/%s/qdxrouter' % (msg.area, msg.id), MessageLSU(None, self.id, self.area, my_ls.ls_seq, my_ls))
+
+
+ def new_local_link_state(self, link_state):
+ self.collection[self.id] = link_state
self.collection_changed = True
- ls.last_seen = now
- else:
- ls = msg.ls
- self.collection[msg.id] = ls
- self.collection_changed = True
- ls.last_seen = now
- self.container.new_node(msg.id)
- self.container.log(LOG_INFO, "Learned link-state from new router: %s" % msg.id)
- # Schedule LSRs for any routers referenced in this LS that we don't know about
- for _id in msg.ls.peers:
- if _id not in self.collection:
- self.needed_lsrs[(msg.area, _id)] = None
-
-
- def handle_lsr(self, msg, now):
- if msg.id == self.id:
- return
- if self.id not in self.collection:
- return
- my_ls = self.collection[self.id]
- self.container.send('_topo/%s/%s' % (msg.area, msg.id), MessageLSU(None, self.id, self.area, my_ls.ls_seq, my_ls))
-
-
- def new_local_link_state(self, link_state):
- self.collection[self.id] = link_state
- self.collection_changed = True
- self._send_ra()
-
-
- def set_mobile_sequence(self, seq):
- self.mobile_seq = seq
-
-
- def get_collection(self):
- return self.collection
-
-
- def _expire_ls(self, now):
- to_delete = []
- for key, ls in self.collection.items():
- if key != self.id and now - ls.last_seen > self.remote_ls_max_age:
- to_delete.append(key)
- for key in to_delete:
- ls = self.collection.pop(key)
- self.collection_changed = True
- self.container.lost_node(key)
- self.container.log(LOG_INFO, "Expired link-state from router: %s" % key)
-
-
- def _send_lsrs(self):
- for (_area, _id) in self.needed_lsrs.keys():
- self.container.send('_topo/%s/%s' % (_area, _id), MessageLSR(None, self.id, self.area))
- self.needed_lsrs = {}
-
-
- def _send_ra(self):
- ls_seq = 0
- if self.id in self.collection:
- ls_seq = self.collection[self.id].ls_seq
- self.container.send('_topo/%s/all' % self.area, MessageRA(None, self.id, self.area, ls_seq, self.mobile_seq))
+ self._send_ra()
+
+
+ def set_mobile_sequence(self, seq):
+ self.mobile_seq = seq
+
+
+ def get_collection(self):
+ return self.collection
+
+
+ def _expire_ls(self, now):
+ to_delete = []
+ for key, ls in self.collection.items():
+ if key != self.id and now - ls.last_seen > self.remote_ls_max_age:
+ to_delete.append(key)
+ for key in to_delete:
+ ls = self.collection.pop(key)
+ self.collection_changed = True
+ self.container.lost_node(key)
+ self.container.log(LOG_INFO, "Expired link-state from router: %s" % key)
+
+
+ def _send_lsrs(self):
+ for (_area, _id) in self.needed_lsrs.keys():
+ self.container.send('amqp:/_topo/%s/%s/qdxrouter' % (_area, _id), MessageLSR(None, self.id, self.area))
+ self.needed_lsrs = {}
+
+
+ def _send_ra(self):
+ ls_seq = 0
+ if self.id in self.collection:
+ ls_seq = self.collection[self.id].ls_seq
+ self.container.send('amqp:/_topo/%s/all/qdxrouter' % self.area, MessageRA(None, self.id, self.area, ls_seq, self.mobile_seq))
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/mobile.py b/qpid/extras/dispatch/python/qpid/dispatch/router/mobile.py
index ce80f38780..117cf98c22 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/mobile.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/mobile.py
@@ -20,169 +20,170 @@
from data import MessageRA, MessageMAR, MessageMAU
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class MobileAddressEngine(object):
- """
- This module is responsible for maintaining an up-to-date list of mobile addresses in the domain.
- It runs the Mobile-Address protocol and generates an un-optimized routing table for mobile addresses.
- Note that this routing table maps from the mobile address to the remote router where that address
- is directly bound.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.mobile_addr_max_age = self.container.config.mobile_addr_max_age
- self.mobile_seq = 0
- self.local_keys = []
- self.added_keys = []
- self.deleted_keys = []
- self.remote_lists = {} # map router_id => (sequence, list of keys)
- self.remote_last_seen = {} # map router_id => time of last seen advertizement/update
- self.remote_changed = False
- self.needed_mars = {}
-
-
- def tick(self, now):
- self._expire_remotes(now)
- self._send_mars()
-
- ##
- ## If local keys have changed, collect the changes and send a MAU with the diffs
- ## Note: it is important that the differential-MAU be sent before a RA is sent
- ##
- if len(self.added_keys) > 0 or len(self.deleted_keys) > 0:
- self.mobile_seq += 1
- self.container.send('_topo.%s.all' % self.area,
- MessageMAU(None, self.id, self.area, self.mobile_seq, self.added_keys, self.deleted_keys))
- self.local_keys.extend(self.added_keys)
- for key in self.deleted_keys:
- self.local_keys.remove(key)
- self.added_keys = []
- self.deleted_keys = []
- self.container.mobile_sequence_changed(self.mobile_seq)
-
- ##
- ## If remotes have changed, start the process of updating local bindings
- ##
- if self.remote_changed:
- self.remote_changed = False
- self._update_remote_keys()
-
-
- def add_local_address(self, key):
"""
+ This module is responsible for maintaining an up-to-date list of mobile addresses in the domain.
+ It runs the Mobile-Address protocol and generates an un-optimized routing table for mobile addresses.
+ Note that this routing table maps from the mobile address to the remote router where that address
+ is directly bound.
"""
- if self.local_keys.count(key) == 0:
- if self.added_keys.count(key) == 0:
- self.added_keys.append(key)
- else:
- if self.deleted_keys.count(key) > 0:
- self.deleted_keys.remove(key)
-
-
- def del_local_address(self, key):
- """
- """
- if self.local_keys.count(key) > 0:
- if self.deleted_keys.count(key) == 0:
- self.deleted_keys.append(key)
- else:
- if self.added_keys.count(key) > 0:
- self.added_keys.remove(key)
-
-
- def handle_ra(self, msg, now):
- if msg.id == self.id:
- return
-
- if msg.mobile_seq == 0:
- return
-
- if msg.id in self.remote_lists:
- _seq, _list = self.remote_lists[msg.id]
- self.remote_last_seen[msg.id] = now
- if _seq < msg.mobile_seq:
- self.needed_mars[(msg.id, msg.area, _seq)] = None
- else:
- self.needed_mars[(msg.id, msg.area, 0)] = None
-
-
- def handle_mau(self, msg, now):
- ##
- ## If the MAU is differential, we can only use it if its sequence is exactly one greater
- ## than our stored sequence. If not, we will ignore the content and schedule a MAR.
- ##
- ## If the MAU is absolute, we can use it in all cases.
- ##
- if msg.id == self.id:
- return
-
- if msg.exist_list:
- ##
- ## Absolute MAU
- ##
- if msg.id in self.remote_lists:
- _seq, _list = self.remote_lists[msg.id]
- if _seq >= msg.mobile_seq: # ignore duplicates
- return
- self.remote_lists[msg.id] = (msg.mobile_seq, msg.exist_list)
- self.remote_last_seen[msg.id] = now
- self.remote_changed = True
- else:
- ##
- ## Differential MAU
- ##
- if msg.id in self.remote_lists:
- _seq, _list = self.remote_lists[msg.id]
- if _seq == msg.mobile_seq: # ignore duplicates
- return
- self.remote_last_seen[msg.id] = now
- if _seq + 1 == msg.mobile_seq:
- ##
- ## This is one greater than our stored value, incorporate the deltas
- ##
- if msg.add_list and msg.add_list.__class__ == list:
- _list.extend(msg.add_list)
- if msg.del_list and msg.del_list.__class__ == list:
- for key in msg.del_list:
- _list.remove(key)
- self.remote_lists[msg.id] = (msg.mobile_seq, _list)
- self.remote_changed = True
+ def __init__(self, container, node_tracker):
+ self.container = container
+ self.node_tracker = node_tracker
+ self.id = self.container.id
+ self.area = self.container.area
+ self.mobile_addr_max_age = self.container.config.mobile_addr_max_age
+ self.mobile_seq = 0
+ self.local_addrs = []
+ self.added_addrs = []
+ self.deleted_addrs = []
+ self.remote_lists = {} # map router_id => (sequence, list of addrs)
+ self.remote_last_seen = {} # map router_id => time of last seen advertizement/update
+ self.needed_mars = {}
+
+
+ def tick(self, now):
+ self._expire_remotes(now)
+ self._send_mars()
+
+ ##
+ ## If local addrs have changed, collect the changes and send a MAU with the diffs
+ ## Note: it is important that the differential-MAU be sent before a RA is sent
+ ##
+ if len(self.added_addrs) > 0 or len(self.deleted_addrs) > 0:
+ self.mobile_seq += 1
+ self.container.send('amqp:/_topo/%s/all/qdxrouter' % self.area,
+ MessageMAU(None, self.id, self.area, self.mobile_seq, self.added_addrs, self.deleted_addrs))
+ self.local_addrs.extend(self.added_addrs)
+ for addr in self.deleted_addrs:
+ self.local_addrs.remove(addr)
+ self.added_addrs = []
+ self.deleted_addrs = []
+ self.container.mobile_sequence_changed(self.mobile_seq)
+
+
+ def add_local_address(self, addr):
+ """
+ """
+ if self.local_addrs.count(addr) == 0:
+ if self.added_addrs.count(addr) == 0:
+ self.added_addrs.append(addr)
else:
- self.needed_mars[(msg.id, msg.area, _seq)] = None
- else:
- self.needed_mars[(msg.id, msg.area, 0)] = None
-
+ if self.deleted_addrs.count(addr) > 0:
+ self.deleted_addrs.remove(addr)
- def handle_mar(self, msg, now):
- if msg.id == self.id:
- return
- if msg.have_seq < self.mobile_seq:
- self.container.send('_topo.%s.%s' % (msg.area, msg.id),
- MessageMAU(None, self.id, self.area, self.mobile_seq, None, None, self.local_keys))
-
- def _update_remote_keys(self):
- keys = {}
- for _id,(seq,key_list) in self.remote_lists.items():
- keys[_id] = key_list
- self.container.mobile_keys_changed(keys)
+ def del_local_address(self, addr):
+ """
+ """
+ if self.local_addrs.count(addr) > 0:
+ if self.deleted_addrs.count(addr) == 0:
+ self.deleted_addrs.append(addr)
+ else:
+ if self.added_addrs.count(addr) > 0:
+ self.added_addrs.remove(addr)
- def _expire_remotes(self, now):
- for _id, t in self.remote_last_seen.items():
- if now - t > self.mobile_addr_max_age:
- self.remote_lists.pop(_id)
- self.remote_last_seen.pop(_id)
- self.remote_changed = True
+ def handle_ra(self, msg, now):
+ if msg.id == self.id:
+ return
+ if msg.mobile_seq == 0:
+ return
- def _send_mars(self):
- for _id, _area, _seq in self.needed_mars.keys():
- self.container.send('_topo.%s.%s' % (_area, _id), MessageMAR(None, self.id, self.area, _seq))
- self.needed_mars = {}
+ if msg.id in self.remote_lists:
+ _seq, _list = self.remote_lists[msg.id]
+ self.remote_last_seen[msg.id] = now
+ if _seq < msg.mobile_seq:
+ self.needed_mars[(msg.id, msg.area, _seq)] = None
+ else:
+ self.needed_mars[(msg.id, msg.area, 0)] = None
+
+
+ def handle_mau(self, msg, now):
+ ##
+ ## If the MAU is differential, we can only use it if its sequence is exactly one greater
+ ## than our stored sequence. If not, we will ignore the content and schedule a MAR.
+ ##
+ ## If the MAU is absolute, we can use it in all cases.
+ ##
+ if msg.id == self.id:
+ return
+
+ if msg.exist_list:
+ ##
+ ## Absolute MAU
+ ##
+ if msg.id in self.remote_lists:
+ _seq, _list = self.remote_lists[msg.id]
+ if _seq >= msg.mobile_seq: # ignore duplicates
+ return
+ self.remote_lists[msg.id] = (msg.mobile_seq, msg.exist_list)
+ self.remote_last_seen[msg.id] = now
+ (add_list, del_list) = self.node_tracker.overwrite_addresses(msg.id, msg.exist_list)
+ self._activate_remotes(msg.id, add_list, del_list)
+ else:
+ ##
+ ## Differential MAU
+ ##
+ if msg.id in self.remote_lists:
+ _seq, _list = self.remote_lists[msg.id]
+ if _seq == msg.mobile_seq: # ignore duplicates
+ return
+ self.remote_last_seen[msg.id] = now
+ if _seq + 1 == msg.mobile_seq:
+ ##
+ ## This is one greater than our stored value, incorporate the deltas
+ ##
+ if msg.add_list and msg.add_list.__class__ == list:
+ _list.extend(msg.add_list)
+ if msg.del_list and msg.del_list.__class__ == list:
+ for addr in msg.del_list:
+ _list.remove(addr)
+ self.remote_lists[msg.id] = (msg.mobile_seq, _list)
+ if msg.add_list:
+ self.node_tracker.add_addresses(msg.id, msg.add_list)
+ if msg.del_list:
+ self.node_tracker.del_addresses(msg.id, msg.del_list)
+ self._activate_remotes(msg.id, msg.add_list, msg.del_list)
+ else:
+ self.needed_mars[(msg.id, msg.area, _seq)] = None
+ else:
+ self.needed_mars[(msg.id, msg.area, 0)] = None
+
+
+ def handle_mar(self, msg, now):
+ if msg.id == self.id:
+ return
+ if msg.have_seq < self.mobile_seq:
+ self.container.send('amqp:/_topo/%s/%s/qdxrouter' % (msg.area, msg.id),
+ MessageMAU(None, self.id, self.area, self.mobile_seq, None, None, self.local_addrs))
+
+
+ def _expire_remotes(self, now):
+ for _id, t in self.remote_last_seen.items():
+ if now - t > self.mobile_addr_max_age:
+ self.remote_lists.pop(_id)
+ self.remote_last_seen.pop(_id)
+ self.remote_changed = True
+
+
+ def _send_mars(self):
+ for _id, _area, _seq in self.needed_mars.keys():
+ self.container.send('amqp:/_topo/%s/%s/qdxrouter' % (_area, _id), MessageMAR(None, self.id, self.area, _seq))
+ self.needed_mars = {}
+
+
+ def _activate_remotes(self, _id, added, deleted):
+ bit = self.node_tracker.maskbit_for_node(_id)
+ if added:
+ for a in added:
+ self.container.router_adapter.map_destination(a, bit)
+ if deleted:
+ for d in deleted:
+ self.container.router_adapter.unmap_destination(d, bit)
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/neighbor.py b/qpid/extras/dispatch/python/qpid/dispatch/router/neighbor.py
index ea8bacd660..37b7888efe 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/neighbor.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/neighbor.py
@@ -21,63 +21,63 @@ from data import LinkState, MessageHELLO
from time import time
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class NeighborEngine(object):
- """
- This module is responsible for maintaining this router's link-state. It runs the HELLO protocol
- with the router's neighbors and notifies outbound when the list of neighbors-in-good-standing (the
- link-state) changes.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.last_hello_time = 0.0
- self.hello_interval = container.config.hello_interval
- self.hello_max_age = container.config.hello_max_age
- self.hellos = {}
- self.link_state_changed = False
- self.link_state = LinkState(None, self.id, self.area, 0, [])
+ """
+ This module is responsible for maintaining this router's link-state. It runs the HELLO protocol
+ with the router's neighbors and notifies outbound when the list of neighbors-in-good-standing (the
+ link-state) changes.
+ """
+ def __init__(self, container):
+ self.container = container
+ self.id = self.container.id
+ self.area = self.container.area
+ self.last_hello_time = 0.0
+ self.hello_interval = container.config.hello_interval
+ self.hello_max_age = container.config.hello_max_age
+ self.hellos = {}
+ self.link_state_changed = False
+ self.link_state = LinkState(None, self.id, self.area, 0, [])
- def tick(self, now):
- self._expire_hellos(now)
+ def tick(self, now):
+ self._expire_hellos(now)
- if now - self.last_hello_time >= self.hello_interval:
- self.last_hello_time = now
- self.container.send('_local/qdxrouter', MessageHELLO(None, self.id, self.area, self.hellos.keys()))
+ if now - self.last_hello_time >= self.hello_interval:
+ self.last_hello_time = now
+ self.container.send('amqp:/_local/qdxhello', MessageHELLO(None, self.id, self.area, self.hellos.keys()))
- if self.link_state_changed:
- self.link_state_changed = False
- self.link_state.bump_sequence()
- self.container.local_link_state_changed(self.link_state)
+ if self.link_state_changed:
+ self.link_state_changed = False
+ self.link_state.bump_sequence()
+ self.container.local_link_state_changed(self.link_state)
- def handle_hello(self, msg, now):
- if msg.id == self.id:
- return
- self.hellos[msg.id] = now
- if msg.is_seen(self.id):
- if self.link_state.add_peer(msg.id):
- self.link_state_changed = True
- self.container.new_neighbor(msg.id)
- self.container.log(LOG_INFO, "New neighbor established: %s" % msg.id)
- ##
- ## TODO - Use this function to detect area boundaries
- ##
+ def handle_hello(self, msg, now, link_id):
+ if msg.id == self.id:
+ return
+ self.hellos[msg.id] = now
+ if msg.is_seen(self.id):
+ if self.link_state.add_peer(msg.id):
+ self.link_state_changed = True
+ self.container.new_neighbor(msg.id, link_id)
+ self.container.log(LOG_INFO, "New neighbor established: %s on link: %d" % (msg.id, link_id))
+ ##
+ ## TODO - Use this function to detect area boundaries
+ ##
- def _expire_hellos(self, now):
- to_delete = []
- for key, last_seen in self.hellos.items():
- if now - last_seen > self.hello_max_age:
- to_delete.append(key)
- for key in to_delete:
- self.hellos.pop(key)
- if self.link_state.del_peer(key):
- self.link_state_changed = True
- self.container.lost_neighbor(key)
- self.container.log(LOG_INFO, "Neighbor lost: %s" % key)
+ def _expire_hellos(self, now):
+ to_delete = []
+ for key, last_seen in self.hellos.items():
+ if now - last_seen > self.hello_max_age:
+ to_delete.append(key)
+ for key in to_delete:
+ self.hellos.pop(key)
+ if self.link_state.del_peer(key):
+ self.link_state_changed = True
+ self.container.lost_neighbor(key)
+ self.container.log(LOG_INFO, "Neighbor lost: %s" % key)
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/node.py b/qpid/extras/dispatch/python/qpid/dispatch/router/node.py
index c90f7f4232..ef697428da 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/node.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/node.py
@@ -18,86 +18,157 @@
#
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class NodeTracker(object):
- """
- This module is responsible for tracking the set of router nodes that are known to this
- router. It tracks whether they are neighbor or remote and whether they are reachable.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.nodes = {} # id => RemoteNode
-
-
- def tick(self, now):
- pass
-
-
- def new_neighbor(self, node_id):
- if node_id not in self.nodes:
- self.nodes[node_id] = RemoteNode(node_id)
- self.nodes[node_id].set_neighbor()
- self._notify(self.nodes[node_id])
-
-
- def lost_neighbor(self, node_id):
- node = self.nodes[node_id]
- node.clear_neighbor()
- self._notify(node)
- if node.to_delete():
- self.nodes.pop(node_id)
-
-
- def new_node(self, node_id):
- if node_id not in self.nodes:
- self.nodes[node_id] = RemoteNode(node_id)
- self.nodes[node_id].set_remote()
- self._notify(self.nodes[node_id])
-
-
- def lost_node(self, node_id):
- node = self.nodes[node_id]
- node.clear_remote()
- self._notify(node)
- if node.to_delete():
- self.nodes.pop(node_id)
-
-
- def _notify(self, node):
- if node.to_delete():
- self.container.adapter.node_updated("R%s" % node.id, 0, 0)
- else:
- is_neighbor = 0
- if node.neighbor:
- is_neighbor = 1
- self.container.adapter.node_updated("R%s" % node.id, 1, is_neighbor)
+ """
+ This module is responsible for tracking the set of router nodes that are known to this
+ router. It tracks whether they are neighbor or remote and whether they are reachable.
+
+ This module is also responsible for assigning a unique mask bit value to each router.
+ The mask bit is used in the main router to represent sets of valid destinations for addresses.
+ """
+ def __init__(self, container, max_routers):
+ self.container = container
+ self.max_routers = max_routers
+ self.nodes = {} # id => RemoteNode
+ self.maskbits = []
+ self.next_maskbit = 1 # Reserve bit '0' to represent this router
+ for i in range(max_routers):
+ self.maskbits.append(None)
+ self.maskbits[0] = True
+
+
+ def tick(self, now):
+ pass
+
+
+ def new_neighbor(self, node_id, link_maskbit):
+ """
+ A node, designated by node_id, has been discovered as a neighbor over a link with
+ a maskbit of link_maskbit.
+ """
+ if node_id in self.nodes:
+ node = self.nodes[node_id]
+ if node.neighbor:
+ return
+ self.container.del_remote_router(node.maskbit)
+ node.neighbor = True
+ else:
+ node = RemoteNode(node_id, self._allocate_maskbit(), True)
+ self.nodes[node_id] = node
+ self.container.add_neighbor_router(self._address(node_id), node.maskbit, link_maskbit)
+
+
+ def lost_neighbor(self, node_id):
+ """
+ We have lost contact with a neighboring node node_id.
+ """
+ node = self.nodes[node_id]
+ node.neighbor = False
+ self.container.del_neighbor_router(node.maskbit)
+ if node.remote:
+ self.container.add_remote_router(self._address(node.id), node.maskbit)
+ else:
+ self._free_maskbit(node.maskbit)
+ self.nodes.pop(node_id)
+
+
+ def new_node(self, node_id):
+ """
+ A node, designated by node_id, has been discovered through the an advertisement from a
+ remote peer.
+ """
+ if node_id not in self.nodes:
+ node = RemoteNode(node_id, self._allocate_maskbit(), False)
+ self.nodes[node_id] = node
+ self.container.add_remote_router(self._address(node.id), node.maskbit)
+ else:
+ node = self.nodes[node_id]
+ node.remote = True
+
+
+ def lost_node(self, node_id):
+ """
+ A remote node, node_id, has not been heard from for too long and is being deemed lost.
+ """
+ node = self.nodes[node_id]
+ if node.remote:
+ node.remote = False
+ if not node.neighbor:
+ self.container.del_remote_router(node.maskbit)
+ self._free_maskbit(node.maskbit)
+ self.nodes.pop(node_id)
+
+
+ def maskbit_for_node(self, node_id):
+ """
+ """
+ node = self.nodes[node_id]
+ if node:
+ return node.maskbit
+ return None
+
+
+ def add_addresses(self, node_id, addrs):
+ node = self.nodes[node_id]
+ for a in addrs:
+ node.addrs[a] = 1
+
+
+ def del_addresses(self, node_id, addrs):
+ node = self.nodes[node_id]
+ for a in addrs:
+ node.addrs.pop(a)
+
+
+ def overwrite_addresses(self, node_id, addrs):
+ node = self.nodes[node_id]
+ added = []
+ deleted = []
+ for a in addrs:
+ if a not in node.addrs.keys():
+ added.append(a)
+ for a in node.addrs.keys():
+ if a not in addrs:
+ deleted.append(a)
+ for a in addrs:
+ node.addrs[a] = 1
+ return (added, deleted)
+
+
+ def _allocate_maskbit(self):
+ if self.next_maskbit == None:
+ raise Exception("Exceeded Maximum Router Count")
+ result = self.next_maskbit
+ self.next_maskbit = None
+ self.maskbits[result] = True
+ for n in range(result + 1, self.max_routers):
+ if self.maskbits[n] == None:
+ self.next_maskbit = n
+ break
+ return result
+
+
+ def _free_maskbit(self, i):
+ self.maskbits[i] = None
+ if self.next_maskbit == None or i < self.next_maskbit:
+ self.next_maskbit = i
+
+
+ def _address(self, node_id):
+ return "amqp:/_topo/%s/%s" % (self.container.area, node_id)
class RemoteNode(object):
- def __init__(self, node_id):
- self.id = node_id
- self.neighbor = None
- self.remote = None
-
- def set_neighbor(self):
- self.neighbor = True
-
- def set_remote(self):
- self.remote = True
-
- def clear_neighbor(self):
- self.neighbor = None
-
- def clear_remote(self):
- self.remote = None
-
- def to_delete(self):
- return self.neighbor or self.remote
+ def __init__(self, node_id, maskbit, neighbor):
+ self.id = node_id
+ self.maskbit = maskbit
+ self.neighbor = neighbor
+ self.remote = not neighbor
+ self.addrs = {} # Address => Count at Node (1 only for the present)
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/path.py b/qpid/extras/dispatch/python/qpid/dispatch/router/path.py
index c051dbe7fc..da04474e75 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/path.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/path.py
@@ -18,185 +18,218 @@
#
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class PathEngine(object):
- """
- This module is responsible for computing the next-hop for every router/area in the domain
- based on the collection of link states that have been gathered.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.recalculate = False
- self.collection = None
-
-
- def tick(self, now_unused):
- if self.recalculate:
- self.recalculate = False
- self._calculate_routes()
-
-
- def ls_collection_changed(self, collection):
- self.recalculate = True
- self.collection = collection
-
-
- def _calculate_tree_from_root(self, root):
- ##
- ## Make a copy of the current collection of link-states that contains
- ## an empty link-state for nodes that are known-peers but are not in the
- ## collection currently. This is needed to establish routes to those nodes
- ## so we can trade link-state information with them.
- ##
- link_states = {}
- for _id, ls in self.collection.items():
- link_states[_id] = ls.peers
- for p in ls.peers:
- if p not in link_states:
- link_states[p] = []
-
- ##
- ## Setup Dijkstra's Algorithm
- ##
- cost = {}
- prev = {}
- for _id in link_states:
- cost[_id] = None # infinite
- prev[_id] = None # undefined
- cost[root] = 0 # no cost to the root node
- unresolved = NodeSet(cost)
-
- ##
- ## Process unresolved nodes until lowest cost paths to all reachable nodes have been found.
- ##
- while not unresolved.empty():
- u = unresolved.lowest_cost()
- if cost[u] == None:
- # There are no more reachable nodes in unresolved
- break
- for v in link_states[u]:
- if unresolved.contains(v):
- alt = cost[u] + 1 # TODO - Use link cost instead of 1
- if cost[v] == None or alt < cost[v]:
- cost[v] = alt
- prev[v] = u
- unresolved.set_cost(v, alt)
-
- ##
- ## Remove unreachable nodes from the map. Note that this will also remove the
- ## root node (has no previous node) from the map.
- ##
- for u, val in prev.items():
- if not val:
- prev.pop(u)
-
- ##
- ## Return previous-node map. This is a map of all reachable, remote nodes to
- ## their predecessor node.
- ##
- return prev
-
-
- def _calculate_routes(self):
- ##
- ## Generate the shortest-path tree with the local node as root
- ##
- prev = self._calculate_tree_from_root(self.id)
- nodes = prev.keys()
-
- ##
- ## Distill the path tree into a map of next hops for each node
- ##
- next_hops = {}
- while len(nodes) > 0:
- u = nodes[0] # pick any destination
- path = [u]
- nodes.remove(u)
- v = prev[u]
- while v != self.id: # build a list of nodes in the path back to the root
- if v in nodes:
- path.append(v)
- nodes.remove(v)
- u = v
- v = prev[u]
- for w in path: # mark each node in the path as reachable via the next hop
- next_hops[w] = u
-
- ##
- ## TODO - Calculate the tree from each origin, determine the set of origins-per-dest
- ## for which the path from origin to dest passes through us. This is the set
- ## of valid origins for forwarding to the destination.
- ##
-
- self.container.next_hops_changed(next_hops)
+ """
+ This module is responsible for computing the next-hop for every router/area in the domain
+ based on the collection of link states that have been gathered.
+ """
+ def __init__(self, container):
+ self.container = container
+ self.id = self.container.id
+ self.area = self.container.area
+ self.recalculate = False
+ self.collection = None
-class NodeSet(object):
- """
- This data structure is an ordered list of node IDs, sorted in increasing order by their cost.
- Equal cost nodes are secondarily sorted by their ID in order to provide deterministic and
- repeatable ordering.
- """
- def __init__(self, cost_map):
- self.nodes = []
- for _id, cost in cost_map.items():
- ##
- ## Assume that nodes are either unreachable (cost = None) or local (cost = 0)
- ## during this initialization.
- ##
- if cost == 0:
- self.nodes.insert(0, (_id, cost))
- else:
+ def tick(self, now_unused):
+ if self.recalculate:
+ self.recalculate = False
+ self._calculate_routes()
+
+
+ def ls_collection_changed(self, collection):
+ self.recalculate = True
+ self.collection = collection
+
+
+ def _calculate_tree_from_root(self, root):
##
- ## There is no need to sort unreachable nodes by ID
+ ## Make a copy of the current collection of link-states that contains
+ ## a fake link-state for nodes that are known-peers but are not in the
+ ## collection currently. This is needed to establish routes to those nodes
+ ## so we can trade link-state information with them.
##
- self.nodes.append((_id, cost))
+ link_states = {}
+ for _id, ls in self.collection.items():
+ link_states[_id] = ls.peers
+ for p in ls.peers:
+ if p not in link_states:
+ link_states[p] = [_id]
+ ##
+ ## Setup Dijkstra's Algorithm
+ ##
+ cost = {}
+ prev = {}
+ for _id in link_states:
+ cost[_id] = None # infinite
+ prev[_id] = None # undefined
+ cost[root] = 0 # no cost to the root node
+ unresolved = NodeSet(cost)
- def __repr__(self):
- return self.nodes.__repr__()
+ ##
+ ## Process unresolved nodes until lowest cost paths to all reachable nodes have been found.
+ ##
+ while not unresolved.empty():
+ u = unresolved.lowest_cost()
+ if cost[u] == None:
+ # There are no more reachable nodes in unresolved
+ break
+ for v in link_states[u]:
+ if unresolved.contains(v):
+ alt = cost[u] + 1 # TODO - Use link cost instead of 1
+ if cost[v] == None or alt < cost[v]:
+ cost[v] = alt
+ prev[v] = u
+ unresolved.set_cost(v, alt)
+
+ ##
+ ## Remove unreachable nodes from the map. Note that this will also remove the
+ ## root node (has no previous node) from the map.
+ ##
+ for u, val in prev.items():
+ if not val:
+ prev.pop(u)
+ ##
+ ## Return previous-node map. This is a map of all reachable, remote nodes to
+ ## their predecessor node.
+ ##
+ return prev
- def empty(self):
- return len(self.nodes) == 0
+ def _calculate_valid_origins(self, nodeset):
+ ##
+ ## Calculate the tree from each origin, determine the set of origins-per-dest
+ ## for which the path from origin to dest passes through us. This is the set
+ ## of valid origins for forwarding to the destination.
+ ##
+ valid_origin = {} # Map of destination => List of Valid Origins
+ for node in nodeset:
+ if node != self.id:
+ valid_origin[node] = []
+
+ for root in valid_origin.keys():
+ prev = self._calculate_tree_from_root(root)
+ nodes = prev.keys()
+ while len(nodes) > 0:
+ u = nodes[0]
+ path = [u]
+ nodes.remove(u)
+ v = prev[u]
+ while v != root:
+ if v in nodes:
+ if v != self.id:
+ path.append(v)
+ nodes.remove(v)
+ if v == self.id:
+ valid_origin[root].extend(path)
+ u = v
+ v = prev[u]
+ return valid_origin
+
+
+ def _calculate_routes(self):
+ ##
+ ## Generate the shortest-path tree with the local node as root
+ ##
+ prev = self._calculate_tree_from_root(self.id)
+ nodes = prev.keys()
- def contains(self, _id):
- for a, b in self.nodes:
- if a == _id:
- return True
- return False
+ ##
+ ## Distill the path tree into a map of next hops for each node
+ ##
+ next_hops = {}
+ while len(nodes) > 0:
+ u = nodes[0] # pick any destination
+ path = [u]
+ nodes.remove(u)
+ v = prev[u]
+ while v != self.id: # build a list of nodes in the path back to the root
+ if v in nodes:
+ path.append(v)
+ nodes.remove(v)
+ u = v
+ v = prev[u]
+ for w in path: # mark each node in the path as reachable via the next hop
+ next_hops[w] = u
+
+ self.container.next_hops_changed(next_hops)
+ ##
+ ## Calculate the valid origins for remote routers
+ ##
+ valid_origin = self._calculate_valid_origins(prev.keys())
+ self.container.valid_origins_changed(valid_origin)
- def lowest_cost(self):
- """
- Remove and return the lowest cost node ID.
- """
- _id, cost = self.nodes.pop(0)
- return _id
- def set_cost(self, _id, new_cost):
+class NodeSet(object):
"""
- Set the cost for an ID in the NodeSet and re-insert the ID so that the list
- remains sorted in increasing cost order.
+ This data structure is an ordered list of node IDs, sorted in increasing order by their cost.
+ Equal cost nodes are secondarily sorted by their ID in order to provide deterministic and
+ repeatable ordering.
"""
- index = 0
- for i, c in self.nodes:
- if i == _id:
- break
- index += 1
- self.nodes.pop(index)
-
- index = 0
- for i, c in self.nodes:
- if c == None or new_cost < c or (new_cost == c and _id < i):
- break
- index += 1
-
- self.nodes.insert(index, (_id, new_cost))
+ def __init__(self, cost_map):
+ self.nodes = []
+ for _id, cost in cost_map.items():
+ ##
+ ## Assume that nodes are either unreachable (cost = None) or local (cost = 0)
+ ## during this initialization.
+ ##
+ if cost == 0:
+ self.nodes.insert(0, (_id, cost))
+ else:
+ ##
+ ## There is no need to sort unreachable nodes by ID
+ ##
+ self.nodes.append((_id, cost))
+
+
+ def __repr__(self):
+ return self.nodes.__repr__()
+
+
+ def empty(self):
+ return len(self.nodes) == 0
+
+
+ def contains(self, _id):
+ for a, b in self.nodes:
+ if a == _id:
+ return True
+ return False
+
+
+ def lowest_cost(self):
+ """
+ Remove and return the lowest cost node ID.
+ """
+ _id, cost = self.nodes.pop(0)
+ return _id
+
+
+ def set_cost(self, _id, new_cost):
+ """
+ Set the cost for an ID in the NodeSet and re-insert the ID so that the list
+ remains sorted in increasing cost order.
+ """
+ index = 0
+ for i, c in self.nodes:
+ if i == _id:
+ break
+ index += 1
+ self.nodes.pop(index)
+
+ index = 0
+ for i, c in self.nodes:
+ if c == None or new_cost < c or (new_cost == c and _id < i):
+ break
+ index += 1
+
+ self.nodes.insert(index, (_id, new_cost))
+
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/router_engine.py b/qpid/extras/dispatch/python/qpid/dispatch/router/router_engine.py
index 18b48379c5..f8b2dd9c94 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/router_engine.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/router_engine.py
@@ -27,254 +27,267 @@ from link import LinkStateEngine
from path import PathEngine
from mobile import MobileAddressEngine
from routing import RoutingTableEngine
-from binding import BindingEngine
-from adapter import AdapterEngine
from node import NodeTracker
+import sys
+import traceback
+
##
## Import the Dispatch adapters from the environment. If they are not found
## (i.e. we are in a test bench, etc.), load the stub versions.
##
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class RouterEngine:
- """
- """
-
- def __init__(self, router_adapter, router_id=None, area='area', config_override={}):
- """
- Initialize an instance of a router for a domain.
- """
- ##
- ## Record important information about this router instance
- ##
- self.domain = "domain"
- self.router_adapter = router_adapter
- self.log_adapter = LogAdapter("dispatch.router")
- self.io_adapter = IoAdapter(self, "qdxrouter")
-
- if router_id:
- self.id = router_id
- else:
- self.id = str(uuid4())
- self.area = area
- self.log(LOG_INFO, "Router Engine Instantiated: area=%s id=%s" % (self.area, self.id))
-
- ##
- ## Setup configuration
- ##
- self.config = Configuration(config_override)
- self.log(LOG_INFO, "Config: %r" % self.config)
-
- ##
- ## Launch the sub-module engines
- ##
- self.neighbor_engine = NeighborEngine(self)
- self.link_state_engine = LinkStateEngine(self)
- self.path_engine = PathEngine(self)
- self.mobile_address_engine = MobileAddressEngine(self)
- self.routing_table_engine = RoutingTableEngine(self)
- self.binding_engine = BindingEngine(self)
- self.adapter_engine = AdapterEngine(self)
- self.node_tracker = NodeTracker(self)
-
-
-
- ##========================================================================================
- ## Adapter Entry Points - invoked from the adapter
- ##========================================================================================
- def getId(self):
- """
- Return the router's ID
- """
- return self.id
-
-
- def addLocalAddress(self, key):
- """
- """
- try:
- if key.find('_topo') == 0 or key.find('_local') == 0:
- return
- self.mobile_address_engine.add_local_address(key)
- except Exception, e:
- self.log(LOG_ERROR, "Exception in new-address processing: exception=%r" % e)
-
- def delLocalAddress(self, key):
- """
- """
- try:
- if key.find('_topo') == 0 or key.find('_local') == 0:
- return
- self.mobile_address_engine.del_local_address(key)
- except Exception, e:
- self.log(LOG_ERROR, "Exception in del-address processing: exception=%r" % e)
-
-
- def handleTimerTick(self):
- """
- """
- try:
- now = time()
- self.neighbor_engine.tick(now)
- self.link_state_engine.tick(now)
- self.path_engine.tick(now)
- self.mobile_address_engine.tick(now)
- self.routing_table_engine.tick(now)
- self.binding_engine.tick(now)
- self.adapter_engine.tick(now)
- self.node_tracker.tick(now)
- except Exception, e:
- self.log(LOG_ERROR, "Exception in timer processing: exception=%r" % e)
-
-
- def handleControlMessage(self, opcode, body):
- """
- """
- try:
- now = time()
- if opcode == 'HELLO':
- msg = MessageHELLO(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.neighbor_engine.handle_hello(msg, now)
-
- elif opcode == 'RA':
- msg = MessageRA(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.link_state_engine.handle_ra(msg, now)
- self.mobile_address_engine.handle_ra(msg, now)
-
- elif opcode == 'LSU':
- msg = MessageLSU(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.link_state_engine.handle_lsu(msg, now)
-
- elif opcode == 'LSR':
- msg = MessageLSR(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.link_state_engine.handle_lsr(msg, now)
-
- elif opcode == 'MAU':
- msg = MessageMAU(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.mobile_address_engine.handle_mau(msg, now)
-
- elif opcode == 'MAR':
- msg = MessageMAR(body)
- self.log(LOG_TRACE, "RCVD: %r" % msg)
- self.mobile_address_engine.handle_mar(msg, now)
-
- except Exception, e:
- self.log(LOG_ERROR, "Exception in message processing: opcode=%s body=%r exception=%r" % (opcode, body, e))
-
-
- def receive(self, message_properties, body):
- """
- This is the IoAdapter message-receive handler
- """
- try:
- self.handleControlMessage(message_properties['opcode'], body)
- except Exception, e:
- self.log(LOG_ERROR, "Exception in raw message processing: properties=%r body=%r exception=%r" %
- (message_properties, body, e))
-
- def getRouterData(self, kind):
"""
"""
- if kind == 'help':
- return { 'help' : "Get list of supported values for kind",
- 'link-state' : "This router's link state",
- 'link-state-set' : "The set of link states from known routers",
- 'next-hops' : "Next hops to each known router",
- 'topo-table' : "Topological routing table",
- 'mobile-table' : "Mobile key routing table"
- }
- if kind == 'link-state' : return self.neighbor_engine.link_state.to_dict()
- if kind == 'next-hops' : return self.routing_table_engine.next_hops
- if kind == 'topo-table' : return {'table': self.adapter_engine.key_classes['topological']}
- if kind == 'mobile-table' : return {'table': self.adapter_engine.key_classes['mobile-key']}
- if kind == 'link-state-set' :
- copy = {}
- for _id,_ls in self.link_state_engine.collection.items():
- copy[_id] = _ls.to_dict()
- return copy
-
- return {'notice':'Use kind="help" to get a list of possibilities'}
-
-
- ##========================================================================================
- ## Adapter Calls - outbound calls to Dispatch
- ##========================================================================================
- def log(self, level, text):
- """
- Emit a log message to the host's event log
- """
- self.log_adapter.log(level, text)
-
-
- def send(self, dest, msg):
- """
- Send a control message to another router.
- """
- app_props = {'opcode' : msg.get_opcode() }
- self.io_adapter.send(dest, app_props, msg.to_dict())
- self.log(LOG_TRACE, "SENT: %r dest=%s" % (msg, dest))
-
-
- def node_updated(self, addr, reachable, neighbor):
- """
- """
- self.router_adapter(addr, reachable, neighbor)
-
-
- ##========================================================================================
- ## Interconnect between the Sub-Modules
- ##========================================================================================
- def local_link_state_changed(self, link_state):
- self.log(LOG_DEBUG, "Event: local_link_state_changed: %r" % link_state)
- self.link_state_engine.new_local_link_state(link_state)
-
- def ls_collection_changed(self, collection):
- self.log(LOG_DEBUG, "Event: ls_collection_changed: %r" % collection)
- self.path_engine.ls_collection_changed(collection)
-
- def next_hops_changed(self, next_hop_table):
- self.log(LOG_DEBUG, "Event: next_hops_changed: %r" % next_hop_table)
- self.routing_table_engine.next_hops_changed(next_hop_table)
- self.binding_engine.next_hops_changed()
-
- def mobile_sequence_changed(self, mobile_seq):
- self.log(LOG_DEBUG, "Event: mobile_sequence_changed: %d" % mobile_seq)
- self.link_state_engine.set_mobile_sequence(mobile_seq)
-
- def mobile_keys_changed(self, keys):
- self.log(LOG_DEBUG, "Event: mobile_keys_changed: %r" % keys)
- self.binding_engine.mobile_keys_changed(keys)
-
- def get_next_hops(self):
- return self.routing_table_engine.get_next_hops()
-
- def remote_routes_changed(self, key_class, routes):
- self.log(LOG_DEBUG, "Event: remote_routes_changed: class=%s routes=%r" % (key_class, routes))
- self.adapter_engine.remote_routes_changed(key_class, routes)
-
- def new_neighbor(self, rid):
- self.log(LOG_DEBUG, "Event: new_neighbor: id=%s" % rid)
- self.node_tracker.new_neighbor(rid)
-
- def lost_neighbor(self, rid):
- self.log(LOG_DEBUG, "Event: lost_neighbor: id=%s" % rid)
- self.node_tracker.lost_neighbor(rid)
-
- def new_node(self, rid):
- self.log(LOG_DEBUG, "Event: new_node: id=%s" % rid)
- self.node_tracker.new_node(rid)
- def lost_node(self, rid):
- self.log(LOG_DEBUG, "Event: lost_node: id=%s" % rid)
- self.node_tracker.lost_node(rid)
+ def __init__(self, router_adapter, router_id, area, max_routers, config_override={}):
+ """
+ Initialize an instance of a router for a domain.
+ """
+ ##
+ ## Record important information about this router instance
+ ##
+ self.domain = "domain"
+ self.router_adapter = router_adapter
+ self.log_adapter = LogAdapter("dispatch.router")
+ self.io_adapter = IoAdapter(self, ("qdxrouter", "qdxhello"))
+ self.max_routers = max_routers
+ self.id = router_id
+ self.area = area
+ self.log(LOG_INFO, "Router Engine Instantiated: area=%s id=%s max_routers=%d" %
+ (self.area, self.id, self.max_routers))
+
+ ##
+ ## Setup configuration
+ ##
+ self.config = Configuration(config_override)
+ self.log(LOG_INFO, "Config: %r" % self.config)
+
+ ##
+ ## Launch the sub-module engines
+ ##
+ self.node_tracker = NodeTracker(self, self.max_routers)
+ self.neighbor_engine = NeighborEngine(self)
+ self.link_state_engine = LinkStateEngine(self)
+ self.path_engine = PathEngine(self)
+ self.mobile_address_engine = MobileAddressEngine(self, self.node_tracker)
+ self.routing_table_engine = RoutingTableEngine(self, self.node_tracker)
+
+
+
+ ##========================================================================================
+ ## Adapter Entry Points - invoked from the adapter
+ ##========================================================================================
+ def getId(self):
+ """
+ Return the router's ID
+ """
+ return self.id
+
+
+ def addressAdded(self, addr):
+ """
+ """
+ try:
+ if addr.find('Mtemp.') == 0:
+ return
+ if addr.find('M') == 0:
+ self.mobile_address_engine.add_local_address(addr[1:])
+ except Exception, e:
+ self.log(LOG_ERROR, "Exception in new-address processing: exception=%r" % e)
+
+
+ def addressRemoved(self, addr):
+ """
+ """
+ try:
+ if addr.find('Mtemp.') == 0:
+ return
+ if addr.find('M') == 0:
+ self.mobile_address_engine.del_local_address(addr[1:])
+ except Exception, e:
+ self.log(LOG_ERROR, "Exception in del-address processing: exception=%r" % e)
+
+
+ def handleTimerTick(self):
+ """
+ """
+ try:
+ now = time()
+ self.neighbor_engine.tick(now)
+ self.link_state_engine.tick(now)
+ self.path_engine.tick(now)
+ self.mobile_address_engine.tick(now)
+ self.routing_table_engine.tick(now)
+ self.node_tracker.tick(now)
+ except Exception, e:
+ self.log(LOG_ERROR, "Exception in timer processing: exception=%r" % e)
+
+
+ def handleControlMessage(self, opcode, body, link_id):
+ """
+ """
+ try:
+ now = time()
+ if opcode == 'HELLO':
+ msg = MessageHELLO(body)
+ self.log(LOG_TRACE, "RCVD: %r" % msg)
+ self.neighbor_engine.handle_hello(msg, now, link_id)
+
+ elif opcode == 'RA':
+ msg = MessageRA(body)
+ self.log(LOG_DEBUG, "RCVD: %r" % msg)
+ self.link_state_engine.handle_ra(msg, now)
+ self.mobile_address_engine.handle_ra(msg, now)
+
+ elif opcode == 'LSU':
+ msg = MessageLSU(body)
+ self.log(LOG_DEBUG, "RCVD: %r" % msg)
+ self.link_state_engine.handle_lsu(msg, now)
+
+ elif opcode == 'LSR':
+ msg = MessageLSR(body)
+ self.log(LOG_DEBUG, "RCVD: %r" % msg)
+ self.link_state_engine.handle_lsr(msg, now)
+
+ elif opcode == 'MAU':
+ msg = MessageMAU(body)
+ self.log(LOG_DEBUG, "RCVD: %r" % msg)
+ self.mobile_address_engine.handle_mau(msg, now)
+
+ elif opcode == 'MAR':
+ msg = MessageMAR(body)
+ self.log(LOG_DEBUG, "RCVD: %r" % msg)
+ self.mobile_address_engine.handle_mar(msg, now)
+
+ except Exception, e:
+ self.log(LOG_ERROR, "Exception in message processing: opcode=%s body=%r exception=%r" % (opcode, body, e))
+ exc_type, exc_value, exc_traceback = sys.exc_info()
+ traceback.print_tb(exc_traceback)
+
+
+ def receive(self, message_properties, body, link_id):
+ """
+ This is the IoAdapter message-receive handler
+ """
+ try:
+ #self.log(LOG_DEBUG, "Raw Receive: mp=%r body=%r link_id=%r" % (message_properties, body, link_id))
+ self.handleControlMessage(message_properties['opcode'], body, link_id)
+ except Exception, e:
+ self.log(LOG_ERROR, "Exception in raw message processing: properties=%r body=%r exception=%r" %
+ (message_properties, body, e))
+
+
+ def getRouterData(self, kind):
+ """
+ """
+ if kind == 'help':
+ return { 'help' : "Get list of supported values for kind",
+ 'link-state' : "This router's link state",
+ 'link-state-set' : "The set of link states from known routers",
+ 'next-hops' : "Next hops to each known router"
+ }
+ if kind == 'link-state' : return self.neighbor_engine.link_state.to_dict()
+ if kind == 'next-hops' : return self.routing_table_engine.next_hops
+ if kind == 'link-state-set' :
+ copy = {}
+ for _id,_ls in self.link_state_engine.collection.items():
+ copy[_id] = _ls.to_dict()
+ return copy
+
+ return {'notice':'Use kind="help" to get a list of possibilities'}
+
+
+ ##========================================================================================
+ ## Adapter Calls - outbound calls to Dispatch
+ ##========================================================================================
+ def log(self, level, text):
+ """
+ Emit a log message to the host's event log
+ """
+ self.log_adapter.log(level, text)
+
+
+ def send(self, dest, msg):
+ """
+ Send a control message to another router.
+ """
+ app_props = {'opcode' : msg.get_opcode() }
+ self.io_adapter.send(dest, app_props, msg.to_dict())
+ if "qdxhello" in dest:
+ self.log(LOG_TRACE, "SENT: %r dest=%s" % (msg, dest))
+ else:
+ self.log(LOG_DEBUG, "SENT: %r dest=%s" % (msg, dest))
+
+
+ def node_updated(self, addr, reachable, neighbor):
+ """
+ """
+ self.router_adapter(addr, reachable, neighbor)
+
+
+ ##========================================================================================
+ ## Interconnect between the Sub-Modules
+ ##========================================================================================
+ def local_link_state_changed(self, link_state):
+ self.log(LOG_DEBUG, "Event: local_link_state_changed: %r" % link_state)
+ self.link_state_engine.new_local_link_state(link_state)
+
+ def ls_collection_changed(self, collection):
+ self.log(LOG_DEBUG, "Event: ls_collection_changed: %r" % collection)
+ self.path_engine.ls_collection_changed(collection)
+
+ def next_hops_changed(self, next_hop_table):
+ self.log(LOG_DEBUG, "Event: next_hops_changed: %r" % next_hop_table)
+ self.routing_table_engine.next_hops_changed(next_hop_table)
+
+ def valid_origins_changed(self, valid_origins):
+ self.log(LOG_DEBUG, "Event: valid_origins_changed: %r" % valid_origins)
+ self.routing_table_engine.valid_origins_changed(valid_origins)
+
+ def mobile_sequence_changed(self, mobile_seq):
+ self.log(LOG_DEBUG, "Event: mobile_sequence_changed: %d" % mobile_seq)
+ self.link_state_engine.set_mobile_sequence(mobile_seq)
+
+ def get_next_hops(self):
+ return self.routing_table_engine.get_next_hops()
+
+ def new_neighbor(self, rid, link_id):
+ self.log(LOG_DEBUG, "Event: new_neighbor: id=%s link_id=%d" % (rid, link_id))
+ self.node_tracker.new_neighbor(rid, link_id)
+
+ def lost_neighbor(self, rid):
+ self.log(LOG_DEBUG, "Event: lost_neighbor: id=%s" % rid)
+ self.node_tracker.lost_neighbor(rid)
+
+ def new_node(self, rid):
+ self.log(LOG_DEBUG, "Event: new_node: id=%s" % rid)
+ self.node_tracker.new_node(rid)
+
+ def lost_node(self, rid):
+ self.log(LOG_DEBUG, "Event: lost_node: id=%s" % rid)
+ self.node_tracker.lost_node(rid)
+
+ def add_neighbor_router(self, address, router_bit, link_bit):
+ self.log(LOG_DEBUG, "Event: add_neighbor_router: address=%s, router_bit=%d, link_bit=%d" % \
+ (address, router_bit, link_bit))
+ self.router_adapter.add_neighbor_router(address, router_bit, link_bit)
+
+ def del_neighbor_router(self, router_bit):
+ self.log(LOG_DEBUG, "Event: del_neighbor_router: router_bit=%d" % router_bit)
+ self.router_adapter.del_neighbor_router(router_bit)
+
+ def add_remote_router(self, address, router_bit):
+ self.log(LOG_DEBUG, "Event: add_remote_router: address=%s, router_bit=%d" % (address, router_bit))
+ self.router_adapter.add_remote_router(address, router_bit)
+
+ def del_remote_router(self, router_bit):
+ self.log(LOG_DEBUG, "Event: del_remote_router: router_bit=%d" % router_bit)
+ self.router_adapter.del_remote_router(router_bit)
diff --git a/qpid/extras/dispatch/python/qpid/dispatch/router/routing.py b/qpid/extras/dispatch/python/qpid/dispatch/router/routing.py
index 8030582177..a4b3e5484a 100644
--- a/qpid/extras/dispatch/python/qpid/dispatch/router/routing.py
+++ b/qpid/extras/dispatch/python/qpid/dispatch/router/routing.py
@@ -18,39 +18,45 @@
#
try:
- from dispatch import *
+ from dispatch import *
except ImportError:
- from ..stubs import *
+ from ..stubs import *
class RoutingTableEngine(object):
- """
- This module is responsible for converting the set of next hops to remote routers to a routing
- table in the "topological" address class.
- """
- def __init__(self, container):
- self.container = container
- self.id = self.container.id
- self.area = self.container.area
- self.next_hops = {}
-
-
- def tick(self, now):
- pass
-
-
- def next_hops_changed(self, next_hops):
- # Convert next_hops into routing table
- self.next_hops = next_hops
- new_table = []
- for _id, next_hop in next_hops.items():
- new_table.append(('_topo.%s.%s.#' % (self.area, _id), next_hop))
- pair = ('_topo.%s.all' % (self.area), next_hop)
- if new_table.count(pair) == 0:
- new_table.append(pair)
-
- self.container.remote_routes_changed('topological', new_table)
-
-
- def get_next_hops(self):
- return self.next_hops
+ """
+ This module is responsible for converting the set of next hops to remote routers to a routing
+ table in the "topological" address class.
+ """
+ def __init__(self, container, node_tracker):
+ self.container = container
+ self.node_tracker = node_tracker
+ self.id = self.container.id
+ self.area = self.container.area
+ self.next_hops = {}
+
+
+ def tick(self, now):
+ pass
+
+
+ def next_hops_changed(self, next_hops):
+ # Convert next_hops into routing table
+ self.next_hops = next_hops
+ for _id, next_hop in next_hops.items():
+ mb_id = self.node_tracker.maskbit_for_node(_id)
+ mb_nh = self.node_tracker.maskbit_for_node(next_hop)
+ self.container.router_adapter.set_next_hop(mb_id, mb_nh)
+
+
+ def valid_origins_changed(self, valid_origins):
+ for _id, vo in valid_origins.items():
+ mb_id = self.node_tracker.maskbit_for_node(_id)
+ mb_vo = []
+ for o in vo:
+ mb_vo.append(self.node_tracker.maskbit_for_node(o))
+ self.container.router_adapter.set_valid_origins(mb_id, mb_vo)
+
+
+ def get_next_hops(self):
+ return self.next_hops
diff --git a/qpid/extras/dispatch/router/CMakeLists.txt b/qpid/extras/dispatch/router/CMakeLists.txt
index ee6d1934cf..388e0d7119 100644
--- a/qpid/extras/dispatch/router/CMakeLists.txt
+++ b/qpid/extras/dispatch/router/CMakeLists.txt
@@ -18,7 +18,7 @@
##
-set(DEFAULT_CONFIG_PATH "/etc/qpid-dispatch.conf" CACHE string "Default Config File Path")
+set(DEFAULT_CONFIG_PATH "/etc/qpid/qpid-dispatch.conf" CACHE string "Default Config File Path")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
diff --git a/qpid/extras/dispatch/router/src/main.c b/qpid/extras/dispatch/router/src/main.c
index 62e3a2beb6..e0d6849d1b 100644
--- a/qpid/extras/dispatch/router/src/main.c
+++ b/qpid/extras/dispatch/router/src/main.c
@@ -117,7 +117,7 @@ int main(int argc, char **argv)
}
}
- dx_log_set_mask(0xFFFFFFFF);
+ dx_log_set_mask(0xFFFFFFFE);
dispatch = dx_dispatch(config_path);
diff --git a/qpid/extras/dispatch/src/agent.c b/qpid/extras/dispatch/src/agent.c
index 557410910c..a7475888b2 100644
--- a/qpid/extras/dispatch/src/agent.c
+++ b/qpid/extras/dispatch/src/agent.c
@@ -37,7 +37,7 @@
struct dx_agent_t {
dx_dispatch_t *dx;
- hash_t *class_hash;
+ dx_hash_t *class_hash;
dx_message_list_t in_fifo;
dx_message_list_t out_fifo;
sys_mutex_t *lock;
@@ -71,7 +71,7 @@ static void dx_agent_process_get(dx_agent_t *agent, dx_parsed_field_t *map, dx_f
dx_field_iterator_t *cls_string = dx_parse_raw(cls);
const dx_agent_class_t *cls_record;
- hash_retrieve_const(agent->class_hash, cls_string, (const void**) &cls_record);
+ dx_hash_retrieve_const(agent->class_hash, cls_string, (const void**) &cls_record);
if (cls_record == 0)
return;
@@ -138,11 +138,11 @@ static void dx_agent_process_get(dx_agent_t *agent, dx_parsed_field_t *map, dx_f
//
// Create a message and send it.
//
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_compose_2(msg, field);
dx_router_send(agent->dx, reply_to, msg);
- dx_free_message(msg);
+ dx_message_free(msg);
dx_compose_free(field);
}
@@ -234,13 +234,13 @@ static void dx_agent_deferred_handler(void *context)
if (msg) {
dx_agent_process_request(agent, msg);
- dx_free_message(msg);
+ dx_message_free(msg);
}
} while (msg);
}
-static void dx_agent_rx_handler(void *context, dx_message_t *msg)
+static void dx_agent_rx_handler(void *context, dx_message_t *msg, int unused_link_id)
{
dx_agent_t *agent = (dx_agent_t*) context;
dx_message_t *copy = dx_message_copy(msg);
@@ -257,12 +257,12 @@ dx_agent_t *dx_agent(dx_dispatch_t *dx)
{
dx_agent_t *agent = NEW(dx_agent_t);
agent->dx = dx;
- agent->class_hash = hash(6, 10, 1);
+ agent->class_hash = dx_hash(6, 10, 1);
DEQ_INIT(agent->in_fifo);
DEQ_INIT(agent->out_fifo);
agent->lock = sys_mutex();
agent->timer = dx_timer(dx, dx_agent_deferred_handler, agent);
- agent->address = dx_router_register_address(dx, "agent", dx_agent_rx_handler, agent);
+ agent->address = dx_router_register_address(dx, "$management", dx_agent_rx_handler, agent);
return agent;
}
@@ -273,7 +273,7 @@ void dx_agent_free(dx_agent_t *agent)
dx_router_unregister_address(agent->address);
sys_mutex_free(agent->lock);
dx_timer_free(agent->timer);
- hash_free(agent->class_hash);
+ dx_hash_free(agent->class_hash);
free(agent);
}
@@ -295,7 +295,7 @@ dx_agent_class_t *dx_agent_register_class(dx_dispatch_t *dx,
cls->query_handler = query_handler;
dx_field_iterator_t *iter = dx_field_iterator_string(fqname, ITER_VIEW_ALL);
- int result = hash_insert_const(agent->class_hash, iter, cls);
+ int result = dx_hash_insert_const(agent->class_hash, iter, cls, 0);
dx_field_iterator_free(iter);
if (result < 0)
assert(false);
diff --git a/qpid/extras/dispatch/src/amqp.c b/qpid/extras/dispatch/src/amqp.c
new file mode 100644
index 0000000000..6a8545b757
--- /dev/null
+++ b/qpid/extras/dispatch/src/amqp.c
@@ -0,0 +1,30 @@
+/*
+ * 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/dispatch/amqp.h>
+
+const char * const DX_DA_INGRESS = "qdx.ingress";
+const char * const DX_DA_TRACE = "qdx.trace";
+const char * const DX_DA_TO = "qdx.to";
+
+const char * const DX_CAPABILITY_ROUTER = "qdx.router";
+
+const char * const DX_INTERNODE_LINK_NAME_1 = "qdx.internode.1";
+const char * const DX_INTERNODE_LINK_NAME_2 = "qdx.internode.2";
+
diff --git a/qpid/extras/dispatch/src/bitmask.c b/qpid/extras/dispatch/src/bitmask.c
new file mode 100644
index 0000000000..88ba69dde1
--- /dev/null
+++ b/qpid/extras/dispatch/src/bitmask.c
@@ -0,0 +1,124 @@
+/*
+ * 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/dispatch/bitmask.h>
+#include <qpid/dispatch/alloc.h>
+#include <assert.h>
+
+#define DX_BITMASK_LONGS 16
+#define DX_BITMASK_BITS (DX_BITMASK_LONGS * 64)
+
+struct dx_bitmask_t {
+ uint64_t array[DX_BITMASK_LONGS];
+ int first_set;
+};
+
+ALLOC_DECLARE(dx_bitmask_t);
+ALLOC_DEFINE(dx_bitmask_t);
+
+#define MASK_INDEX(num) (num / 64)
+#define MASK_ONEHOT(num) (((uint64_t) 1) << (num % 64))
+#define FIRST_NONE -1
+#define FIRST_UNKNOWN -2
+
+
+int dx_bitmask_width()
+{
+ return DX_BITMASK_BITS;
+}
+
+
+dx_bitmask_t *dx_bitmask(int initial)
+{
+ dx_bitmask_t *b = new_dx_bitmask_t();
+ if (initial)
+ dx_bitmask_set_all(b);
+ else
+ dx_bitmask_clear_all(b);
+ return b;
+}
+
+
+void dx_bitmask_free(dx_bitmask_t *b)
+{
+ free_dx_bitmask_t(b);
+}
+
+
+void dx_bitmask_set_all(dx_bitmask_t *b)
+{
+ for (int i = 0; i < DX_BITMASK_LONGS; i++)
+ b->array[i] = 0xFFFFFFFFFFFFFFFF;
+ b->first_set = 0;
+}
+
+
+void dx_bitmask_clear_all(dx_bitmask_t *b)
+{
+ for (int i = 0; i < DX_BITMASK_LONGS; i++)
+ b->array[i] = 0;
+ b->first_set = FIRST_NONE;
+}
+
+
+void dx_bitmask_set_bit(dx_bitmask_t *b, int bitnum)
+{
+ assert(bitnum < DX_BITMASK_BITS);
+ b->array[MASK_INDEX(bitnum)] |= MASK_ONEHOT(bitnum);
+ if (b->first_set > bitnum || b->first_set < 0)
+ b->first_set = bitnum;
+}
+
+
+void dx_bitmask_clear_bit(dx_bitmask_t *b, int bitnum)
+{
+ assert(bitnum < DX_BITMASK_BITS);
+ b->array[MASK_INDEX(bitnum)] &= ~(MASK_ONEHOT(bitnum));
+ if (b->first_set == bitnum)
+ b->first_set = FIRST_UNKNOWN;
+}
+
+
+int dx_bitmask_value(dx_bitmask_t *b, int bitnum)
+{
+ return (b->array[MASK_INDEX(bitnum)] & MASK_ONEHOT(bitnum)) ? 1 : 0;
+}
+
+
+int dx_bitmask_first_set(dx_bitmask_t *b, int *bitnum)
+{
+ if (b->first_set == FIRST_UNKNOWN) {
+ b->first_set = FIRST_NONE;
+ for (int i = 0; i < DX_BITMASK_LONGS; i++)
+ if (b->array[i]) {
+ for (int j = 0; j < 64; j++)
+ if ((((uint64_t) 1) << j) & b->array[i]) {
+ b->first_set = i * 64 + j;
+ break;
+ }
+ break;
+ }
+ }
+
+ if (b->first_set == FIRST_NONE)
+ return 0;
+ *bitnum = b->first_set;
+ return 1;
+}
+
diff --git a/qpid/extras/dispatch/src/buffer.c b/qpid/extras/dispatch/src/buffer.c
index a5e609b996..d0bbd13cb3 100644
--- a/qpid/extras/dispatch/src/buffer.c
+++ b/qpid/extras/dispatch/src/buffer.c
@@ -34,7 +34,7 @@ void dx_buffer_set_size(size_t size)
}
-dx_buffer_t *dx_allocate_buffer(void)
+dx_buffer_t *dx_buffer(void)
{
size_locked = 1;
dx_buffer_t *buf = new_dx_buffer_t();
@@ -45,7 +45,7 @@ dx_buffer_t *dx_allocate_buffer(void)
}
-void dx_free_buffer(dx_buffer_t *buf)
+void dx_buffer_free(dx_buffer_t *buf)
{
free_dx_buffer_t(buf);
}
diff --git a/qpid/extras/dispatch/src/compose.c b/qpid/extras/dispatch/src/compose.c
index 6eb2ab1c73..66b2336e06 100644
--- a/qpid/extras/dispatch/src/compose.c
+++ b/qpid/extras/dispatch/src/compose.c
@@ -43,7 +43,7 @@ static void dx_insert(dx_composed_field_t *field, const uint8_t *seq, size_t len
while (len > 0) {
if (buf == 0 || dx_buffer_capacity(buf) == 0) {
- buf = dx_allocate_buffer();
+ buf = dx_buffer();
if (buf == 0)
return;
DEQ_INSERT_TAIL(field->buffers, buf);
@@ -115,8 +115,8 @@ static void dx_overwrite_32(dx_field_location_t *field, uint32_t value)
size_t cursor = field->offset;
dx_overwrite(&buf, &cursor, (uint8_t) ((value & 0xFF000000) >> 24));
- dx_overwrite(&buf, &cursor, (uint8_t) ((value & 0x00FF0000) >> 24));
- dx_overwrite(&buf, &cursor, (uint8_t) ((value & 0x0000FF00) >> 24));
+ dx_overwrite(&buf, &cursor, (uint8_t) ((value & 0x00FF0000) >> 16));
+ dx_overwrite(&buf, &cursor, (uint8_t) ((value & 0x0000FF00) >> 8));
dx_overwrite(&buf, &cursor, (uint8_t) (value & 0x000000FF));
}
@@ -212,7 +212,7 @@ void dx_compose_free(dx_composed_field_t *field)
dx_buffer_t *buf = DEQ_HEAD(field->buffers);
while (buf) {
DEQ_REMOVE_HEAD(field->buffers);
- dx_free_buffer(buf);
+ dx_buffer_free(buf);
buf = DEQ_HEAD(field->buffers);
}
diff --git a/qpid/extras/dispatch/src/container.c b/qpid/extras/dispatch/src/container.c
index cc46f3ce77..3ae24d81b0 100644
--- a/qpid/extras/dispatch/src/container.c
+++ b/qpid/extras/dispatch/src/container.c
@@ -88,8 +88,8 @@ typedef struct container_class_t {
struct dx_container_t {
dx_dispatch_t *dx;
dx_server_t *server;
- hash_t *node_type_map;
- hash_t *node_map;
+ dx_hash_t *node_type_map;
+ dx_hash_t *node_map;
sys_mutex_t *lock;
dx_node_t *default_node;
dxc_node_type_list_t node_type_list;
@@ -108,7 +108,7 @@ static void setup_outgoing_link(dx_container_t *container, pn_link_t *pn_link)
if (source) {
iter = dx_field_iterator_string(source, ITER_VIEW_NODE_ID);
- hash_retrieve(container->node_map, iter, (void*) &node);
+ dx_hash_retrieve(container->node_map, iter, (void*) &node);
dx_field_iterator_free(iter);
}
sys_mutex_unlock(container->lock);
@@ -149,7 +149,7 @@ static void setup_incoming_link(dx_container_t *container, pn_link_t *pn_link)
if (target) {
iter = dx_field_iterator_string(target, ITER_VIEW_NODE_ID);
- hash_retrieve(container->node_map, iter, (void*) &node);
+ dx_hash_retrieve(container->node_map, iter, (void*) &node);
dx_field_iterator_free(iter);
}
sys_mutex_unlock(container->lock);
@@ -429,8 +429,8 @@ static void container_query_handler(void* context, const char *id, void *correla
container_class_t *cls = (container_class_t*) context;
if (cls->class_id == DX_CONTAINER_CLASS_CONTAINER) {
- dx_agent_value_uint(correlator, "node_type_count", hash_size(cls->container->node_type_map));
- dx_agent_value_uint(correlator, "node_count", hash_size(cls->container->node_map));
+ dx_agent_value_uint(correlator, "node_type_count", dx_hash_size(cls->container->node_type_map));
+ dx_agent_value_uint(correlator, "node_count", dx_hash_size(cls->container->node_map));
if (cls->container->default_node)
dx_agent_value_string(correlator, "default_node_type", cls->container->default_node->ntype->type_name);
else
@@ -463,8 +463,8 @@ dx_container_t *dx_container(dx_dispatch_t *dx)
container->dx = dx;
container->server = dx->server;
- container->node_type_map = hash(6, 4, 1); // 64 buckets, item batches of 4
- container->node_map = hash(10, 32, 0); // 1K buckets, item batches of 32
+ container->node_type_map = dx_hash(6, 4, 1); // 64 buckets, item batches of 4
+ container->node_map = dx_hash(10, 32, 0); // 1K buckets, item batches of 32
container->lock = sys_mutex();
container->default_node = 0;
DEQ_INIT(container->node_type_list);
@@ -507,7 +507,7 @@ int dx_container_register_node_type(dx_dispatch_t *dx, const dx_node_type_t *nt)
nt_item->ntype = nt;
sys_mutex_lock(container->lock);
- result = hash_insert_const(container->node_type_map, iter, nt);
+ result = dx_hash_insert_const(container->node_type_map, iter, nt, 0);
DEQ_INSERT_TAIL(container->node_type_list, nt_item);
sys_mutex_unlock(container->lock);
@@ -565,7 +565,7 @@ dx_node_t *dx_container_create_node(dx_dispatch_t *dx,
if (name) {
dx_field_iterator_t *iter = dx_field_iterator_string(name, ITER_VIEW_ALL);
sys_mutex_lock(container->lock);
- result = hash_insert(container->node_map, iter, node);
+ result = dx_hash_insert(container->node_map, iter, node, 0);
sys_mutex_unlock(container->lock);
dx_field_iterator_free(iter);
if (result < 0) {
@@ -591,7 +591,7 @@ void dx_container_destroy_node(dx_node_t *node)
if (node->name) {
dx_field_iterator_t *iter = dx_field_iterator_string(node->name, ITER_VIEW_ALL);
sys_mutex_lock(container->lock);
- hash_remove(container->node_map, iter);
+ dx_hash_remove(container->node_map, iter);
sys_mutex_unlock(container->lock);
dx_field_iterator_free(iter);
free(node->name);
@@ -651,12 +651,63 @@ void *dx_link_get_context(dx_link_t *link)
}
+void dx_link_set_conn_context(dx_link_t *link, void *context)
+{
+ pn_session_t *pn_sess = pn_link_session(link->pn_link);
+ if (!pn_sess)
+ return;
+ pn_connection_t *pn_conn = pn_session_connection(pn_sess);
+ if (!pn_conn)
+ return;
+ dx_connection_t *conn = (dx_connection_t*) pn_connection_get_context(pn_conn);
+ if (!conn)
+ return;
+ dx_connection_set_link_context(conn, context);
+}
+
+
+void *dx_link_get_conn_context(dx_link_t *link)
+{
+ pn_session_t *pn_sess = pn_link_session(link->pn_link);
+ if (!pn_sess)
+ return 0;
+ pn_connection_t *pn_conn = pn_session_connection(pn_sess);
+ if (!pn_conn)
+ return 0;
+ dx_connection_t *conn = (dx_connection_t*) pn_connection_get_context(pn_conn);
+ if (!conn)
+ return 0;
+ return dx_connection_get_link_context(conn);
+}
+
+
pn_link_t *dx_link_pn(dx_link_t *link)
{
return link->pn_link;
}
+dx_connection_t *dx_link_connection(dx_link_t *link)
+{
+ if (!link || !link->pn_link)
+ return 0;
+
+ pn_session_t *sess = pn_link_session(link->pn_link);
+ if (!sess)
+ return 0;
+
+ pn_connection_t *conn = pn_session_connection(sess);
+ if (!conn)
+ return 0;
+
+ dx_connection_t *ctx = pn_connection_get_context(conn);
+ if (!ctx)
+ return 0;
+
+ return ctx;
+}
+
+
pn_terminus_t *dx_link_source(dx_link_t *link)
{
return pn_link_source(link->pn_link);
diff --git a/qpid/extras/dispatch/src/dispatch.c b/qpid/extras/dispatch/src/dispatch.c
index a1a659fd74..20ba84afe0 100644
--- a/qpid/extras/dispatch/src/dispatch.c
+++ b/qpid/extras/dispatch/src/dispatch.c
@@ -24,6 +24,7 @@
#include "dispatch_private.h"
#include "alloc_private.h"
#include "log_private.h"
+#include "router_private.h"
/**
* Private Function Prototypes
@@ -34,8 +35,8 @@ void dx_server_free(dx_server_t *server);
dx_container_t *dx_container(dx_dispatch_t *dx);
void dx_container_setup_agent(dx_dispatch_t *dx);
void dx_container_free(dx_container_t *container);
-dx_router_t *dx_router(dx_dispatch_t *dx, const char *area, const char *id);
-void dx_router_setup_agent(dx_dispatch_t *dx);
+dx_router_t *dx_router(dx_dispatch_t *dx, dx_router_mode_t mode, const char *area, const char *id);
+void dx_router_setup_late(dx_dispatch_t *dx);
void dx_router_free(dx_router_t *router);
dx_agent_t *dx_agent(dx_dispatch_t *dx);
void dx_agent_free(dx_agent_t *agent);
@@ -53,10 +54,13 @@ dx_dispatch_t *dx_dispatch(const char *config_path)
{
dx_dispatch_t *dx = NEW(dx_dispatch_t);
- int thread_count = 0;
- const char *container_name = 0;
- const char *router_area = 0;
- const char *router_id = 0;
+ int thread_count = 0;
+ const char *container_name = 0;
+ const char *router_mode_str = 0;
+ const char *router_area = 0;
+ const char *router_id = 0;
+
+ dx_router_mode_t router_mode = DX_ROUTER_MODE_STANDALONE;
DEQ_INIT(dx->config_listeners);
DEQ_INIT(dx->config_connectors);
@@ -78,8 +82,9 @@ dx_dispatch_t *dx_dispatch(const char *config_path)
count = dx_config_item_count(dx->config, CONF_ROUTER);
if (count == 1) {
- router_area = dx_config_item_value_string(dx->config, CONF_ROUTER, 0, "area");
- router_id = dx_config_item_value_string(dx->config, CONF_ROUTER, 0, "router-id");
+ router_mode_str = dx_config_item_value_string(dx->config, CONF_ROUTER, 0, "mode");
+ router_area = dx_config_item_value_string(dx->config, CONF_ROUTER, 0, "area");
+ router_id = dx_config_item_value_string(dx->config, CONF_ROUTER, 0, "router-id");
}
}
@@ -89,6 +94,12 @@ dx_dispatch_t *dx_dispatch(const char *config_path)
if (!container_name)
container_name = "00000000-0000-0000-0000-000000000000"; // TODO - gen a real uuid
+ if (router_mode_str && strcmp(router_mode_str, "interior") == 0)
+ router_mode = DX_ROUTER_MODE_INTERIOR;
+
+ if (router_mode_str && strcmp(router_mode_str, "edge") == 0)
+ router_mode = DX_ROUTER_MODE_EDGE;
+
if (!router_area)
router_area = "area";
@@ -97,13 +108,13 @@ dx_dispatch_t *dx_dispatch(const char *config_path)
dx->server = dx_server(thread_count, container_name);
dx->container = dx_container(dx);
- dx->router = dx_router(dx, router_area, router_id);
+ dx->router = dx_router(dx, router_mode, router_area, router_id);
dx->agent = dx_agent(dx);
dx_alloc_setup_agent(dx);
dx_server_setup_agent(dx);
dx_container_setup_agent(dx);
- dx_router_setup_agent(dx);
+ dx_router_setup_late(dx);
return dx;
}
@@ -126,6 +137,7 @@ static void load_server_config(dx_dispatch_t *dx, dx_server_config_t *config, co
{
config->host = dx_config_item_value_string(dx->config, section, i, "addr");
config->port = dx_config_item_value_string(dx->config, section, i, "port");
+ config->role = dx_config_item_value_string(dx->config, section, i, "role");
config->sasl_mechanisms =
dx_config_item_value_string(dx->config, section, i, "sasl-mechanisms");
config->ssl_enabled =
diff --git a/qpid/extras/dispatch/src/hash.c b/qpid/extras/dispatch/src/hash.c
index 1f7d8aa3f5..0cb32acd05 100644
--- a/qpid/extras/dispatch/src/hash.c
+++ b/qpid/extras/dispatch/src/hash.c
@@ -23,18 +23,18 @@
#include <stdio.h>
#include <string.h>
-typedef struct hash_item_t {
- DEQ_LINKS(struct hash_item_t);
+typedef struct dx_hash_item_t {
+ DEQ_LINKS(struct dx_hash_item_t);
unsigned char *key;
union {
void *val;
const void *val_const;
} v;
-} hash_item_t;
+} dx_hash_item_t;
-ALLOC_DECLARE(hash_item_t);
-ALLOC_DEFINE(hash_item_t);
-DEQ_DECLARE(hash_item_t, items_t);
+ALLOC_DECLARE(dx_hash_item_t);
+ALLOC_DEFINE(dx_hash_item_t);
+DEQ_DECLARE(dx_hash_item_t, items_t);
typedef struct bucket_t {
@@ -42,7 +42,7 @@ typedef struct bucket_t {
} bucket_t;
-struct hash_t {
+struct dx_hash_t {
bucket_t *buckets;
unsigned int bucket_count;
unsigned int bucket_mask;
@@ -52,8 +52,17 @@ struct hash_t {
};
+struct dx_hash_handle_t {
+ bucket_t *bucket;
+ dx_hash_item_t *item;
+};
+
+ALLOC_DECLARE(dx_hash_handle_t);
+ALLOC_DEFINE(dx_hash_handle_t);
+
+
// djb2 hash algorithm
-static unsigned long hash_function(dx_field_iterator_t *iter)
+static unsigned long dx_hash_function(dx_field_iterator_t *iter)
{
unsigned long hash = 5381;
int c;
@@ -68,10 +77,10 @@ static unsigned long hash_function(dx_field_iterator_t *iter)
}
-hash_t *hash(int bucket_exponent, int batch_size, int value_is_const)
+dx_hash_t *dx_hash(int bucket_exponent, int batch_size, int value_is_const)
{
int i;
- hash_t *h = NEW(hash_t);
+ dx_hash_t *h = NEW(dx_hash_t);
if (!h)
return 0;
@@ -90,22 +99,22 @@ hash_t *hash(int bucket_exponent, int batch_size, int value_is_const)
}
-void hash_free(hash_t *h)
+void dx_hash_free(dx_hash_t *h)
{
// TODO - Implement this
}
-size_t hash_size(hash_t *h)
+size_t dx_hash_size(dx_hash_t *h)
{
return h ? h->size : 0;
}
-static hash_item_t *hash_internal_insert(hash_t *h, dx_field_iterator_t *key, int *exists)
+static dx_hash_item_t *dx_hash_internal_insert(dx_hash_t *h, dx_field_iterator_t *key, int *exists, dx_hash_handle_t **handle)
{
- unsigned long idx = hash_function(key) & h->bucket_mask;
- hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
+ unsigned long idx = dx_hash_function(key) & h->bucket_mask;
+ dx_hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
while (item) {
if (dx_field_iterator_equal(key, item->key))
@@ -115,10 +124,12 @@ static hash_item_t *hash_internal_insert(hash_t *h, dx_field_iterator_t *key, in
if (item) {
*exists = 1;
+ if (handle)
+ *handle = 0;
return item;
}
- item = new_hash_item_t();
+ item = new_dx_hash_item_t();
if (!item)
return 0;
@@ -128,14 +139,24 @@ static hash_item_t *hash_internal_insert(hash_t *h, dx_field_iterator_t *key, in
DEQ_INSERT_TAIL(h->buckets[idx].items, item);
h->size++;
*exists = 0;
+
+ //
+ // If a pointer to a handle-pointer was supplied, create a handle for this item.
+ //
+ if (handle) {
+ *handle = new_dx_hash_handle_t();
+ (*handle)->bucket = &h->buckets[idx];
+ (*handle)->item = item;
+ }
+
return item;
}
-dx_error_t hash_insert(hash_t *h, dx_field_iterator_t *key, void *val)
+dx_error_t dx_hash_insert(dx_hash_t *h, dx_field_iterator_t *key, void *val, dx_hash_handle_t **handle)
{
- int exists = 0;
- hash_item_t *item = hash_internal_insert(h, key, &exists);
+ int exists = 0;
+ dx_hash_item_t *item = dx_hash_internal_insert(h, key, &exists, handle);
if (!item)
return DX_ERROR_ALLOC;
@@ -149,12 +170,12 @@ dx_error_t hash_insert(hash_t *h, dx_field_iterator_t *key, void *val)
}
-dx_error_t hash_insert_const(hash_t *h, dx_field_iterator_t *key, const void *val)
+dx_error_t dx_hash_insert_const(dx_hash_t *h, dx_field_iterator_t *key, const void *val, dx_hash_handle_t **handle)
{
assert(h->is_const);
- int error = 0;
- hash_item_t *item = hash_internal_insert(h, key, &error);
+ int error = 0;
+ dx_hash_item_t *item = dx_hash_internal_insert(h, key, &error, handle);
if (item)
item->v.val_const = val;
@@ -162,10 +183,10 @@ dx_error_t hash_insert_const(hash_t *h, dx_field_iterator_t *key, const void *va
}
-static hash_item_t *hash_internal_retrieve(hash_t *h, dx_field_iterator_t *key)
+static dx_hash_item_t *dx_hash_internal_retrieve(dx_hash_t *h, dx_field_iterator_t *key)
{
- unsigned long idx = hash_function(key) & h->bucket_mask;
- hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
+ unsigned long idx = dx_hash_function(key) & h->bucket_mask;
+ dx_hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
while (item) {
if (dx_field_iterator_equal(key, item->key))
@@ -177,9 +198,9 @@ static hash_item_t *hash_internal_retrieve(hash_t *h, dx_field_iterator_t *key)
}
-dx_error_t hash_retrieve(hash_t *h, dx_field_iterator_t *key, void **val)
+dx_error_t dx_hash_retrieve(dx_hash_t *h, dx_field_iterator_t *key, void **val)
{
- hash_item_t *item = hash_internal_retrieve(h, key);
+ dx_hash_item_t *item = dx_hash_internal_retrieve(h, key);
if (item)
*val = item->v.val;
else
@@ -189,11 +210,11 @@ dx_error_t hash_retrieve(hash_t *h, dx_field_iterator_t *key, void **val)
}
-dx_error_t hash_retrieve_const(hash_t *h, dx_field_iterator_t *key, const void **val)
+dx_error_t dx_hash_retrieve_const(dx_hash_t *h, dx_field_iterator_t *key, const void **val)
{
assert(h->is_const);
- hash_item_t *item = hash_internal_retrieve(h, key);
+ dx_hash_item_t *item = dx_hash_internal_retrieve(h, key);
if (item)
*val = item->v.val_const;
else
@@ -203,10 +224,10 @@ dx_error_t hash_retrieve_const(hash_t *h, dx_field_iterator_t *key, const void *
}
-dx_error_t hash_remove(hash_t *h, dx_field_iterator_t *key)
+dx_error_t dx_hash_remove(dx_hash_t *h, dx_field_iterator_t *key)
{
- unsigned long idx = hash_function(key) & h->bucket_mask;
- hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
+ unsigned long idx = dx_hash_function(key) & h->bucket_mask;
+ dx_hash_item_t *item = DEQ_HEAD(h->buckets[idx].items);
while (item) {
if (dx_field_iterator_equal(key, item->key))
@@ -217,7 +238,7 @@ dx_error_t hash_remove(hash_t *h, dx_field_iterator_t *key)
if (item) {
free(item->key);
DEQ_REMOVE(h->buckets[idx].items, item);
- free_hash_item_t(item);
+ free_dx_hash_item_t(item);
h->size--;
return DX_ERROR_NONE;
}
@@ -225,3 +246,40 @@ dx_error_t hash_remove(hash_t *h, dx_field_iterator_t *key)
return DX_ERROR_NOT_FOUND;
}
+
+void dx_hash_handle_free(dx_hash_handle_t *handle)
+{
+ if (handle)
+ free_dx_hash_handle_t(handle);
+}
+
+
+const unsigned char *dx_hash_key_by_handle(const dx_hash_handle_t *handle)
+{
+ if (handle)
+ return handle->item->key;
+ return 0;
+}
+
+
+dx_error_t dx_hash_remove_by_handle(dx_hash_t *h, dx_hash_handle_t *handle)
+{
+ unsigned char *key = 0;
+ dx_error_t error = dx_hash_remove_by_handle2(h, handle, &key);
+ if (key)
+ free(key);
+ return error;
+}
+
+
+dx_error_t dx_hash_remove_by_handle2(dx_hash_t *h, dx_hash_handle_t *handle, unsigned char **key)
+{
+ if (!handle)
+ return DX_ERROR_NOT_FOUND;
+ *key = handle->item->key;
+ DEQ_REMOVE(handle->bucket->items, handle->item);
+ free_dx_hash_item_t(handle->item);
+ h->size--;
+ return DX_ERROR_NONE;
+}
+
diff --git a/qpid/extras/dispatch/src/message.c b/qpid/extras/dispatch/src/message.c
index 772c0d4e16..86ffcefcee 100644
--- a/qpid/extras/dispatch/src/message.c
+++ b/qpid/extras/dispatch/src/message.c
@@ -376,7 +376,7 @@ static dx_field_location_t *dx_message_field_location(dx_message_t *msg, dx_mess
}
-dx_message_t *dx_allocate_message()
+dx_message_t *dx_message()
{
dx_message_pvt_t *msg = (dx_message_pvt_t*) new_dx_message_t();
if (!msg)
@@ -400,7 +400,7 @@ dx_message_t *dx_allocate_message()
}
-void dx_free_message(dx_message_t *in_msg)
+void dx_message_free(dx_message_t *in_msg)
{
uint32_t rc;
dx_message_pvt_t *msg = (dx_message_pvt_t*) in_msg;
@@ -417,14 +417,14 @@ void dx_free_message(dx_message_t *in_msg)
dx_buffer_t *buf = DEQ_HEAD(content->buffers);
while (buf) {
DEQ_REMOVE_HEAD(content->buffers);
- dx_free_buffer(buf);
+ dx_buffer_free(buf);
buf = DEQ_HEAD(content->buffers);
}
buf = DEQ_HEAD(content->new_delivery_annotations);
while (buf) {
DEQ_REMOVE_HEAD(content->new_delivery_annotations);
- dx_free_buffer(buf);
+ dx_buffer_free(buf);
buf = DEQ_HEAD(content->new_delivery_annotations);
}
@@ -474,9 +474,11 @@ dx_parsed_field_t *dx_message_delivery_annotations(dx_message_t *in_msg)
!dx_parse_is_map(content->parsed_delivery_annotations)) {
dx_field_iterator_free(da);
dx_parse_free(content->parsed_delivery_annotations);
+ content->parsed_delivery_annotations = 0;
return 0;
}
+ dx_field_iterator_free(da);
return content->parsed_delivery_annotations;
}
@@ -506,7 +508,7 @@ dx_message_t *dx_message_receive(dx_delivery_t *delivery)
// link it and the delivery together.
//
if (!msg) {
- msg = (dx_message_pvt_t*) dx_allocate_message();
+ msg = (dx_message_pvt_t*) dx_message();
dx_delivery_set_context(delivery, (void*) msg);
}
@@ -517,7 +519,7 @@ dx_message_t *dx_message_receive(dx_delivery_t *delivery)
//
buf = DEQ_TAIL(msg->content->buffers);
if (!buf) {
- buf = dx_allocate_buffer();
+ buf = dx_buffer();
DEQ_INSERT_TAIL(msg->content->buffers, buf);
}
@@ -538,7 +540,7 @@ dx_message_t *dx_message_receive(dx_delivery_t *delivery)
//
if (dx_buffer_size(buf) == 0) {
DEQ_REMOVE_TAIL(msg->content->buffers);
- dx_free_buffer(buf);
+ dx_buffer_free(buf);
}
dx_delivery_set_context(delivery, 0);
return (dx_message_t*) msg;
@@ -556,7 +558,7 @@ dx_message_t *dx_message_receive(dx_delivery_t *delivery)
// tail of the message's list.
//
if (dx_buffer_capacity(buf) == 0) {
- buf = dx_allocate_buffer();
+ buf = dx_buffer();
DEQ_INSERT_TAIL(msg->content->buffers, buf);
}
} else
diff --git a/qpid/extras/dispatch/src/message_private.h b/qpid/extras/dispatch/src/message_private.h
index 27b81bbb4c..c57cea5f0d 100644
--- a/qpid/extras/dispatch/src/message_private.h
+++ b/qpid/extras/dispatch/src/message_private.h
@@ -67,7 +67,7 @@ typedef struct {
sys_mutex_t *lock;
uint32_t ref_count; // The number of messages referencing this
dx_buffer_list_t buffers; // The buffer chain containing the message
- dx_buffer_list_t new_delivery_annotations; // The buffer chain containing the new delivery annotations
+ dx_buffer_list_t new_delivery_annotations; // The buffer chain containing the new delivery annotations (MOVE TO MSG_PVT)
dx_field_location_t section_message_header; // The message header list
dx_field_location_t section_delivery_annotation; // The delivery annotation map
dx_field_location_t section_message_annotation; // The message annotation map
diff --git a/qpid/extras/dispatch/src/python_embedded.c b/qpid/extras/dispatch/src/python_embedded.c
index 0b0cc11025..a6e35018c6 100644
--- a/qpid/extras/dispatch/src/python_embedded.c
+++ b/qpid/extras/dispatch/src/python_embedded.c
@@ -398,11 +398,12 @@ typedef struct {
PyObject *handler;
PyObject *handler_rx_call;
dx_dispatch_t *dx;
- dx_address_t *address;
+ Py_ssize_t addr_count;
+ dx_address_t **addrs;
} IoAdapter;
-static void dx_io_rx_handler(void *context, dx_message_t *msg)
+static void dx_io_rx_handler(void *context, dx_message_t *msg, int link_id)
{
IoAdapter *self = (IoAdapter*) context;
@@ -451,42 +452,60 @@ static void dx_io_rx_handler(void *context, dx_message_t *msg)
return;
}
+ sys_mutex_lock(lock);
PyObject *pAP = dx_field_to_py(ap_map);
PyObject *pBody = dx_field_to_py(body_map);
- PyObject *pArgs = PyTuple_New(2);
+ PyObject *pArgs = PyTuple_New(3);
PyTuple_SetItem(pArgs, 0, pAP);
PyTuple_SetItem(pArgs, 1, pBody);
+ PyTuple_SetItem(pArgs, 2, PyInt_FromLong((long) link_id));
PyObject *pValue = PyObject_CallObject(self->handler_rx_call, pArgs);
Py_DECREF(pArgs);
if (pValue) {
Py_DECREF(pValue);
}
+ sys_mutex_unlock(lock);
+
+ dx_field_iterator_free(ap);
+ dx_field_iterator_free(body);
+ dx_parse_free(ap_map);
+ dx_parse_free(body_map);
}
static int IoAdapter_init(IoAdapter *self, PyObject *args, PyObject *kwds)
{
- const char *address;
- if (!PyArg_ParseTuple(args, "Os", &self->handler, &address))
+ PyObject *addrs;
+ if (!PyArg_ParseTuple(args, "OO", &self->handler, &addrs))
return -1;
self->handler_rx_call = PyObject_GetAttrString(self->handler, "receive");
if (!self->handler_rx_call || !PyCallable_Check(self->handler_rx_call))
return -1;
+ if (!PyTuple_Check(addrs))
+ return -1;
+
Py_INCREF(self->handler);
Py_INCREF(self->handler_rx_call);
- self->dx = dispatch;
- self->address = dx_router_register_address(self->dx, address, dx_io_rx_handler, self);
+ self->dx = dispatch;
+ self->addr_count = PyTuple_Size(addrs);
+ self->addrs = NEW_PTR_ARRAY(dx_address_t, self->addr_count);
+ for (Py_ssize_t idx = 0; idx < self->addr_count; idx++)
+ self->addrs[idx] = dx_router_register_address(self->dx,
+ PyString_AS_STRING(PyTuple_GetItem(addrs, idx)),
+ dx_io_rx_handler, self);
return 0;
}
static void IoAdapter_dealloc(IoAdapter* self)
{
- dx_router_unregister_address(self->address);
+ for (Py_ssize_t idx = 0; idx < self->addr_count; idx++)
+ dx_router_unregister_address(self->addrs[idx]);
+ free(self->addrs);
Py_DECREF(self->handler);
Py_DECREF(self->handler_rx_call);
self->ob_type->tp_free((PyObject*)self);
@@ -507,10 +526,10 @@ static PyObject* dx_python_send(PyObject *self, PyObject *args)
field = dx_compose(DX_PERFORMATIVE_DELIVERY_ANNOTATIONS, field);
dx_compose_start_map(field);
- dx_compose_insert_string(field, "qdx.ingress");
+ dx_compose_insert_string(field, DX_DA_INGRESS);
dx_compose_insert_string(field, dx_router_id(ioa->dx));
- dx_compose_insert_string(field, "qdx.trace");
+ dx_compose_insert_string(field, DX_DA_TRACE);
dx_compose_start_list(field);
dx_compose_insert_string(field, dx_router_id(ioa->dx));
dx_compose_end_list(field);
@@ -530,10 +549,10 @@ static PyObject* dx_python_send(PyObject *self, PyObject *args)
field = dx_compose(DX_PERFORMATIVE_BODY_AMQP_VALUE, field);
dx_py_to_composed(body, field);
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_compose_2(msg, field);
dx_router_send2(ioa->dx, address, msg);
- dx_free_message(msg);
+ dx_message_free(msg);
dx_compose_free(field);
Py_INCREF(Py_None);
@@ -625,7 +644,8 @@ static void dx_python_setup()
//
// Add LogAdapter
//
- Py_INCREF(&LogAdapterType);
+ PyTypeObject *laType = &LogAdapterType;
+ Py_INCREF(laType);
PyModule_AddObject(m, "LogAdapter", (PyObject*) &LogAdapterType);
dx_register_log_constant(m, "LOG_TRACE", LOG_TRACE);
@@ -637,10 +657,22 @@ static void dx_python_setup()
dx_register_log_constant(m, "LOG_CRITICAL", LOG_CRITICAL);
//
- Py_INCREF(&IoAdapterType);
+ PyTypeObject *ioaType = &IoAdapterType;
+ Py_INCREF(ioaType);
PyModule_AddObject(m, "IoAdapter", (PyObject*) &IoAdapterType);
Py_INCREF(m);
dispatch_module = m;
}
}
+
+void dx_python_lock()
+{
+ sys_mutex_lock(lock);
+}
+
+void dx_python_unlock()
+{
+ sys_mutex_unlock(lock);
+}
+
diff --git a/qpid/extras/dispatch/src/router_agent.c b/qpid/extras/dispatch/src/router_agent.c
new file mode 100644
index 0000000000..d4b719732c
--- /dev/null
+++ b/qpid/extras/dispatch/src/router_agent.c
@@ -0,0 +1,187 @@
+/*
+ * 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/dispatch/python_embedded.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <qpid/dispatch.h>
+#include <qpid/dispatch/agent.h>
+#include "dispatch_private.h"
+#include "router_private.h"
+
+//static char *module = "router.agent";
+
+#define DX_ROUTER_CLASS_ROUTER 1
+#define DX_ROUTER_CLASS_LINK 2
+#define DX_ROUTER_CLASS_NODE 3
+#define DX_ROUTER_CLASS_ADDRESS 4
+
+typedef struct dx_router_class_t {
+ dx_router_t *router;
+ int class_id;
+} dx_router_class_t;
+
+
+static void dx_router_schema_handler(void *context, void *correlator)
+{
+}
+
+
+static const char *dx_router_addr_text(dx_address_t *addr)
+{
+ if (addr) {
+ const unsigned char *text = dx_hash_key_by_handle(addr->hash_handle);
+ if (text)
+ return (const char*) text;
+ }
+ return 0;
+}
+
+
+static void dx_router_query_router(dx_router_t *router, void *cor)
+{
+ dx_agent_value_string(cor, "area", router->router_area);
+ dx_agent_value_string(cor, "router_id", router->router_id);
+
+ sys_mutex_lock(router->lock);
+ dx_agent_value_uint(cor, "addr_count", DEQ_SIZE(router->addrs));
+ dx_agent_value_uint(cor, "link_count", DEQ_SIZE(router->links));
+ dx_agent_value_uint(cor, "node_count", DEQ_SIZE(router->routers));
+ sys_mutex_unlock(router->lock);
+
+ dx_agent_value_complete(cor, 0);
+}
+
+
+static void dx_router_query_link(dx_router_t *router, void *cor)
+{
+ sys_mutex_lock(router->lock);
+ dx_router_link_t *link = DEQ_HEAD(router->links);
+ const char *link_type = "?";
+ const char *link_dir;
+
+ while (link) {
+ dx_agent_value_uint(cor, "index", link->mask_bit);
+ switch (link->link_type) {
+ case DX_LINK_ENDPOINT: link_type = "endpoint"; break;
+ case DX_LINK_ROUTER: link_type = "inter-router"; break;
+ case DX_LINK_AREA: link_type = "inter-area"; break;
+ }
+ dx_agent_value_string(cor, "link-type", link_type);
+
+ if (link->link_direction == DX_INCOMING)
+ link_dir = "in";
+ else
+ link_dir = "out";
+ dx_agent_value_string(cor, "link-dir", link_dir);
+
+ const char *text = dx_router_addr_text(link->owning_addr);
+ if (text)
+ dx_agent_value_string(cor, "owning-addr", text);
+ else
+ dx_agent_value_null(cor, "owning-addr");
+
+ link = DEQ_NEXT(link);
+ dx_agent_value_complete(cor, link != 0);
+ }
+ sys_mutex_unlock(router->lock);
+}
+
+
+static void dx_router_query_node(dx_router_t *router, void *cor)
+{
+ sys_mutex_lock(router->lock);
+ dx_router_node_t *node = DEQ_HEAD(router->routers);
+ while (node) {
+ dx_agent_value_uint(cor, "index", node->mask_bit);
+ dx_agent_value_string(cor, "addr", dx_router_addr_text(node->owning_addr));
+ if (node->next_hop)
+ dx_agent_value_uint(cor, "next-hop", node->next_hop->mask_bit);
+ else
+ dx_agent_value_null(cor, "next-hop");
+ if (node->peer_link)
+ dx_agent_value_uint(cor, "router-link", node->peer_link->mask_bit);
+ else
+ dx_agent_value_null(cor, "router-link");
+ node = DEQ_NEXT(node);
+ dx_agent_value_complete(cor, node != 0);
+ }
+ sys_mutex_unlock(router->lock);
+}
+
+
+static void dx_router_query_address(dx_router_t *router, void *cor)
+{
+ sys_mutex_lock(router->lock);
+ dx_address_t *addr = DEQ_HEAD(router->addrs);
+ while (addr) {
+ dx_agent_value_string(cor, "addr", dx_router_addr_text(addr));
+ dx_agent_value_boolean(cor, "in-process", addr->handler != 0);
+ dx_agent_value_uint(cor, "subscriber-count", DEQ_SIZE(addr->rlinks));
+ dx_agent_value_uint(cor, "remote-count", DEQ_SIZE(addr->rnodes));
+ dx_agent_value_uint(cor, "deliveries-ingress", addr->deliveries_ingress);
+ dx_agent_value_uint(cor, "deliveries-egress", addr->deliveries_egress);
+ dx_agent_value_uint(cor, "deliveries-transit", addr->deliveries_transit);
+ dx_agent_value_uint(cor, "deliveries-to-container", addr->deliveries_to_container);
+ dx_agent_value_uint(cor, "deliveries-from-container", addr->deliveries_from_container);
+ addr = DEQ_NEXT(addr);
+ dx_agent_value_complete(cor, addr != 0);
+ }
+ sys_mutex_unlock(router->lock);
+}
+
+
+static void dx_router_query_handler(void* context, const char *id, void *correlator)
+{
+ dx_router_class_t *cls = (dx_router_class_t*) context;
+ switch (cls->class_id) {
+ case DX_ROUTER_CLASS_ROUTER: dx_router_query_router(cls->router, correlator); break;
+ case DX_ROUTER_CLASS_LINK: dx_router_query_link(cls->router, correlator); break;
+ case DX_ROUTER_CLASS_NODE: dx_router_query_node(cls->router, correlator); break;
+ case DX_ROUTER_CLASS_ADDRESS: dx_router_query_address(cls->router, correlator); break;
+ }
+}
+
+
+static dx_agent_class_t *dx_router_setup_class(dx_router_t *router, const char *fqname, int id)
+{
+ dx_router_class_t *cls = NEW(dx_router_class_t);
+ cls->router = router;
+ cls->class_id = id;
+
+ return dx_agent_register_class(router->dx, fqname, cls,
+ dx_router_schema_handler,
+ dx_router_query_handler);
+}
+
+
+void dx_router_agent_setup(dx_router_t *router)
+{
+ router->class_router =
+ dx_router_setup_class(router, "org.apache.qpid.dispatch.router", DX_ROUTER_CLASS_ROUTER);
+ router->class_link =
+ dx_router_setup_class(router, "org.apache.qpid.dispatch.router.link", DX_ROUTER_CLASS_LINK);
+ router->class_node =
+ dx_router_setup_class(router, "org.apache.qpid.dispatch.router.node", DX_ROUTER_CLASS_NODE);
+ router->class_address =
+ dx_router_setup_class(router, "org.apache.qpid.dispatch.router.address", DX_ROUTER_CLASS_ADDRESS);
+}
+
diff --git a/qpid/extras/dispatch/src/router_node.c b/qpid/extras/dispatch/src/router_node.c
index d2704c4bd5..931f4551bb 100644
--- a/qpid/extras/dispatch/src/router_node.c
+++ b/qpid/extras/dispatch/src/router_node.c
@@ -21,17 +21,17 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
+#include <stdlib.h>
#include <qpid/dispatch.h>
#include "dispatch_private.h"
+#include "router_private.h"
static char *module = "ROUTER";
-static void dx_router_python_setup(dx_router_t *router);
-static void dx_pyrouter_tick(dx_router_t *router);
-
-static char *router_address = "_local/qdxrouter";
-static char *local_prefix = "_local/";
-//static char *topo_prefix = "_topo/";
+static char *router_role = "inter-router";
+static char *local_prefix = "_local/";
+static char *topo_prefix = "_topo/";
+static char *direct_prefix;
/**
* Address Types and Processing:
@@ -48,86 +48,197 @@ static char *local_prefix = "_local/";
* <mobile> M<mobile> forward handler
*/
+ALLOC_DEFINE(dx_routed_event_t);
+ALLOC_DEFINE(dx_router_link_t);
+ALLOC_DEFINE(dx_router_node_t);
+ALLOC_DEFINE(dx_router_ref_t);
+ALLOC_DEFINE(dx_router_link_ref_t);
+ALLOC_DEFINE(dx_address_t);
+ALLOC_DEFINE(dx_router_conn_t);
-typedef struct dx_router_link_t dx_router_link_t;
-typedef struct dx_router_node_t dx_router_node_t;
+void dx_router_add_link_ref_LH(dx_router_link_ref_list_t *ref_list, dx_router_link_t *link)
+{
+ dx_router_link_ref_t *ref = new_dx_router_link_ref_t();
+ DEQ_ITEM_INIT(ref);
+ ref->link = link;
+ link->ref = ref;
+ DEQ_INSERT_TAIL(*ref_list, ref);
+}
-typedef enum {
- DX_LINK_ENDPOINT, // A link to a connected endpoint
- DX_LINK_ROUTER, // A link to a peer router in the same area
- DX_LINK_AREA // A link to a peer router in a different area (area boundary)
-} dx_link_type_t;
+void dx_router_del_link_ref_LH(dx_router_link_ref_list_t *ref_list, dx_router_link_t *link)
+{
+ if (link->ref) {
+ DEQ_REMOVE(*ref_list, link->ref);
+ free_dx_router_link_ref_t(link->ref);
+ link->ref = 0;
+ }
+}
-typedef struct dx_routed_event_t {
- DEQ_LINKS(struct dx_routed_event_t);
- dx_delivery_t *delivery;
- dx_message_t *message;
- bool settle;
- uint64_t disposition;
-} dx_routed_event_t;
-ALLOC_DECLARE(dx_routed_event_t);
-ALLOC_DEFINE(dx_routed_event_t);
-DEQ_DECLARE(dx_routed_event_t, dx_routed_event_list_t);
-
-
-struct dx_router_link_t {
- DEQ_LINKS(dx_router_link_t);
- dx_direction_t link_direction;
- dx_link_type_t link_type;
- dx_address_t *owning_addr; // [ref] Address record that owns this link
- dx_link_t *link; // [own] Link pointer
- dx_router_link_t *connected_link; // [ref] If this is a link-route, reference the connected link
- dx_router_link_t *peer_link; // [ref] If this is a bidirectional link-route, reference the peer link
- dx_routed_event_list_t event_fifo; // FIFO of outgoing delivery/link events (no messages)
- dx_routed_event_list_t msg_fifo; // FIFO of outgoing message deliveries
-};
-
-ALLOC_DECLARE(dx_router_link_t);
-ALLOC_DEFINE(dx_router_link_t);
-DEQ_DECLARE(dx_router_link_t, dx_router_link_list_t);
+void dx_router_add_node_ref_LH(dx_router_ref_list_t *ref_list, dx_router_node_t *rnode)
+{
+ dx_router_ref_t *ref = new_dx_router_ref_t();
+ DEQ_ITEM_INIT(ref);
+ ref->router = rnode;
+ rnode->ref_count++;
+ DEQ_INSERT_TAIL(*ref_list, ref);
+}
-struct dx_router_node_t {
- DEQ_LINKS(dx_router_node_t);
- const char *id;
- dx_router_node_t *next_hop; // Next hop node _if_ this is not a neighbor node
- dx_router_link_t *peer_link; // Outgoing link _if_ this is a neighbor node
- // list of valid origins (pointers to router_node) - (bit masks?)
-};
-ALLOC_DECLARE(dx_router_node_t);
-ALLOC_DEFINE(dx_router_node_t);
-DEQ_DECLARE(dx_router_node_t, dx_router_node_list_t);
+void dx_router_del_node_ref_LH(dx_router_ref_list_t *ref_list, dx_router_node_t *rnode)
+{
+ dx_router_ref_t *ref = DEQ_HEAD(*ref_list);
+ while (ref) {
+ if (ref->router == rnode) {
+ DEQ_REMOVE(*ref_list, ref);
+ free_dx_router_ref_t(ref);
+ rnode->ref_count--;
+ break;
+ }
+ ref = DEQ_NEXT(ref);
+ }
+}
-struct dx_address_t {
- dx_router_message_cb handler; // In-Process Consumer
- void *handler_context;
- dx_router_link_list_t rlinks; // Locally-Connected Consumers
- dx_router_node_list_t rnodes; // Remotely-Connected Consumers
-};
+/**
+ * Check an address to see if it no longer has any associated destinations.
+ * Depending on its policy, the address may be eligible for being closed out
+ * (i.e. Logging its terminal statistics and freeing its resources).
+ */
+void dx_router_check_addr(dx_router_t *router, dx_address_t *addr, int was_local)
+{
+ if (addr == 0)
+ return;
-ALLOC_DECLARE(dx_address_t);
-ALLOC_DEFINE(dx_address_t);
+ unsigned char *key = 0;
+ int to_delete = 0;
+ int no_more_locals = 0;
+
+ sys_mutex_lock(router->lock);
+
+ //
+ // If the address has no handlers or destinations, it should be deleted.
+ //
+ if (addr->handler == 0 && DEQ_SIZE(addr->rlinks) == 0 && DEQ_SIZE(addr->rnodes) == 0)
+ to_delete = 1;
+
+ //
+ // If we have just removed a local linkage and it was the last local linkage,
+ // we need to notify the router module that there is no longer a local
+ // presence of this address.
+ //
+ if (was_local && DEQ_SIZE(addr->rlinks) == 0)
+ no_more_locals = 1;
+
+ if (to_delete) {
+ //
+ // Delete the address but grab the hash key so we can use it outside the
+ // critical section.
+ //
+ dx_hash_remove_by_handle2(router->addr_hash, addr->hash_handle, &key);
+ DEQ_REMOVE(router->addrs, addr);
+ dx_hash_handle_free(addr->hash_handle);
+ free_dx_address_t(addr);
+ }
+
+ //
+ // If we're not deleting but there are no more locals, get a copy of the hash key.
+ //
+ if (!to_delete && no_more_locals) {
+ const unsigned char *key_const = dx_hash_key_by_handle(addr->hash_handle);
+ key = (unsigned char*) malloc(strlen((const char*) key_const) + 1);
+ strcpy((char*) key, (const char*) key_const);
+ }
+
+ sys_mutex_unlock(router->lock);
+ //
+ // If the address is mobile-class and it was just removed from a local link,
+ // tell the router module that it is no longer attached locally.
+ //
+ if (no_more_locals && key && key[0] == 'M')
+ dx_router_mobile_removed(router, (const char*) key);
-struct dx_router_t {
- dx_dispatch_t *dx;
- const char *router_area;
- const char *router_id;
- dx_node_t *node;
- dx_router_link_list_t in_links;
- dx_router_node_list_t routers;
- dx_message_list_t in_fifo;
- sys_mutex_t *lock;
- dx_timer_t *timer;
- hash_t *out_hash;
- uint64_t dtag;
- PyObject *pyRouter;
- PyObject *pyTick;
-};
+ //
+ // Free the key that was not freed by the hash table.
+ //
+ if (key)
+ free(key);
+}
+
+
+/**
+ * Determine whether a connection is configured in the inter-router role.
+ */
+static int dx_router_connection_is_inter_router(const dx_connection_t *conn)
+{
+ if (!conn)
+ return 0;
+
+ const dx_server_config_t *cf = dx_connection_config(conn);
+ if (cf && strcmp(cf->role, router_role) == 0)
+ return 1;
+
+ return 0;
+}
+
+
+/**
+ * Determine whether a terminus has router capability
+ */
+static int dx_router_terminus_is_router(pn_terminus_t *term)
+{
+ pn_data_t *cap = pn_terminus_capabilities(term);
+
+ pn_data_rewind(cap);
+ pn_data_next(cap);
+ if (cap && pn_data_type(cap) == PN_SYMBOL) {
+ pn_bytes_t sym = pn_data_get_symbol(cap);
+ if (sym.size == strlen(DX_CAPABILITY_ROUTER) &&
+ strcmp(sym.start, DX_CAPABILITY_ROUTER) == 0)
+ return 1;
+ }
+
+ return 0;
+}
+
+
+static void dx_router_generate_temp_addr(dx_router_t *router, char *buffer, size_t length)
+{
+ static const char *table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+_";
+ char discriminator[11];
+ long int rnd = random();
+ int idx;
+
+ for (idx = 0; idx < 6; idx++)
+ discriminator[idx] = table[(rnd >> (idx * 6)) & 63];
+ discriminator[idx] = '\0';
+
+ snprintf(buffer, length, "amqp:/%s%s/%s/temp.%s", topo_prefix, router->router_area, router->router_id, discriminator);
+}
+
+
+static int dx_router_find_mask_bit_LH(dx_router_t *router, dx_link_t *link)
+{
+ dx_router_conn_t *shared = (dx_router_conn_t*) dx_link_get_conn_context(link);
+ if (shared)
+ return shared->mask_bit;
+
+ int mask_bit;
+ if (dx_bitmask_first_set(router->neighbor_free_mask, &mask_bit)) {
+ dx_bitmask_clear_bit(router->neighbor_free_mask, mask_bit);
+ } else {
+ dx_log(module, LOG_CRITICAL, "Exceeded maximum inter-router link count");
+ return -1;
+ }
+
+ shared = new_dx_router_conn_t();
+ shared->mask_bit = mask_bit;
+ dx_link_set_conn_context(link, shared);
+ return mask_bit;
+}
/**
@@ -191,7 +302,7 @@ static int router_writable_link_handler(void* context, dx_link_t *link)
DEQ_REMOVE_HEAD(to_send);
//
- // Get a delivery for the send. This will be the current deliver on the link.
+ // Get a delivery for the send. This will be the current delivery on the link.
//
tag++;
delivery = dx_delivery(link, pn_dtag((char*) &tag, 8));
@@ -215,7 +326,7 @@ static int router_writable_link_handler(void* context, dx_link_t *link)
pn_link_advance(pn_link);
event_count++;
- dx_free_message(re->message);
+ dx_message_free(re->message);
free_dx_routed_event_t(re);
re = DEQ_HEAD(to_send);
}
@@ -250,17 +361,18 @@ static int router_writable_link_handler(void* context, dx_link_t *link)
}
-static void router_annotate_message(dx_router_t *router, dx_message_t *msg)
+static dx_field_iterator_t *router_annotate_message(dx_router_t *router, dx_message_t *msg, int *drop)
{
- dx_parsed_field_t *in_da = dx_message_delivery_annotations(msg);
- dx_composed_field_t *out_da = dx_compose(DX_PERFORMATIVE_DELIVERY_ANNOTATIONS, 0);
+ dx_parsed_field_t *in_da = dx_message_delivery_annotations(msg);
+ dx_composed_field_t *out_da = dx_compose(DX_PERFORMATIVE_DELIVERY_ANNOTATIONS, 0);
+ dx_field_iterator_t *ingress_iter = 0;
dx_parsed_field_t *trace = 0;
dx_parsed_field_t *ingress = 0;
if (in_da) {
- trace = dx_parse_value_by_key(in_da, "qdx.trace");
- ingress = dx_parse_value_by_key(in_da, "qdx.ingress");
+ trace = dx_parse_value_by_key(in_da, DX_DA_TRACE);
+ ingress = dx_parse_value_by_key(in_da, DX_DA_INGRESS);
}
dx_compose_start_map(out_da);
@@ -268,38 +380,48 @@ static void router_annotate_message(dx_router_t *router, dx_message_t *msg)
//
// If there is a trace field, append this router's ID to the trace.
//
- if (trace && dx_parse_is_list(trace)) {
- dx_compose_insert_string(out_da, "qdx.trace");
- dx_compose_start_list(out_da);
-
- uint32_t idx = 0;
- dx_parsed_field_t *trace_item = dx_parse_sub_value(trace, idx);
- while (trace_item) {
- dx_field_iterator_t *iter = dx_parse_raw(trace_item);
- dx_compose_insert_string_iterator(out_da, iter);
- idx++;
- trace_item = dx_parse_sub_value(trace, idx);
+ dx_compose_insert_string(out_da, DX_DA_TRACE);
+ dx_compose_start_list(out_da);
+ if (trace) {
+ if (dx_parse_is_list(trace)) {
+ uint32_t idx = 0;
+ dx_parsed_field_t *trace_item = dx_parse_sub_value(trace, idx);
+ while (trace_item) {
+ dx_field_iterator_t *iter = dx_parse_raw(trace_item);
+ if (dx_field_iterator_equal(iter, (unsigned char*) direct_prefix))
+ *drop = 1;
+ dx_field_iterator_reset(iter);
+ dx_compose_insert_string_iterator(out_da, iter);
+ idx++;
+ trace_item = dx_parse_sub_value(trace, idx);
+ }
}
-
- dx_compose_insert_string(out_da, router->router_id);
- dx_compose_end_list(out_da);
}
+ dx_compose_insert_string(out_da, direct_prefix);
+ dx_compose_end_list(out_da);
+
//
// If there is no ingress field, annotate the ingress as this router else
// keep the original field.
//
- dx_compose_insert_string(out_da, "qdx.ingress");
+ dx_compose_insert_string(out_da, DX_DA_INGRESS);
if (ingress && dx_parse_is_scalar(ingress)) {
- dx_field_iterator_t *iter = dx_parse_raw(ingress);
- dx_compose_insert_string_iterator(out_da, iter);
+ ingress_iter = dx_parse_raw(ingress);
+ dx_compose_insert_string_iterator(out_da, ingress_iter);
} else
- dx_compose_insert_string(out_da, router->router_id);
+ dx_compose_insert_string(out_da, direct_prefix);
dx_compose_end_map(out_da);
dx_message_set_delivery_annotations(msg, out_da);
dx_compose_free(out_da);
+
+ //
+ // Return the iterator to the ingress field _if_ it was present.
+ // If we added the ingress, return NULL.
+ //
+ return ingress_iter;
}
@@ -318,10 +440,7 @@ static void router_rx_handler(void* context, dx_link_t *link, dx_delivery_t *del
// Receive the message into a local representation. If the returned message
// pointer is NULL, we have not yet received a complete message.
//
- sys_mutex_lock(router->lock);
msg = dx_message_receive(delivery);
- sys_mutex_unlock(router->lock);
-
if (!msg)
return;
@@ -380,84 +499,155 @@ static void router_rx_handler(void* context, dx_link_t *link, dx_delivery_t *del
if (iter) {
dx_field_iterator_reset_view(iter, ITER_VIEW_ADDRESS_HASH);
- hash_retrieve(router->out_hash, iter, (void*) &addr);
+
+ //
+ // Note: This function is going to need to be refactored so we can put an
+ // asynchronous address lookup here. In the event there is a translation
+ // of the address (via namespace), it will have to be done here after
+ // obtaining the iterator and before doing the hash lookup.
+ //
+ // Note that this lookup is only done for global/mobile class addresses.
+ //
+
+ dx_hash_retrieve(router->addr_hash, iter, (void*) &addr);
dx_field_iterator_reset_view(iter, ITER_VIEW_NO_HOST);
- int is_local = dx_field_iterator_prefix(iter, local_prefix);
+ int is_local = dx_field_iterator_prefix(iter, local_prefix);
+ int is_direct = dx_field_iterator_prefix(iter, direct_prefix);
dx_field_iterator_free(iter);
if (addr) {
//
+ // If the incoming link is an endpoint link, count this as an ingress delivery.
+ //
+ if (rlink->link_type == DX_LINK_ENDPOINT)
+ addr->deliveries_ingress++;
+
+ //
// To field is valid and contains a known destination. Handle the various
// cases for forwarding.
//
//
- // Interpret and update the delivery annotations of the message
+ // Interpret and update the delivery annotations of the message. As a convenience,
+ // this function returns the iterator to the ingress field (if it exists).
//
- router_annotate_message(router, msg);
+ int drop = 0;
+ dx_field_iterator_t *ingress_iter = router_annotate_message(router, msg, &drop);
//
// Forward to the in-process handler for this message if there is one. The
// actual invocation of the handler will occur later after we've released
// the lock.
//
- if (addr->handler) {
+ if (!drop && addr->handler) {
in_process_copy = dx_message_copy(msg);
handler = addr->handler;
handler_context = addr->handler_context;
+ addr->deliveries_to_container++;
}
//
// If the address form is local (i.e. is prefixed by _local), don't forward
// outside of the router process.
//
- if (!is_local) {
+ if (!drop && !is_local) {
//
// Forward to all of the local links receiving this address.
//
- dx_router_link_t *dest_link = DEQ_HEAD(addr->rlinks);
- while (dest_link) {
+ dx_router_link_ref_t *dest_link_ref = DEQ_HEAD(addr->rlinks);
+ while (dest_link_ref) {
dx_routed_event_t *re = new_dx_routed_event_t();
DEQ_ITEM_INIT(re);
re->delivery = 0;
re->message = dx_message_copy(msg);
re->settle = 0;
re->disposition = 0;
- DEQ_INSERT_TAIL(dest_link->msg_fifo, re);
+ DEQ_INSERT_TAIL(dest_link_ref->link->msg_fifo, re);
fanout++;
if (fanout == 1 && !dx_delivery_settled(delivery))
re->delivery = delivery;
- dx_link_activate(dest_link->link);
- dest_link = DEQ_NEXT(dest_link);
+ addr->deliveries_egress++;
+ dx_link_activate(dest_link_ref->link->link);
+ dest_link_ref = DEQ_NEXT(dest_link_ref);
}
//
- // Forward to the next-hops for remote destinations.
+ // If the address form is direct to this router node, don't relay it on
+ // to any other part of the network.
//
- dx_router_node_t *dest_node = DEQ_HEAD(addr->rnodes);
- while (dest_node) {
- if (dest_node->next_hop)
- dest_link = dest_node->next_hop->peer_link;
- else
- dest_link = dest_node->peer_link;
- if (dest_link) {
- dx_routed_event_t *re = new_dx_routed_event_t();
- DEQ_ITEM_INIT(re);
- re->delivery = 0;
- re->message = dx_message_copy(msg);
- re->settle = 0;
- re->disposition = 0;
- DEQ_INSERT_TAIL(dest_link->msg_fifo, re);
-
- fanout++;
- if (fanout == 1)
- re->delivery = delivery;
-
- dx_link_activate(dest_link->link);
+ if (!is_direct) {
+ //
+ // Get the mask bit associated with the ingress router for the message.
+ // This will be compared against the "valid_origin" masks for each
+ // candidate destination router.
+ //
+ int origin = -1;
+ if (ingress_iter) {
+ dx_field_iterator_reset_view(ingress_iter, ITER_VIEW_ADDRESS_HASH);
+ dx_address_t *origin_addr;
+ dx_hash_retrieve(router->addr_hash, ingress_iter, (void*) &origin_addr);
+ if (origin_addr && DEQ_SIZE(origin_addr->rnodes) == 1) {
+ dx_router_ref_t *rref = DEQ_HEAD(origin_addr->rnodes);
+ origin = rref->router->mask_bit;
+ }
+ } else
+ origin = 0;
+
+ //
+ // Forward to the next-hops for remote destinations.
+ //
+ if (origin >= 0) {
+ dx_router_ref_t *dest_node_ref = DEQ_HEAD(addr->rnodes);
+ dx_router_link_t *dest_link;
+ dx_bitmask_t *link_set = dx_bitmask(0);
+
+ //
+ // Loop over the target nodes for this address. Build a set of outgoing links
+ // for which there are valid targets. We do this to avoid sending more than one
+ // message down a given link. It's possible that there are multiple destinations
+ // for this address that are all reachable over the same link. In this case, we
+ // will send only one copy of the message over the link and allow a downstream
+ // router to fan the message out.
+ //
+ while (dest_node_ref) {
+ if (dest_node_ref->router->next_hop)
+ dest_link = dest_node_ref->router->next_hop->peer_link;
+ else
+ dest_link = dest_node_ref->router->peer_link;
+ if (dest_link && dx_bitmask_value(dest_node_ref->router->valid_origins, origin))
+ dx_bitmask_set_bit(link_set, dest_link->mask_bit);
+ dest_node_ref = DEQ_NEXT(dest_node_ref);
+ }
+
+ //
+ // Send a copy of the message outbound on each identified link.
+ //
+ int link_bit;
+ while (dx_bitmask_first_set(link_set, &link_bit)) {
+ dx_bitmask_clear_bit(link_set, link_bit);
+ dest_link = router->out_links_by_mask_bit[link_bit];
+ if (dest_link) {
+ dx_routed_event_t *re = new_dx_routed_event_t();
+ DEQ_ITEM_INIT(re);
+ re->delivery = 0;
+ re->message = dx_message_copy(msg);
+ re->settle = 0;
+ re->disposition = 0;
+ DEQ_INSERT_TAIL(dest_link->msg_fifo, re);
+
+ fanout++;
+ if (fanout == 1 && !dx_delivery_settled(delivery))
+ re->delivery = delivery;
+
+ addr->deliveries_transit++;
+ dx_link_activate(dest_link->link);
+ }
+ }
+
+ dx_bitmask_free(link_set);
}
- dest_node = DEQ_NEXT(dest_node);
}
}
}
@@ -470,8 +660,7 @@ static void router_rx_handler(void* context, dx_link_t *link, dx_delivery_t *del
dx_delivery_free(delivery, PN_ACCEPTED);
} else if (fanout == 0) {
dx_delivery_free(delivery, PN_RELEASED);
- } else if (fanout > 1)
- dx_delivery_free(delivery, PN_ACCEPTED);
+ }
}
} else {
//
@@ -481,13 +670,15 @@ static void router_rx_handler(void* context, dx_link_t *link, dx_delivery_t *del
}
sys_mutex_unlock(router->lock);
- dx_free_message(msg);
+ dx_message_free(msg);
//
// Invoke the in-process handler now that the lock is released.
//
- if (handler)
- handler(handler_context, in_process_copy);
+ if (handler) {
+ handler(handler_context, in_process_copy, rlink->mask_bit);
+ dx_message_free(in_process_copy);
+ }
}
@@ -538,28 +729,37 @@ static void router_disp_handler(void* context, dx_link_t *link, dx_delivery_t *d
*/
static int router_incoming_link_handler(void* context, dx_link_t *link)
{
- dx_router_t *router = (dx_router_t*) context;
- dx_router_link_t *rlink = new_dx_router_link_t();
- pn_link_t *pn_link = dx_link_pn(link);
+ dx_router_t *router = (dx_router_t*) context;
+ pn_link_t *pn_link = dx_link_pn(link);
+ int is_router = dx_router_terminus_is_router(dx_link_remote_source(link));
+
+ if (is_router && !dx_router_connection_is_inter_router(dx_link_connection(link))) {
+ dx_log(module, LOG_WARNING, "Incoming link claims router capability but is not on an inter-router connection");
+ pn_link_close(pn_link);
+ return 0;
+ }
+ dx_router_link_t *rlink = new_dx_router_link_t();
DEQ_ITEM_INIT(rlink);
+ rlink->link_type = is_router ? DX_LINK_ROUTER : DX_LINK_ENDPOINT;
rlink->link_direction = DX_INCOMING;
- rlink->link_type = DX_LINK_ENDPOINT;
rlink->owning_addr = 0;
rlink->link = link;
rlink->connected_link = 0;
rlink->peer_link = 0;
+ rlink->ref = 0;
DEQ_INIT(rlink->event_fifo);
DEQ_INIT(rlink->msg_fifo);
dx_link_set_context(link, rlink);
sys_mutex_lock(router->lock);
- DEQ_INSERT_TAIL(router->in_links, rlink);
+ rlink->mask_bit = is_router ? dx_router_find_mask_bit_LH(router, link) : 0;
+ DEQ_INSERT_TAIL(router->links, rlink);
sys_mutex_unlock(router->lock);
- pn_terminus_copy(pn_link_source(pn_link), pn_link_remote_source(pn_link));
- pn_terminus_copy(pn_link_target(pn_link), pn_link_remote_target(pn_link));
+ pn_terminus_copy(dx_link_source(link), dx_link_remote_source(link));
+ pn_terminus_copy(dx_link_target(link), dx_link_remote_target(link));
pn_link_flow(pn_link, 1000);
pn_link_open(pn_link);
@@ -579,52 +779,125 @@ static int router_outgoing_link_handler(void* context, dx_link_t *link)
{
dx_router_t *router = (dx_router_t*) context;
pn_link_t *pn_link = dx_link_pn(link);
- const char *r_tgt = pn_terminus_get_address(pn_link_remote_target(pn_link));
+ const char *r_src = pn_terminus_get_address(dx_link_remote_source(link));
+ int is_dynamic = pn_terminus_is_dynamic(dx_link_remote_source(link));
+ int is_router = dx_router_terminus_is_router(dx_link_remote_target(link));
+ int propagate = 0;
+ dx_field_iterator_t *iter = 0;
+
+ if (is_router && !dx_router_connection_is_inter_router(dx_link_connection(link))) {
+ dx_log(module, LOG_WARNING, "Outgoing link claims router capability but is not on an inter-router connection");
+ pn_link_close(pn_link);
+ return 0;
+ }
- if (!r_tgt) {
+ //
+ // If this link is not a router link and it has no source address, we can't
+ // accept it.
+ //
+ if (r_src == 0 && !is_router && !is_dynamic) {
pn_link_close(pn_link);
return 0;
}
- dx_field_iterator_t *iter = dx_field_iterator_string(r_tgt, ITER_VIEW_NO_HOST);
- dx_router_link_t *rlink = new_dx_router_link_t();
- int is_router = dx_field_iterator_equal(iter, (unsigned char*) router_address);
+ //
+ // If this is an endpoint link with a source address, make sure the address is
+ // appropriate for endpoint links. If it is not mobile address, it cannot be
+ // bound to an endpoint link.
+ //
+ if(r_src && !is_router && !is_dynamic) {
+ iter = dx_field_iterator_string(r_src, ITER_VIEW_ADDRESS_HASH);
+ unsigned char prefix = dx_field_iterator_octet(iter);
+ dx_field_iterator_reset(iter);
+ if (prefix != 'M') {
+ dx_field_iterator_free(iter);
+ pn_link_close(pn_link);
+ dx_log(module, LOG_WARNING, "Rejected an outgoing endpoint link with a router address: %s", r_src);
+ return 0;
+ }
+ }
+
+ //
+ // Create a router_link record for this link. Some of the fields will be
+ // modified in the different cases below.
+ //
+ dx_router_link_t *rlink = new_dx_router_link_t();
DEQ_ITEM_INIT(rlink);
- rlink->link_direction = DX_OUTGOING;
rlink->link_type = is_router ? DX_LINK_ROUTER : DX_LINK_ENDPOINT;
+ rlink->link_direction = DX_OUTGOING;
+ rlink->owning_addr = 0;
rlink->link = link;
rlink->connected_link = 0;
rlink->peer_link = 0;
+ rlink->ref = 0;
DEQ_INIT(rlink->event_fifo);
DEQ_INIT(rlink->msg_fifo);
dx_link_set_context(link, rlink);
-
- dx_field_iterator_reset_view(iter, ITER_VIEW_ADDRESS_HASH);
- dx_address_t *addr;
+ pn_terminus_copy(dx_link_source(link), dx_link_remote_source(link));
+ pn_terminus_copy(dx_link_target(link), dx_link_remote_target(link));
sys_mutex_lock(router->lock);
- hash_retrieve(router->out_hash, iter, (void**) &addr);
- if (!addr) {
- addr = new_dx_address_t();
- addr->handler = 0;
- addr->handler_context = 0;
- DEQ_INIT(addr->rlinks);
- DEQ_INIT(addr->rnodes);
- hash_insert(router->out_hash, iter, addr);
+ rlink->mask_bit = is_router ? dx_router_find_mask_bit_LH(router, link) : 0;
+
+ if (is_router) {
+ //
+ // If this is a router link, put it in the hello_address link-list.
+ //
+ dx_router_add_link_ref_LH(&router->hello_addr->rlinks, rlink);
+ rlink->owning_addr = router->hello_addr;
+ router->out_links_by_mask_bit[rlink->mask_bit] = rlink;
+
+ } else {
+ //
+ // If this is an endpoint link, check the source. If it is dynamic, we will
+ // assign it an ephemeral and routable address. If it has a non-dymanic
+ // address, that address needs to be set up in the address list.
+ //
+ char temp_addr[1000]; // FIXME
+ dx_address_t *addr;
+
+ if (is_dynamic) {
+ dx_router_generate_temp_addr(router, temp_addr, 1000);
+ iter = dx_field_iterator_string(temp_addr, ITER_VIEW_ADDRESS_HASH);
+ pn_terminus_set_address(dx_link_source(link), temp_addr);
+ dx_log(module, LOG_INFO, "Assigned temporary routable address: %s", temp_addr);
+ } else
+ dx_log(module, LOG_INFO, "Registered local address: %s", r_src);
+
+ dx_hash_retrieve(router->addr_hash, iter, (void**) &addr);
+ if (!addr) {
+ addr = new_dx_address_t();
+ memset(addr, 0, sizeof(dx_address_t));
+ DEQ_ITEM_INIT(addr);
+ DEQ_INIT(addr->rlinks);
+ DEQ_INIT(addr->rnodes);
+ dx_hash_insert(router->addr_hash, iter, addr, &addr->hash_handle);
+ DEQ_INSERT_TAIL(router->addrs, addr);
+ }
+
+ rlink->owning_addr = addr;
+ dx_router_add_link_ref_LH(&addr->rlinks, rlink);
+
+ //
+ // If this is not a dynamic address and it is the first local subscription
+ // to the address, supply the address to the router module for propagation
+ // to other nodes.
+ //
+ propagate = (!is_dynamic) && (DEQ_SIZE(addr->rlinks) == 1);
}
- dx_field_iterator_free(iter);
- rlink->owning_addr = addr;
- DEQ_INSERT_TAIL(addr->rlinks, rlink);
+ DEQ_INSERT_TAIL(router->links, rlink);
+ sys_mutex_unlock(router->lock);
+
+ if (propagate)
+ dx_router_mobile_added(router, iter);
- pn_terminus_copy(pn_link_source(pn_link), pn_link_remote_source(pn_link));
- pn_terminus_copy(pn_link_target(pn_link), pn_link_remote_target(pn_link));
+ if (iter)
+ dx_field_iterator_free(iter);
pn_link_open(pn_link);
- sys_mutex_unlock(router->lock);
- dx_log(module, LOG_TRACE, "Registered new local address: %s", r_tgt);
return 0;
}
@@ -634,40 +907,60 @@ static int router_outgoing_link_handler(void* context, dx_link_t *link)
*/
static int router_link_detach_handler(void* context, dx_link_t *link, int closed)
{
- dx_router_t *router = (dx_router_t*) context;
- pn_link_t *pn_link = dx_link_pn(link);
- dx_router_link_t *rlink = (dx_router_link_t*) dx_link_get_context(link);
- const char *r_tgt = pn_terminus_get_address(pn_link_remote_target(pn_link));
+ dx_router_t *router = (dx_router_t*) context;
+ dx_router_link_t *rlink = (dx_router_link_t*) dx_link_get_context(link);
+ dx_router_conn_t *shared = (dx_router_conn_t*) dx_link_get_conn_context(link);
+ dx_address_t *oaddr = 0;
+
+ if (shared) {
+ dx_link_set_conn_context(link, 0);
+ free_dx_router_conn_t(shared);
+ }
if (!rlink)
return 0;
sys_mutex_lock(router->lock);
- if (pn_link_is_sender(pn_link)) {
- DEQ_REMOVE(rlink->owning_addr->rlinks, rlink);
-
- if ((rlink->owning_addr->handler == 0) &&
- (DEQ_SIZE(rlink->owning_addr->rlinks) == 0) &&
- (DEQ_SIZE(rlink->owning_addr->rnodes) == 0)) {
- dx_field_iterator_t *iter = dx_field_iterator_string(r_tgt, ITER_VIEW_ADDRESS_HASH);
- dx_address_t *addr;
- if (iter) {
- hash_retrieve(router->out_hash, iter, (void**) &addr);
- if (addr == rlink->owning_addr) {
- hash_remove(router->out_hash, iter);
- free_dx_router_link_t(rlink);
- free_dx_address_t(addr);
- dx_log(module, LOG_TRACE, "Removed local address: %s", r_tgt);
- }
- dx_field_iterator_free(iter);
- }
- }
- } else {
- DEQ_REMOVE(router->in_links, rlink);
- free_dx_router_link_t(rlink);
+
+ //
+ // If the link is outgoing, we must disassociate it from its address.
+ //
+ if (rlink->link_direction == DX_OUTGOING && rlink->owning_addr) {
+ dx_router_del_link_ref_LH(&rlink->owning_addr->rlinks, rlink);
+ oaddr = rlink->owning_addr;
}
+ //
+ // If this is an outgoing inter-router link, we must remove the by-mask-bit
+ // index reference to this link.
+ //
+ if (rlink->link_type == DX_LINK_ROUTER && rlink->link_direction == DX_OUTGOING) {
+ if (router->out_links_by_mask_bit[rlink->mask_bit] == rlink)
+ router->out_links_by_mask_bit[rlink->mask_bit] = 0;
+ else
+ dx_log(module, LOG_CRITICAL, "Outgoing router link closing but not in index: bit=%d", rlink->mask_bit);
+ }
+
+ //
+ // If this is an incoming inter-router link, we must free the mask_bit.
+ //
+ if (rlink->link_type == DX_LINK_ROUTER && rlink->link_direction == DX_INCOMING)
+ dx_bitmask_set_bit(router->neighbor_free_mask, rlink->mask_bit);
+
+ //
+ // Remove the link from the master list-of-links.
+ //
+ DEQ_REMOVE(router->links, rlink);
sys_mutex_unlock(router->lock);
+
+ //
+ // Check to see if the owning address should be deleted
+ //
+ dx_router_check_addr(router, oaddr, 1);
+
+ // TODO - wrap the free to handle the recursive items
+ free_dx_router_link_t(rlink);
+
return 0;
}
@@ -679,28 +972,47 @@ static void router_inbound_open_handler(void *type_context, dx_connection_t *con
static void router_outbound_open_handler(void *type_context, dx_connection_t *conn)
{
- // TODO - Make sure this connection is annotated as an inter-router transport.
- // Ignore otherwise
+ //
+ // Check the configured role of this connection. If it is not the inter-router
+ // role, ignore it.
+ //
+ if (!dx_router_connection_is_inter_router(conn)) {
+ dx_log(module, LOG_WARNING, "Outbound connection set up without inter-router role");
+ return;
+ }
dx_router_t *router = (dx_router_t*) type_context;
- dx_field_iterator_t *aiter = dx_field_iterator_string(router_address, ITER_VIEW_ADDRESS_HASH);
dx_link_t *sender;
dx_link_t *receiver;
dx_router_link_t *rlink;
+ int mask_bit = 0;
+ size_t clen = strlen(DX_CAPABILITY_ROUTER);
//
- // Create an incoming link and put it in the in-links collection. The address
- // of the remote source of this link is '_local/qdxrouter'.
+ // Allocate a mask bit to designate the pair of links connected to the neighbor router
//
- receiver = dx_link(router->node, conn, DX_INCOMING, "inter-router-rx");
- pn_terminus_set_address(dx_link_remote_source(receiver), router_address);
- pn_terminus_set_address(dx_link_target(receiver), router_address);
+ sys_mutex_lock(router->lock);
+ if (dx_bitmask_first_set(router->neighbor_free_mask, &mask_bit)) {
+ dx_bitmask_clear_bit(router->neighbor_free_mask, mask_bit);
+ } else {
+ sys_mutex_unlock(router->lock);
+ dx_log(module, LOG_CRITICAL, "Exceeded maximum inter-router link count");
+ return;
+ }
- rlink = new_dx_router_link_t();
+ //
+ // Create an incoming link with router source capability
+ //
+ receiver = dx_link(router->node, conn, DX_INCOMING, DX_INTERNODE_LINK_NAME_1);
+ // TODO - We don't want to have to cast away the constness of the literal string here!
+ // See PROTON-429
+ pn_data_put_symbol(pn_terminus_capabilities(dx_link_target(receiver)), pn_bytes(clen, (char*) DX_CAPABILITY_ROUTER));
+ rlink = new_dx_router_link_t();
DEQ_ITEM_INIT(rlink);
- rlink->link_direction = DX_INCOMING;
+ rlink->mask_bit = mask_bit;
rlink->link_type = DX_LINK_ROUTER;
+ rlink->link_direction = DX_INCOMING;
rlink->owning_addr = 0;
rlink->link = receiver;
rlink->connected_link = 0;
@@ -709,53 +1021,46 @@ static void router_outbound_open_handler(void *type_context, dx_connection_t *co
DEQ_INIT(rlink->msg_fifo);
dx_link_set_context(receiver, rlink);
-
- sys_mutex_lock(router->lock);
- DEQ_INSERT_TAIL(router->in_links, rlink);
- sys_mutex_unlock(router->lock);
+ DEQ_INSERT_TAIL(router->links, rlink);
//
- // Create an outgoing link with a local source of '_local/qdxrouter' and place
- // it in the routing table.
+ // Create an outgoing link with router target capability
//
- sender = dx_link(router->node, conn, DX_OUTGOING, "inter-router-tx");
- pn_terminus_set_address(dx_link_remote_target(sender), router_address);
- pn_terminus_set_address(dx_link_source(sender), router_address);
+ sender = dx_link(router->node, conn, DX_OUTGOING, DX_INTERNODE_LINK_NAME_2);
+ // TODO - We don't want to have to cast away the constness of the literal string here!
+ // See PROTON-429
+ pn_data_put_symbol(pn_terminus_capabilities(dx_link_source(sender)), pn_bytes(clen, (char *) DX_CAPABILITY_ROUTER));
rlink = new_dx_router_link_t();
-
DEQ_ITEM_INIT(rlink);
- rlink->link_direction = DX_OUTGOING;
+ rlink->mask_bit = mask_bit;
rlink->link_type = DX_LINK_ROUTER;
+ rlink->link_direction = DX_OUTGOING;
+ rlink->owning_addr = router->hello_addr;
rlink->link = sender;
rlink->connected_link = 0;
rlink->peer_link = 0;
DEQ_INIT(rlink->event_fifo);
DEQ_INIT(rlink->msg_fifo);
- dx_link_set_context(sender, rlink);
-
- dx_address_t *addr;
+ //
+ // Add the new outgoing link to the hello_address's list of links.
+ //
+ dx_router_add_link_ref_LH(&router->hello_addr->rlinks, rlink);
- sys_mutex_lock(router->lock);
- hash_retrieve(router->out_hash, aiter, (void**) &addr);
- if (!addr) {
- addr = new_dx_address_t();
- addr->handler = 0;
- addr->handler_context = 0;
- DEQ_INIT(addr->rlinks);
- DEQ_INIT(addr->rnodes);
- hash_insert(router->out_hash, aiter, addr);
- }
+ //
+ // Index this link from the by-maskbit index so we can later find it quickly
+ // when provided with the mask bit.
+ //
+ router->out_links_by_mask_bit[mask_bit] = rlink;
- rlink->owning_addr = addr;
- DEQ_INSERT_TAIL(addr->rlinks, rlink);
+ dx_link_set_context(sender, rlink);
+ DEQ_INSERT_TAIL(router->links, rlink);
sys_mutex_unlock(router->lock);
pn_link_open(dx_link_pn(receiver));
pn_link_open(dx_link_pn(sender));
pn_link_flow(dx_link_pn(receiver), 1000);
- dx_field_iterator_free(aiter);
}
@@ -767,7 +1072,6 @@ static void dx_router_timer_handler(void *context)
// Periodic processing.
//
dx_pyrouter_tick(router);
-
dx_timer_schedule(router->timer, 1000);
}
@@ -786,31 +1090,61 @@ static dx_node_type_t router_node = {"router", 0, 0,
static int type_registered = 0;
-dx_router_t *dx_router(dx_dispatch_t *dx, const char *area, const char *id)
+dx_router_t *dx_router(dx_dispatch_t *dx, dx_router_mode_t mode, const char *area, const char *id)
{
if (!type_registered) {
type_registered = 1;
dx_container_register_node_type(dx, &router_node);
}
+ size_t dplen = 9 + strlen(area) + strlen(id);
+ direct_prefix = (char*) malloc(dplen);
+ strcpy(direct_prefix, "_topo/");
+ strcat(direct_prefix, area);
+ strcat(direct_prefix, "/");
+ strcat(direct_prefix, id);
+ strcat(direct_prefix, "/");
+
dx_router_t *router = NEW(dx_router_t);
router_node.type_context = router;
+ dx->router = router;
router->dx = dx;
+ router->router_mode = mode;
router->router_area = area;
router->router_id = id;
router->node = dx_container_set_default_node_type(dx, &router_node, (void*) router, DX_DIST_BOTH);
- DEQ_INIT(router->in_links);
+ DEQ_INIT(router->addrs);
+ router->addr_hash = dx_hash(10, 32, 0);
+
+ DEQ_INIT(router->links);
DEQ_INIT(router->routers);
- DEQ_INIT(router->in_fifo);
- router->lock = sys_mutex();
- router->timer = dx_timer(dx, dx_router_timer_handler, (void*) router);
- router->out_hash = hash(10, 32, 0);
- router->dtag = 1;
- router->pyRouter = 0;
- router->pyTick = 0;
+ router->out_links_by_mask_bit = NEW_PTR_ARRAY(dx_router_link_t, dx_bitmask_width());
+ router->routers_by_mask_bit = NEW_PTR_ARRAY(dx_router_node_t, dx_bitmask_width());
+ for (int idx = 0; idx < dx_bitmask_width(); idx++) {
+ router->out_links_by_mask_bit[idx] = 0;
+ router->routers_by_mask_bit[idx] = 0;
+ }
+
+ router->neighbor_free_mask = dx_bitmask(1);
+ router->lock = sys_mutex();
+ router->timer = dx_timer(dx, dx_router_timer_handler, (void*) router);
+ router->dtag = 1;
+ router->pyRouter = 0;
+ router->pyTick = 0;
+ router->pyAdded = 0;
+ router->pyRemoved = 0;
+
+ //
+ // Create addresses for all of the routers in the topology. It will be registered
+ // locally later in the initialization sequence.
+ //
+ if (router->router_mode == DX_ROUTER_MODE_INTERIOR) {
+ router->router_addr = dx_router_register_address(dx, "qdxrouter", 0, 0);
+ router->hello_addr = dx_router_register_address(dx, "qdxhello", 0, 0);
+ }
//
// Inform the field iterator module of this router's id and area. The field iterator
@@ -823,18 +1157,21 @@ dx_router_t *dx_router(dx_dispatch_t *dx, const char *area, const char *id)
//
dx_python_start();
- dx_log(module, LOG_INFO, "Router started, area=%s id=%s", area, id);
+ switch (router->router_mode) {
+ case DX_ROUTER_MODE_STANDALONE: dx_log(module, LOG_INFO, "Router started in Standalone mode"); break;
+ case DX_ROUTER_MODE_INTERIOR: dx_log(module, LOG_INFO, "Router started in Interior mode, area=%s id=%s", area, id); break;
+ case DX_ROUTER_MODE_EDGE: dx_log(module, LOG_INFO, "Router started in Edge mode"); break;
+ }
return router;
}
-void dx_router_setup_agent(dx_dispatch_t *dx)
+void dx_router_setup_late(dx_dispatch_t *dx)
{
+ dx_router_agent_setup(dx->router);
dx_router_python_setup(dx->router);
dx_timer_schedule(dx->router->timer, 1000);
-
- // TODO
}
@@ -849,8 +1186,7 @@ void dx_router_free(dx_router_t *router)
const char *dx_router_id(const dx_dispatch_t *dx)
{
- dx_router_t *router = dx->router;
- return router->router_id;
+ return direct_prefix;
}
@@ -869,14 +1205,16 @@ dx_address_t *dx_router_register_address(dx_dispatch_t *dx,
iter = dx_field_iterator_string(addr_string, ITER_VIEW_NO_HOST);
sys_mutex_lock(router->lock);
- hash_retrieve(router->out_hash, iter, (void**) &addr);
+ dx_hash_retrieve(router->addr_hash, iter, (void**) &addr);
if (!addr) {
addr = new_dx_address_t();
- addr->handler = 0;
- addr->handler_context = 0;
+ memset(addr, 0, sizeof(dx_address_t));
+ DEQ_ITEM_INIT(addr);
DEQ_INIT(addr->rlinks);
DEQ_INIT(addr->rnodes);
- hash_insert(router->out_hash, iter, addr);
+ dx_hash_insert(router->addr_hash, iter, addr, &addr->hash_handle);
+ DEQ_ITEM_INIT(addr);
+ DEQ_INSERT_TAIL(router->addrs, addr);
}
dx_field_iterator_free(iter);
@@ -885,7 +1223,8 @@ dx_address_t *dx_router_register_address(dx_dispatch_t *dx,
sys_mutex_unlock(router->lock);
- dx_log(module, LOG_TRACE, "In-Process Address Registered: %s", address);
+ if (handler)
+ dx_log(module, LOG_INFO, "In-Process Address Registered: %s", address);
return addr;
}
@@ -905,34 +1244,49 @@ void dx_router_send(dx_dispatch_t *dx,
dx_field_iterator_reset_view(address, ITER_VIEW_ADDRESS_HASH);
sys_mutex_lock(router->lock);
- hash_retrieve(router->out_hash, address, (void*) &addr);
+ dx_hash_retrieve(router->addr_hash, address, (void*) &addr);
if (addr) {
//
// Forward to all of the local links receiving this address.
//
- dx_router_link_t *dest_link = DEQ_HEAD(addr->rlinks);
- while (dest_link) {
+ addr->deliveries_from_container++;
+ dx_router_link_ref_t *dest_link_ref = DEQ_HEAD(addr->rlinks);
+ while (dest_link_ref) {
dx_routed_event_t *re = new_dx_routed_event_t();
DEQ_ITEM_INIT(re);
re->delivery = 0;
re->message = dx_message_copy(msg);
re->settle = 0;
re->disposition = 0;
- DEQ_INSERT_TAIL(dest_link->msg_fifo, re);
+ DEQ_INSERT_TAIL(dest_link_ref->link->msg_fifo, re);
- dx_link_activate(dest_link->link);
- dest_link = DEQ_NEXT(dest_link);
+ dx_link_activate(dest_link_ref->link->link);
+ addr->deliveries_egress++;
+
+ dest_link_ref = DEQ_NEXT(dest_link_ref);
}
//
// Forward to the next-hops for remote destinations.
//
- dx_router_node_t *dest_node = DEQ_HEAD(addr->rnodes);
- while (dest_node) {
- if (dest_node->next_hop)
- dest_link = dest_node->next_hop->peer_link;
+ dx_router_ref_t *dest_node_ref = DEQ_HEAD(addr->rnodes);
+ dx_router_link_t *dest_link;
+ dx_bitmask_t *link_set = dx_bitmask(0);
+
+ while (dest_node_ref) {
+ if (dest_node_ref->router->next_hop)
+ dest_link = dest_node_ref->router->next_hop->peer_link;
else
- dest_link = dest_node->peer_link;
+ dest_link = dest_node_ref->router->peer_link;
+ if (dest_link)
+ dx_bitmask_set_bit(link_set, dest_link->mask_bit);
+ dest_node_ref = DEQ_NEXT(dest_node_ref);
+ }
+
+ int link_bit;
+ while (dx_bitmask_first_set(link_set, &link_bit)) {
+ dx_bitmask_clear_bit(link_set, link_bit);
+ dest_link = router->out_links_by_mask_bit[link_bit];
if (dest_link) {
dx_routed_event_t *re = new_dx_routed_event_t();
DEQ_ITEM_INIT(re);
@@ -942,9 +1296,11 @@ void dx_router_send(dx_dispatch_t *dx,
re->disposition = 0;
DEQ_INSERT_TAIL(dest_link->msg_fifo, re);
dx_link_activate(dest_link->link);
+ addr->deliveries_transit++;
}
- dest_node = DEQ_NEXT(dest_node);
}
+
+ dx_bitmask_free(link_set);
}
sys_mutex_unlock(router->lock); // TOINVESTIGATE Move this higher?
}
@@ -959,222 +1315,3 @@ void dx_router_send2(dx_dispatch_t *dx,
dx_field_iterator_free(iter);
}
-
-//===============================================================================
-// Python Router Adapter
-//===============================================================================
-
-typedef struct {
- PyObject_HEAD
- dx_router_t *router;
-} RouterAdapter;
-
-
-static PyObject* dx_router_node_updated(PyObject *self, PyObject *args)
-{
- //RouterAdapter *adapter = (RouterAdapter*) self;
- //dx_router_t *router = adapter->router;
- const char *address;
- int is_reachable;
- int is_neighbor;
-
- if (!PyArg_ParseTuple(args, "sii", &address, &is_reachable, &is_neighbor))
- return 0;
-
- // TODO
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyObject* dx_router_add_route(PyObject *self, PyObject *args)
-{
- //RouterAdapter *adapter = (RouterAdapter*) self;
- const char *addr;
- const char *peer;
-
- if (!PyArg_ParseTuple(args, "ss", &addr, &peer))
- return 0;
-
- // TODO
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyObject* dx_router_del_route(PyObject *self, PyObject *args)
-{
- //RouterAdapter *adapter = (RouterAdapter*) self;
- const char *addr;
- const char *peer;
-
- if (!PyArg_ParseTuple(args, "ss", &addr, &peer))
- return 0;
-
- // TODO
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyMethodDef RouterAdapter_methods[] = {
- {"node_updated", dx_router_node_updated, METH_VARARGS, "Update the status of a remote router node"},
- {"add_route", dx_router_add_route, METH_VARARGS, "Add a newly discovered route"},
- {"del_route", dx_router_del_route, METH_VARARGS, "Delete a route"},
- {0, 0, 0, 0}
-};
-
-static PyTypeObject RouterAdapterType = {
- PyObject_HEAD_INIT(0)
- 0, /* ob_size*/
- "dispatch.RouterAdapter", /* tp_name*/
- sizeof(RouterAdapter), /* tp_basicsize*/
- 0, /* tp_itemsize*/
- 0, /* tp_dealloc*/
- 0, /* tp_print*/
- 0, /* tp_getattr*/
- 0, /* tp_setattr*/
- 0, /* tp_compare*/
- 0, /* tp_repr*/
- 0, /* tp_as_number*/
- 0, /* tp_as_sequence*/
- 0, /* tp_as_mapping*/
- 0, /* tp_hash */
- 0, /* tp_call*/
- 0, /* tp_str*/
- 0, /* tp_getattro*/
- 0, /* tp_setattro*/
- 0, /* tp_as_buffer*/
- Py_TPFLAGS_DEFAULT, /* tp_flags*/
- "Dispatch Router Adapter", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- RouterAdapter_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0, /* tp_free */
- 0, /* tp_is_gc */
- 0, /* tp_bases */
- 0, /* tp_mro */
- 0, /* tp_cache */
- 0, /* tp_subclasses */
- 0, /* tp_weaklist */
- 0, /* tp_del */
- 0 /* tp_version_tag */
-};
-
-
-static void dx_router_python_setup(dx_router_t *router)
-{
- PyObject *pDispatchModule = dx_python_module();
-
- RouterAdapterType.tp_new = PyType_GenericNew;
- if (PyType_Ready(&RouterAdapterType) < 0) {
- PyErr_Print();
- dx_log(module, LOG_CRITICAL, "Unable to initialize the Python Router Adapter");
- return;
- }
-
- Py_INCREF(&RouterAdapterType);
- PyModule_AddObject(pDispatchModule, "RouterAdapter", (PyObject*) &RouterAdapterType);
-
- //
- // Attempt to import the Python Router module
- //
- PyObject* pName;
- PyObject* pId;
- PyObject* pArea;
- PyObject* pModule;
- PyObject* pClass;
- PyObject* pArgs;
-
- pName = PyString_FromString("qpid.dispatch.router");
- pModule = PyImport_Import(pName);
- Py_DECREF(pName);
- if (!pModule) {
- dx_log(module, LOG_CRITICAL, "Can't Locate 'router' Python module");
- return;
- }
-
- pClass = PyObject_GetAttrString(pModule, "RouterEngine");
- if (!pClass || !PyClass_Check(pClass)) {
- dx_log(module, LOG_CRITICAL, "Can't Locate 'RouterEngine' class in the 'router' module");
- return;
- }
-
- PyObject *adapterType = PyObject_GetAttrString(pDispatchModule, "RouterAdapter");
- PyObject *adapterInstance = PyObject_CallObject(adapterType, 0);
- assert(adapterInstance);
-
- ((RouterAdapter*) adapterInstance)->router = router;
-
- //
- // Constructor Arguments for RouterEngine
- //
- pArgs = PyTuple_New(3);
-
- // arg 0: adapter instance
- PyTuple_SetItem(pArgs, 0, adapterInstance);
-
- // arg 1: router_id
- pId = PyString_FromString(router->router_id);
- PyTuple_SetItem(pArgs, 1, pId);
-
- // arg 2: area id
- pArea = PyString_FromString(router->router_area);
- PyTuple_SetItem(pArgs, 2, pArea);
-
- //
- // Instantiate the router
- //
- router->pyRouter = PyInstance_New(pClass, pArgs, 0);
- Py_DECREF(pArgs);
- Py_DECREF(adapterType);
-
- if (!router->pyRouter) {
- PyErr_Print();
- dx_log(module, LOG_CRITICAL, "'RouterEngine' class cannot be instantiated");
- return;
- }
-
- router->pyTick = PyObject_GetAttrString(router->pyRouter, "handleTimerTick");
- if (!router->pyTick || !PyCallable_Check(router->pyTick)) {
- dx_log(module, LOG_CRITICAL, "'RouterEngine' class has no handleTimerTick method");
- return;
- }
-}
-
-
-static void dx_pyrouter_tick(dx_router_t *router)
-{
- PyObject *pArgs;
- PyObject *pValue;
-
- if (router->pyTick) {
- pArgs = PyTuple_New(0);
- pValue = PyObject_CallObject(router->pyTick, pArgs);
- if (PyErr_Occurred()) {
- PyErr_Print();
- }
- Py_DECREF(pArgs);
- if (pValue) {
- Py_DECREF(pValue);
- }
- }
-}
-
diff --git a/qpid/extras/dispatch/src/router_private.h b/qpid/extras/dispatch/src/router_private.h
new file mode 100644
index 0000000000..066188b3f7
--- /dev/null
+++ b/qpid/extras/dispatch/src/router_private.h
@@ -0,0 +1,177 @@
+#ifndef __router_private_h__
+#define __router_private_h__ 1
+/*
+ * 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.
+ */
+
+typedef struct dx_router_link_t dx_router_link_t;
+typedef struct dx_router_node_t dx_router_node_t;
+typedef struct dx_router_ref_t dx_router_ref_t;
+typedef struct dx_router_link_ref_t dx_router_link_ref_t;
+typedef struct dx_router_conn_t dx_router_conn_t;
+
+void dx_router_python_setup(dx_router_t *router);
+void dx_pyrouter_tick(dx_router_t *router);
+void dx_router_agent_setup(dx_router_t *router);
+
+typedef enum {
+ DX_ROUTER_MODE_STANDALONE, // Standalone router. No routing protocol participation
+ DX_ROUTER_MODE_INTERIOR, // Interior router. Full participation in routing protocol.
+ DX_ROUTER_MODE_EDGE // Edge router. No routing protocol participation, access via other protocols.
+} dx_router_mode_t;
+
+typedef enum {
+ DX_LINK_ENDPOINT, // A link to a connected endpoint
+ DX_LINK_ROUTER, // A link to a peer router in the same area
+ DX_LINK_AREA // A link to a peer router in a different area (area boundary)
+} dx_link_type_t;
+
+
+typedef struct dx_routed_event_t {
+ DEQ_LINKS(struct dx_routed_event_t);
+ dx_delivery_t *delivery;
+ dx_message_t *message;
+ bool settle;
+ uint64_t disposition;
+} dx_routed_event_t;
+
+ALLOC_DECLARE(dx_routed_event_t);
+DEQ_DECLARE(dx_routed_event_t, dx_routed_event_list_t);
+
+
+struct dx_router_link_t {
+ DEQ_LINKS(dx_router_link_t);
+ int mask_bit; // Unique mask bit if this is an inter-router link
+ dx_link_type_t link_type;
+ dx_direction_t link_direction;
+ dx_address_t *owning_addr; // [ref] Address record that owns this link
+ dx_link_t *link; // [own] Link pointer
+ dx_router_link_t *connected_link; // [ref] If this is a link-route, reference the connected link
+ dx_router_link_t *peer_link; // [ref] If this is a bidirectional link-route, reference the peer link
+ dx_router_link_ref_t *ref; // Pointer to a containing reference object
+ dx_routed_event_list_t event_fifo; // FIFO of outgoing delivery/link events (no messages)
+ dx_routed_event_list_t msg_fifo; // FIFO of outgoing message deliveries
+};
+
+ALLOC_DECLARE(dx_router_link_t);
+DEQ_DECLARE(dx_router_link_t, dx_router_link_list_t);
+
+struct dx_router_node_t {
+ DEQ_LINKS(dx_router_node_t);
+ dx_address_t *owning_addr;
+ int mask_bit;
+ dx_router_node_t *next_hop; // Next hop node _if_ this is not a neighbor node
+ dx_router_link_t *peer_link; // Outgoing link _if_ this is a neighbor node
+ uint32_t ref_count;
+ dx_bitmask_t *valid_origins;
+};
+
+ALLOC_DECLARE(dx_router_node_t);
+DEQ_DECLARE(dx_router_node_t, dx_router_node_list_t);
+
+struct dx_router_ref_t {
+ DEQ_LINKS(dx_router_ref_t);
+ dx_router_node_t *router;
+};
+
+ALLOC_DECLARE(dx_router_ref_t);
+DEQ_DECLARE(dx_router_ref_t, dx_router_ref_list_t);
+
+
+struct dx_router_link_ref_t {
+ DEQ_LINKS(dx_router_link_ref_t);
+ dx_router_link_t *link;
+};
+
+ALLOC_DECLARE(dx_router_link_ref_t);
+DEQ_DECLARE(dx_router_link_ref_t, dx_router_link_ref_list_t);
+
+
+struct dx_router_conn_t {
+ int mask_bit;
+};
+
+ALLOC_DECLARE(dx_router_conn_t);
+
+
+struct dx_address_t {
+ DEQ_LINKS(dx_address_t);
+ dx_router_message_cb handler; // In-Process Consumer
+ void *handler_context; // In-Process Consumer context
+ dx_router_link_ref_list_t rlinks; // Locally-Connected Consumers
+ dx_router_ref_list_t rnodes; // Remotely-Connected Consumers
+ dx_hash_handle_t *hash_handle; // Linkage back to the hash table entry
+
+ uint64_t deliveries_ingress;
+ uint64_t deliveries_egress;
+ uint64_t deliveries_transit;
+ uint64_t deliveries_to_container;
+ uint64_t deliveries_from_container;
+};
+
+ALLOC_DECLARE(dx_address_t);
+DEQ_DECLARE(dx_address_t, dx_address_list_t);
+
+
+struct dx_router_t {
+ dx_dispatch_t *dx;
+ dx_router_mode_t router_mode;
+ const char *router_area;
+ const char *router_id;
+ dx_node_t *node;
+
+ dx_address_list_t addrs;
+ dx_hash_t *addr_hash;
+ dx_address_t *router_addr;
+ dx_address_t *hello_addr;
+
+ dx_router_link_list_t links;
+ dx_router_node_list_t routers;
+ dx_router_link_t **out_links_by_mask_bit;
+ dx_router_node_t **routers_by_mask_bit;
+
+ dx_bitmask_t *neighbor_free_mask;
+ sys_mutex_t *lock;
+ dx_timer_t *timer;
+ uint64_t dtag;
+
+ PyObject *pyRouter;
+ PyObject *pyTick;
+ PyObject *pyAdded;
+ PyObject *pyRemoved;
+
+ dx_agent_class_t *class_router;
+ dx_agent_class_t *class_link;
+ dx_agent_class_t *class_node;
+ dx_agent_class_t *class_address;
+};
+
+
+
+void dx_router_check_addr(dx_router_t *router, dx_address_t *addr, int was_local);
+void dx_router_add_link_ref_LH(dx_router_link_ref_list_t *ref_list, dx_router_link_t *link);
+void dx_router_del_link_ref_LH(dx_router_link_ref_list_t *ref_list, dx_router_link_t *link);
+
+void dx_router_add_node_ref_LH(dx_router_ref_list_t *ref_list, dx_router_node_t *rnode);
+void dx_router_del_node_ref_LH(dx_router_ref_list_t *ref_list, dx_router_node_t *rnode);
+
+void dx_router_mobile_added(dx_router_t *router, dx_field_iterator_t *iter);
+void dx_router_mobile_removed(dx_router_t *router, const char *addr);
+
+
+#endif
diff --git a/qpid/extras/dispatch/src/router_pynode.c b/qpid/extras/dispatch/src/router_pynode.c
new file mode 100644
index 0000000000..82b08c0785
--- /dev/null
+++ b/qpid/extras/dispatch/src/router_pynode.c
@@ -0,0 +1,682 @@
+/*
+ * 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/dispatch/python_embedded.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <qpid/dispatch.h>
+#include "dispatch_private.h"
+#include "router_private.h"
+
+static char *module = "router.pynode";
+
+typedef struct {
+ PyObject_HEAD
+ dx_router_t *router;
+} RouterAdapter;
+
+
+static char *dx_add_router(dx_router_t *router, const char *address, int router_maskbit, int link_maskbit)
+{
+ if (router_maskbit >= dx_bitmask_width() || router_maskbit < 0)
+ return "Router bit mask out of range";
+
+ if (link_maskbit >= dx_bitmask_width() || link_maskbit < -1)
+ return "Link bit mask out of range";
+
+ sys_mutex_lock(router->lock);
+ if (router->routers_by_mask_bit[router_maskbit] != 0) {
+ sys_mutex_unlock(router->lock);
+ return "Adding router over already existing router";
+ }
+
+ if (link_maskbit >= 0 && router->out_links_by_mask_bit[link_maskbit] == 0) {
+ sys_mutex_unlock(router->lock);
+ return "Adding neighbor router with invalid link reference";
+ }
+
+ //
+ // Hash lookup the address to ensure there isn't an existing router address.
+ //
+ dx_field_iterator_t *iter = dx_field_iterator_string(address, ITER_VIEW_ADDRESS_HASH);
+ dx_address_t *addr;
+
+ dx_hash_retrieve(router->addr_hash, iter, (void**) &addr);
+ assert(addr == 0);
+
+ //
+ // Create an address record for this router and insert it in the hash table.
+ // This record will be found whenever a "foreign" topological address to this
+ // remote router is looked up.
+ //
+ addr = new_dx_address_t();
+ memset(addr, 0, sizeof(dx_address_t));
+ DEQ_ITEM_INIT(addr);
+ DEQ_INIT(addr->rlinks);
+ DEQ_INIT(addr->rnodes);
+ dx_hash_insert(router->addr_hash, iter, addr, &addr->hash_handle);
+ DEQ_INSERT_TAIL(router->addrs, addr);
+ dx_field_iterator_free(iter);
+
+ //
+ // Create a router-node record to represent the remote router.
+ //
+ dx_router_node_t *rnode = new_dx_router_node_t();
+ DEQ_ITEM_INIT(rnode);
+ rnode->owning_addr = addr;
+ rnode->mask_bit = router_maskbit;
+ rnode->next_hop = 0;
+ rnode->peer_link = 0;
+ rnode->ref_count = 0;
+ rnode->valid_origins = dx_bitmask(0);
+
+ DEQ_INSERT_TAIL(router->routers, rnode);
+
+ //
+ // Link the router record to the address record.
+ //
+ dx_router_add_node_ref_LH(&addr->rnodes, rnode);
+
+ //
+ // Link the router record to the router address record.
+ //
+ dx_router_add_node_ref_LH(&router->router_addr->rnodes, rnode);
+
+ //
+ // Add the router record to the mask-bit index.
+ //
+ router->routers_by_mask_bit[router_maskbit] = rnode;
+
+ //
+ // If this is a neighbor router, add the peer_link reference to the
+ // router record.
+ //
+ if (link_maskbit >= 0)
+ rnode->peer_link = router->out_links_by_mask_bit[link_maskbit];
+
+ sys_mutex_unlock(router->lock);
+ return 0;
+}
+
+
+static char *dx_del_router(dx_router_t *router, int router_maskbit)
+{
+ if (router_maskbit >= dx_bitmask_width() || router_maskbit < 0)
+ return "Router bit mask out of range";
+
+ sys_mutex_lock(router->lock);
+ if (router->routers_by_mask_bit[router_maskbit] == 0) {
+ sys_mutex_unlock(router->lock);
+ return "Deleting nonexistent router";
+ }
+
+ dx_router_node_t *rnode = router->routers_by_mask_bit[router_maskbit];
+ dx_address_t *oaddr = rnode->owning_addr;
+ assert(oaddr);
+
+ //
+ // Unlink the router node from the address record
+ //
+ dx_router_del_node_ref_LH(&oaddr->rnodes, rnode);
+
+ //
+ // While the router node has a non-zero reference count, look for addresses
+ // to unlink the node from.
+ //
+ dx_address_t *addr = DEQ_HEAD(router->addrs);
+ while (addr && rnode->ref_count > 0) {
+ dx_router_del_node_ref_LH(&addr->rnodes, rnode);
+ addr = DEQ_NEXT(addr);
+ }
+ assert(rnode->ref_count == 0);
+
+ //
+ // Free the router node and the owning address records.
+ //
+ dx_bitmask_free(rnode->valid_origins);
+ DEQ_REMOVE(router->routers, rnode);
+ free_dx_router_node_t(rnode);
+
+ dx_hash_remove_by_handle(router->addr_hash, oaddr->hash_handle);
+ DEQ_REMOVE(router->addrs, oaddr);
+ dx_hash_handle_free(oaddr->hash_handle);
+ router->routers_by_mask_bit[router_maskbit] = 0;
+ free_dx_address_t(oaddr);
+
+ sys_mutex_unlock(router->lock);
+ return 0;
+}
+
+
+static PyObject* dx_add_remote_router(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ const char *address;
+ int router_maskbit;
+
+ if (!PyArg_ParseTuple(args, "si", &address, &router_maskbit))
+ return 0;
+
+ char *error = dx_add_router(router, address, router_maskbit, -1);
+ if (error) {
+ PyErr_SetString(PyExc_Exception, error);
+ return 0;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_del_remote_router(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ int router_maskbit;
+
+ if (!PyArg_ParseTuple(args, "i", &router_maskbit))
+ return 0;
+
+ char *error = dx_del_router(router, router_maskbit);
+ if (error) {
+ PyErr_SetString(PyExc_Exception, error);
+ return 0;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_set_next_hop(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ int router_maskbit;
+ int next_hop_maskbit;
+
+ if (!PyArg_ParseTuple(args, "ii", &router_maskbit, &next_hop_maskbit))
+ return 0;
+
+ if (router_maskbit >= dx_bitmask_width() || router_maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Router bit mask out of range");
+ return 0;
+ }
+
+ if (next_hop_maskbit >= dx_bitmask_width() || next_hop_maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Next Hop bit mask out of range");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[router_maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Router Not Found");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[next_hop_maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Next Hop Not Found");
+ return 0;
+ }
+
+ if (router_maskbit != next_hop_maskbit) {
+ dx_router_node_t *rnode = router->routers_by_mask_bit[router_maskbit];
+ rnode->next_hop = router->routers_by_mask_bit[next_hop_maskbit];
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_set_valid_origins(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ int router_maskbit;
+ PyObject *origin_list;
+ Py_ssize_t idx;
+
+ if (!PyArg_ParseTuple(args, "iO", &router_maskbit, &origin_list))
+ return 0;
+
+ if (router_maskbit >= dx_bitmask_width() || router_maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Router bit mask out of range");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[router_maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Router Not Found");
+ return 0;
+ }
+
+ if (!PyList_Check(origin_list)) {
+ PyErr_SetString(PyExc_Exception, "Expected List as argument 2");
+ return 0;
+ }
+
+ Py_ssize_t origin_count = PyList_Size(origin_list);
+ dx_router_node_t *rnode = router->routers_by_mask_bit[router_maskbit];
+ int maskbit;
+
+ for (idx = 0; idx < origin_count; idx++) {
+ maskbit = PyInt_AS_LONG(PyList_GetItem(origin_list, idx));
+
+ if (maskbit >= dx_bitmask_width() || maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Origin bit mask out of range");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Origin router Not Found");
+ return 0;
+ }
+ }
+
+ dx_bitmask_clear_all(rnode->valid_origins);
+ dx_bitmask_set_bit(rnode->valid_origins, 0); // This router is a valid origin for all destinations
+ for (idx = 0; idx < origin_count; idx++) {
+ maskbit = PyInt_AS_LONG(PyList_GetItem(origin_list, idx));
+ dx_bitmask_set_bit(rnode->valid_origins, maskbit);
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_add_neighbor_router(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ const char *address;
+ int router_maskbit;
+ int link_maskbit;
+
+ if (!PyArg_ParseTuple(args, "sii", &address, &router_maskbit, &link_maskbit))
+ return 0;
+
+ char *error = dx_add_router(router, address, router_maskbit, link_maskbit);
+ if (error) {
+ PyErr_SetString(PyExc_Exception, error);
+ return 0;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_del_neighbor_router(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ int router_maskbit;
+
+ if (!PyArg_ParseTuple(args, "i", &router_maskbit))
+ return 0;
+
+ char *error = dx_del_router(router, router_maskbit);
+ if (error) {
+ PyErr_SetString(PyExc_Exception, error);
+ return 0;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_map_destination(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ const char *addr_string;
+ int maskbit;
+ dx_address_t *addr;
+ dx_field_iterator_t *iter;
+
+ if (!PyArg_ParseTuple(args, "si", &addr_string, &maskbit))
+ return 0;
+
+ if (maskbit >= dx_bitmask_width() || maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Router bit mask out of range");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Router Not Found");
+ return 0;
+ }
+
+ iter = dx_field_iterator_string(addr_string, ITER_VIEW_ADDRESS_HASH);
+
+ sys_mutex_lock(router->lock);
+ dx_hash_retrieve(router->addr_hash, iter, (void**) &addr);
+ if (!addr) {
+ addr = new_dx_address_t();
+ memset(addr, 0, sizeof(dx_address_t));
+ DEQ_ITEM_INIT(addr);
+ DEQ_INIT(addr->rlinks);
+ DEQ_INIT(addr->rnodes);
+ dx_hash_insert(router->addr_hash, iter, addr, &addr->hash_handle);
+ DEQ_ITEM_INIT(addr);
+ DEQ_INSERT_TAIL(router->addrs, addr);
+ }
+ dx_field_iterator_free(iter);
+
+ dx_router_node_t *rnode = router->routers_by_mask_bit[maskbit];
+ dx_router_add_node_ref_LH(&addr->rnodes, rnode);
+
+ sys_mutex_unlock(router->lock);
+
+ dx_log(module, LOG_DEBUG, "Remote Destination '%s' Mapped to router %d", addr_string, maskbit);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyObject* dx_unmap_destination(PyObject *self, PyObject *args)
+{
+ RouterAdapter *adapter = (RouterAdapter*) self;
+ dx_router_t *router = adapter->router;
+ const char *addr_string;
+ int maskbit;
+ dx_address_t *addr;
+
+ if (!PyArg_ParseTuple(args, "si", &addr_string, &maskbit))
+ return 0;
+
+ if (maskbit >= dx_bitmask_width() || maskbit < 0) {
+ PyErr_SetString(PyExc_Exception, "Router bit mask out of range");
+ return 0;
+ }
+
+ if (router->routers_by_mask_bit[maskbit] == 0) {
+ PyErr_SetString(PyExc_Exception, "Router Not Found");
+ return 0;
+ }
+
+ dx_router_node_t *rnode = router->routers_by_mask_bit[maskbit];
+ dx_field_iterator_t *iter = dx_field_iterator_string(addr_string, ITER_VIEW_ADDRESS_HASH);
+
+ sys_mutex_lock(router->lock);
+ dx_hash_retrieve(router->addr_hash, iter, (void**) &addr);
+ dx_field_iterator_free(iter);
+
+ if (!addr) {
+ PyErr_SetString(PyExc_Exception, "Address Not Found");
+ sys_mutex_unlock(router->lock);
+ return 0;
+ }
+
+ dx_router_del_node_ref_LH(&addr->rnodes, rnode);
+ sys_mutex_unlock(router->lock);
+
+ dx_router_check_addr(router, addr, 0);
+
+ dx_log(module, LOG_DEBUG, "Remote Destination '%s' Unmapped from router %d", addr_string, maskbit);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+static PyMethodDef RouterAdapter_methods[] = {
+ {"add_remote_router", dx_add_remote_router, METH_VARARGS, "A new remote/reachable router has been discovered"},
+ {"del_remote_router", dx_del_remote_router, METH_VARARGS, "We've lost reachability to a remote router"},
+ {"set_next_hop", dx_set_next_hop, METH_VARARGS, "Set the next hop for a remote router"},
+ {"set_valid_origins", dx_set_valid_origins, METH_VARARGS, "Set the valid origins for a remote router"},
+ {"add_neighbor_router", dx_add_neighbor_router, METH_VARARGS, "A new neighbor router has been discovered"},
+ {"del_neighbor_router", dx_del_neighbor_router, METH_VARARGS, "We've lost reachability to a neighbor router"},
+ {"map_destination", dx_map_destination, METH_VARARGS, "Add a newly discovered destination mapping"},
+ {"unmap_destination", dx_unmap_destination, METH_VARARGS, "Delete a destination mapping"},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject RouterAdapterType = {
+ PyObject_HEAD_INIT(0)
+ 0, /* ob_size*/
+ "dispatch.RouterAdapter", /* tp_name*/
+ sizeof(RouterAdapter), /* tp_basicsize*/
+ 0, /* tp_itemsize*/
+ 0, /* tp_dealloc*/
+ 0, /* tp_print*/
+ 0, /* tp_getattr*/
+ 0, /* tp_setattr*/
+ 0, /* tp_compare*/
+ 0, /* tp_repr*/
+ 0, /* tp_as_number*/
+ 0, /* tp_as_sequence*/
+ 0, /* tp_as_mapping*/
+ 0, /* tp_hash */
+ 0, /* tp_call*/
+ 0, /* tp_str*/
+ 0, /* tp_getattro*/
+ 0, /* tp_setattro*/
+ 0, /* tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /* tp_flags*/
+ "Dispatch Router Adapter", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ RouterAdapter_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+ 0 /* tp_version_tag */
+};
+
+
+void dx_router_python_setup(dx_router_t *router)
+{
+ //
+ // If we are not operating as an interior router, don't start the
+ // router module.
+ //
+ if (router->router_mode != DX_ROUTER_MODE_INTERIOR)
+ return;
+
+ PyObject *pDispatchModule = dx_python_module();
+
+ RouterAdapterType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&RouterAdapterType) < 0) {
+ PyErr_Print();
+ dx_log(module, LOG_CRITICAL, "Unable to initialize the Python Router Adapter");
+ return;
+ }
+
+ PyTypeObject *raType = &RouterAdapterType;
+ Py_INCREF(raType);
+ PyModule_AddObject(pDispatchModule, "RouterAdapter", (PyObject*) &RouterAdapterType);
+
+ //
+ // Attempt to import the Python Router module
+ //
+ PyObject* pName;
+ PyObject* pId;
+ PyObject* pArea;
+ PyObject* pMaxRouters;
+ PyObject* pModule;
+ PyObject* pClass;
+ PyObject* pArgs;
+
+ pName = PyString_FromString("qpid.dispatch.router");
+ pModule = PyImport_Import(pName);
+ Py_DECREF(pName);
+ if (!pModule) {
+ dx_log(module, LOG_CRITICAL, "Can't Locate 'router' Python module");
+ return;
+ }
+
+ pClass = PyObject_GetAttrString(pModule, "RouterEngine");
+ if (!pClass || !PyClass_Check(pClass)) {
+ dx_log(module, LOG_CRITICAL, "Can't Locate 'RouterEngine' class in the 'router' module");
+ return;
+ }
+
+ PyObject *adapterType = PyObject_GetAttrString(pDispatchModule, "RouterAdapter");
+ PyObject *adapterInstance = PyObject_CallObject(adapterType, 0);
+ assert(adapterInstance);
+
+ ((RouterAdapter*) adapterInstance)->router = router;
+
+ //
+ // Constructor Arguments for RouterEngine
+ //
+ pArgs = PyTuple_New(4);
+
+ // arg 0: adapter instance
+ PyTuple_SetItem(pArgs, 0, adapterInstance);
+
+ // arg 1: router_id
+ pId = PyString_FromString(router->router_id);
+ PyTuple_SetItem(pArgs, 1, pId);
+
+ // arg 2: area_id
+ pArea = PyString_FromString(router->router_area);
+ PyTuple_SetItem(pArgs, 2, pArea);
+
+ // arg 3: max_routers
+ pMaxRouters = PyInt_FromLong((long) dx_bitmask_width());
+ PyTuple_SetItem(pArgs, 3, pMaxRouters);
+
+ //
+ // Instantiate the router
+ //
+ router->pyRouter = PyInstance_New(pClass, pArgs, 0);
+ Py_DECREF(pArgs);
+ Py_DECREF(adapterType);
+
+ if (!router->pyRouter) {
+ PyErr_Print();
+ dx_log(module, LOG_CRITICAL, "'RouterEngine' class cannot be instantiated");
+ return;
+ }
+
+ router->pyTick = PyObject_GetAttrString(router->pyRouter, "handleTimerTick");
+ if (!router->pyTick || !PyCallable_Check(router->pyTick)) {
+ dx_log(module, LOG_CRITICAL, "'RouterEngine' class has no handleTimerTick method");
+ return;
+ }
+
+ router->pyAdded = PyObject_GetAttrString(router->pyRouter, "addressAdded");
+ if (!router->pyAdded || !PyCallable_Check(router->pyAdded)) {
+ dx_log(module, LOG_CRITICAL, "'RouterEngine' class has no addressAdded method");
+ return;
+ }
+
+ router->pyRemoved = PyObject_GetAttrString(router->pyRouter, "addressRemoved");
+ if (!router->pyRemoved || !PyCallable_Check(router->pyRemoved)) {
+ dx_log(module, LOG_CRITICAL, "'RouterEngine' class has no addressRemoved method");
+ return;
+ }
+}
+
+
+void dx_pyrouter_tick(dx_router_t *router)
+{
+ PyObject *pArgs;
+ PyObject *pValue;
+
+ if (router->pyTick && router->router_mode == DX_ROUTER_MODE_INTERIOR) {
+ dx_python_lock();
+ pArgs = PyTuple_New(0);
+ pValue = PyObject_CallObject(router->pyTick, pArgs);
+ if (PyErr_Occurred()) {
+ PyErr_Print();
+ }
+ Py_DECREF(pArgs);
+ if (pValue) {
+ Py_DECREF(pValue);
+ }
+ dx_python_unlock();
+ }
+}
+
+
+void dx_router_mobile_added(dx_router_t *router, dx_field_iterator_t *iter)
+{
+ PyObject *pArgs;
+ PyObject *pValue;
+
+ if (router->pyAdded && router->router_mode == DX_ROUTER_MODE_INTERIOR) {
+ dx_field_iterator_reset_view(iter, ITER_VIEW_ADDRESS_HASH);
+ char *address = (char*) dx_field_iterator_copy(iter);
+
+ dx_python_lock();
+ pArgs = PyTuple_New(1);
+ PyTuple_SetItem(pArgs, 0, PyString_FromString(address));
+ pValue = PyObject_CallObject(router->pyAdded, pArgs);
+ if (PyErr_Occurred()) {
+ PyErr_Print();
+ }
+ Py_DECREF(pArgs);
+ if (pValue) {
+ Py_DECREF(pValue);
+ }
+ dx_python_unlock();
+
+ free(address);
+ }
+}
+
+
+void dx_router_mobile_removed(dx_router_t *router, const char *address)
+{
+ PyObject *pArgs;
+ PyObject *pValue;
+
+ if (router->pyRemoved && router->router_mode == DX_ROUTER_MODE_INTERIOR) {
+ dx_python_lock();
+ pArgs = PyTuple_New(1);
+ PyTuple_SetItem(pArgs, 0, PyString_FromString(address));
+ pValue = PyObject_CallObject(router->pyRemoved, pArgs);
+ if (PyErr_Occurred()) {
+ PyErr_Print();
+ }
+ Py_DECREF(pArgs);
+ if (pValue) {
+ Py_DECREF(pValue);
+ }
+ dx_python_unlock();
+ }
+}
+
diff --git a/qpid/extras/dispatch/src/server.c b/qpid/extras/dispatch/src/server.c
index 5420d3b776..65e181bd2c 100644
--- a/qpid/extras/dispatch/src/server.c
+++ b/qpid/extras/dispatch/src/server.c
@@ -109,6 +109,8 @@ static void thread_process_listeners(dx_server_t *dx_server)
ctx->listener = (dx_listener_t*) pn_listener_context(listener);
ctx->connector = 0;
ctx->context = ctx->listener->context;
+ ctx->user_context = 0;
+ ctx->link_context = 0;
ctx->ufd = 0;
pn_connection_t *conn = pn_connection();
@@ -327,7 +329,6 @@ static void *thread_run(void *arg)
dx_connection_t *ctx;
int error;
int poll_result;
- int timer_holdoff = 0;
if (!thread)
return 0;
@@ -372,35 +373,20 @@ static void *thread_run(void *arg)
//
// Service pending timers.
//
- if (DEQ_SIZE(dx_server->pending_timers) > 0) {
- dx_timer_list_t local_list;
- dx_timer_t *timer = DEQ_HEAD(dx_server->pending_timers);
-
- DEQ_INIT(local_list);
- while (timer) {
- DEQ_REMOVE_HEAD(dx_server->pending_timers);
- DEQ_INSERT_TAIL(local_list, timer);
- timer = DEQ_HEAD(dx_server->pending_timers);
- }
+ dx_timer_t *timer = DEQ_HEAD(dx_server->pending_timers);
+ if (timer) {
+ DEQ_REMOVE_HEAD(dx_server->pending_timers);
//
- // Release the lock and invoke the connection handlers.
+ // Mark the timer as idle in case it reschedules itself.
//
- sys_mutex_unlock(dx_server->lock);
-
- timer = DEQ_HEAD(local_list);
- while (timer) {
- DEQ_REMOVE_HEAD(local_list);
-
- //
- // Mark the timer as idle in case it reschedules itself.
- //
- dx_timer_idle_LH(timer);
-
- timer->handler(timer->context);
- timer = DEQ_HEAD(local_list);
- }
+ dx_timer_idle_LH(timer);
+ //
+ // Release the lock and invoke the connection handler.
+ //
+ sys_mutex_unlock(dx_server->lock);
+ timer->handler(timer->context);
pn_driver_wakeup(dx_server->driver);
continue;
}
@@ -464,13 +450,10 @@ static void *thread_run(void *arg)
//
// Visit the timer module.
//
- if (poll_result == 0 || ++timer_holdoff == 100) {
- struct timespec tv;
- clock_gettime(CLOCK_REALTIME, &tv);
- long milliseconds = tv.tv_sec * 1000 + tv.tv_nsec / 1000000;
- dx_timer_visit_LH(milliseconds);
- timer_holdoff = 0;
- }
+ struct timespec tv;
+ clock_gettime(CLOCK_REALTIME, &tv);
+ long milliseconds = tv.tv_sec * 1000 + tv.tv_nsec / 1000000;
+ dx_timer_visit_LH(milliseconds);
//
// Process listeners (incoming connections).
@@ -630,6 +613,7 @@ static void cxtr_try_open(void *context)
ctx->connector = ct;
ctx->context = ct->context;
ctx->user_context = 0;
+ ctx->link_context = 0;
ctx->ufd = 0;
//
@@ -878,12 +862,32 @@ void *dx_connection_get_context(dx_connection_t *conn)
}
+void dx_connection_set_link_context(dx_connection_t *conn, void *context)
+{
+ conn->link_context = context;
+}
+
+
+void *dx_connection_get_link_context(dx_connection_t *conn)
+{
+ return conn->link_context;
+}
+
+
pn_connection_t *dx_connection_pn(dx_connection_t *conn)
{
return conn->pn_conn;
}
+const dx_server_config_t *dx_connection_config(const dx_connection_t *conn)
+{
+ if (conn->listener)
+ return conn->listener->config;
+ return conn->connector->config;
+}
+
+
dx_listener_t *dx_server_listen(dx_dispatch_t *dx, const dx_server_config_t *config, void *context)
{
dx_server_t *dx_server = dx->server;
@@ -976,6 +980,7 @@ dx_user_fd_t *dx_user_fd(dx_dispatch_t *dx, int fd, void *context)
ctx->connector = 0;
ctx->context = 0;
ctx->user_context = 0;
+ ctx->link_context = 0;
ctx->ufd = ufd;
ufd->context = context;
diff --git a/qpid/extras/dispatch/src/server_private.h b/qpid/extras/dispatch/src/server_private.h
index 5782492f22..86a3ef98f1 100644
--- a/qpid/extras/dispatch/src/server_private.h
+++ b/qpid/extras/dispatch/src/server_private.h
@@ -78,6 +78,7 @@ struct dx_connection_t {
dx_connector_t *connector;
void *context; // Copy of context from listener or connector
void *user_context;
+ void *link_context; // Context shared by this connection's links
dx_user_fd_t *ufd;
};
diff --git a/qpid/extras/dispatch/tests/compose_test.c b/qpid/extras/dispatch/tests/compose_test.c
index 9eaeeaa038..06292c221f 100644
--- a/qpid/extras/dispatch/tests/compose_test.c
+++ b/qpid/extras/dispatch/tests/compose_test.c
@@ -27,6 +27,105 @@
#include "compose_private.h"
+static char *vector0 =
+ "\x00\x53\x77" // amqp-value
+ "\xd0\x00\x00\x01\x26\x00\x00\x00\x0a" // list32 with ten items
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x0a" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x0b" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ "\xd1\x00\x00\x00\x18\x00\x00\x00\x04" // map32 with two pairs
+ "\xa1\x06key001" // str8-utf8
+ "\x52\x14" // smalluint
+ "\xa1\x06key002" // str8-utf8
+ "\x52\x15" // smalluint
+ ;
+
+static int vector0_length = 302;
+
+static char *test_compose_list_of_maps(void *context)
+{
+ dx_composed_field_t *field = dx_compose(DX_PERFORMATIVE_BODY_AMQP_VALUE, 0);
+
+ dx_compose_start_list(field);
+
+ dx_compose_start_map(field);
+ dx_compose_insert_string(field, "key001");
+ dx_compose_insert_uint(field, 10);
+ dx_compose_insert_string(field, "key002");
+ dx_compose_insert_uint(field, 11);
+ dx_compose_end_map(field);
+
+ for (int j = 0; j < 9; j++) {
+ dx_compose_start_map(field);
+ dx_compose_insert_string(field, "key001");
+ dx_compose_insert_uint(field, 20);
+ dx_compose_insert_string(field, "key002");
+ dx_compose_insert_uint(field, 21);
+ dx_compose_end_map(field);
+ }
+
+ dx_compose_end_list(field);
+
+ dx_buffer_t *buf = DEQ_HEAD(field->buffers);
+
+ if (dx_buffer_size(buf) != vector0_length) return "Incorrect Length of Buffer";
+
+ char *left = vector0;
+ char *right = (char*) dx_buffer_base(buf);
+ int idx;
+
+ for (idx = 0; idx < vector0_length; idx++) {
+ if (*left != *right) return "Pattern Mismatch";
+ left++;
+ right++;
+ }
+
+ dx_compose_free(field);
+ return 0;
+}
+
static char *vector1 =
"\x00\x53\x71" // delivery annotations
"\xd1\x00\x00\x00\x3d\x00\x00\x00\x04" // map32 with two item pairs
@@ -184,6 +283,7 @@ int compose_tests()
int result = 0;
dx_log_set_mask(LOG_NONE);
+ TEST_CASE(test_compose_list_of_maps, 0);
TEST_CASE(test_compose_nested_composites, 0);
TEST_CASE(test_compose_scalars, 0);
diff --git a/qpid/extras/dispatch/tests/onerouter.conf b/qpid/extras/dispatch/tests/config-1/A.conf
index 308d86473c..308d86473c 100644
--- a/qpid/extras/dispatch/tests/onerouter.conf
+++ b/qpid/extras/dispatch/tests/config-1/A.conf
diff --git a/qpid/extras/dispatch/tests/config-2/A.conf b/qpid/extras/dispatch/tests/config-2/A.conf
new file mode 100644
index 0000000000..0d00efdbd4
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-2/A.conf
@@ -0,0 +1,60 @@
+##
+## 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
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ ##
+ ## worker-threads - The number of threads that will be created to
+ ## process message traffic and other application work (timers, non-amqp
+ ## file descriptors, etc.)
+ ##
+ ## The number of threads should be related to the number of available
+ ## processor cores. To fully utilize a quad-core system, set the
+ ## number of threads to 4.
+ ##
+ worker-threads: 4
+
+ ##
+ ## container-name - The name of the AMQP container. If not specified,
+ ## the container name will be set to a value of the container's
+ ## choosing. The automatically assigned container name is not
+ ## guaranteed to be persistent across restarts of the container.
+ ##
+ container-name: Qpid.Dispatch.Router.A
+}
+
+
+##
+## Listeners and Connectors
+##
+listener {
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20001
+ sasl-mechanisms: ANONYMOUS
+}
+
+router {
+ mode: interior
+ area: A
+ router-id: QDR.A
+}
diff --git a/qpid/extras/dispatch/tests/config-2/B.conf b/qpid/extras/dispatch/tests/config-2/B.conf
new file mode 100644
index 0000000000..8999c9878c
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-2/B.conf
@@ -0,0 +1,68 @@
+##
+## 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
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ ##
+ ## worker-threads - The number of threads that will be created to
+ ## process message traffic and other application work (timers, non-amqp
+ ## file descriptors, etc.)
+ ##
+ ## The number of threads should be related to the number of available
+ ## processor cores. To fully utilize a quad-core system, set the
+ ## number of threads to 4.
+ ##
+ worker-threads: 4
+
+ ##
+ ## container-name - The name of the AMQP container. If not specified,
+ ## the container name will be set to a value of the container's
+ ## choosing. The automatically assigned container name is not
+ ## guaranteed to be persistent across restarts of the container.
+ ##
+ container-name: Qpid.Dispatch.Router.B
+}
+
+
+##
+## Listeners and Connectors
+##
+listener {
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20002
+ sasl-mechanisms: ANONYMOUS
+}
+
+connector {
+ label: Router Uplink
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20001
+ sasl-mechanisms: ANONYMOUS
+}
+
+router {
+ mode: interior
+ area: A
+ router-id: QDR.B
+}
diff --git a/qpid/extras/dispatch/tests/config-3-linear/A.conf b/qpid/extras/dispatch/tests/config-3-linear/A.conf
new file mode 100644
index 0000000000..3f18ad668c
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-3-linear/A.conf
@@ -0,0 +1,70 @@
+##
+## 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
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ ##
+ ## worker-threads - The number of threads that will be created to
+ ## process message traffic and other application work (timers, non-amqp
+ ## file descriptors, etc.)
+ ##
+ ## The number of threads should be related to the number of available
+ ## processor cores. To fully utilize a quad-core system, set the
+ ## number of threads to 4.
+ ##
+ worker-threads: 4
+
+ ##
+ ## container-name - The name of the AMQP container. If not specified,
+ ## the container name will be set to a value of the container's
+ ## choosing. The automatically assigned container name is not
+ ## guaranteed to be persistent across restarts of the container.
+ ##
+ container-name: QDR.A
+}
+
+
+##
+## Listeners and Connectors
+##
+listener {
+ addr: 0.0.0.0
+ port: 20001
+ sasl-mechanisms: ANONYMOUS
+}
+
+connector {
+ label: Router Uplink
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20002
+ sasl-mechanisms: ANONYMOUS
+}
+
+router {
+ mode: interior
+ area: A
+ router-id: QDR.A
+}
+
+
+
diff --git a/qpid/extras/dispatch/tests/config-3-linear/B.conf b/qpid/extras/dispatch/tests/config-3-linear/B.conf
new file mode 100644
index 0000000000..10310306d6
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-3-linear/B.conf
@@ -0,0 +1,69 @@
+##
+## 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
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ ##
+ ## worker-threads - The number of threads that will be created to
+ ## process message traffic and other application work (timers, non-amqp
+ ## file descriptors, etc.)
+ ##
+ ## The number of threads should be related to the number of available
+ ## processor cores. To fully utilize a quad-core system, set the
+ ## number of threads to 4.
+ ##
+ worker-threads: 4
+
+ ##
+ ## container-name - The name of the AMQP container. If not specified,
+ ## the container name will be set to a value of the container's
+ ## choosing. The automatically assigned container name is not
+ ## guaranteed to be persistent across restarts of the container.
+ ##
+ container-name: QDR.B
+}
+
+
+##
+## Listeners and Connectors
+##
+listener {
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20002
+ sasl-mechanisms: ANONYMOUS
+}
+
+connector {
+ label: Router Uplink
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20003
+ sasl-mechanisms: ANONYMOUS
+}
+
+
+router {
+ mode: interior
+ area: A
+ router-id: QDR.B
+}
diff --git a/qpid/extras/dispatch/tests/config-3-linear/C.conf b/qpid/extras/dispatch/tests/config-3-linear/C.conf
new file mode 100644
index 0000000000..83c0ff603d
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-3-linear/C.conf
@@ -0,0 +1,61 @@
+##
+## 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
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ ##
+ ## worker-threads - The number of threads that will be created to
+ ## process message traffic and other application work (timers, non-amqp
+ ## file descriptors, etc.)
+ ##
+ ## The number of threads should be related to the number of available
+ ## processor cores. To fully utilize a quad-core system, set the
+ ## number of threads to 4.
+ ##
+ worker-threads: 4
+
+ ##
+ ## container-name - The name of the AMQP container. If not specified,
+ ## the container name will be set to a value of the container's
+ ## choosing. The automatically assigned container name is not
+ ## guaranteed to be persistent across restarts of the container.
+ ##
+ container-name: QDR.C
+}
+
+
+##
+## Listeners and Connectors
+##
+listener {
+ role: inter-router
+ addr: 0.0.0.0
+ port: 20003
+ sasl-mechanisms: ANONYMOUS
+}
+
+
+router {
+ mode: interior
+ area: A
+ router-id: QDR.C
+}
diff --git a/qpid/extras/dispatch/tests/config-3-linear/topology.txt b/qpid/extras/dispatch/tests/config-3-linear/topology.txt
new file mode 100644
index 0000000000..07d6d74008
--- /dev/null
+++ b/qpid/extras/dispatch/tests/config-3-linear/topology.txt
@@ -0,0 +1,12 @@
+
+
+ +----------+ +----------+ +----------+
+ |QDR.A | |QDR.B | |QDR.C |
+ |port: | |port: | |port: |
+ | 20001 |--------->| 20002 |--------->| 20003 |
+ | | | | | |
+ | | | | | |
+ +----------+ +----------+ +----------+
+
+ * The direction of the arrow shows the direction of the connection setup
+ Connector --> Listener
diff --git a/qpid/extras/dispatch/tests/field_test.c b/qpid/extras/dispatch/tests/field_test.c
index 59fc3c4cfb..33f9fe5d03 100644
--- a/qpid/extras/dispatch/tests/field_test.c
+++ b/qpid/extras/dispatch/tests/field_test.c
@@ -115,6 +115,10 @@ static char* test_view_address_hash(void *context)
{"amqp:/_topo/my-area/all/local/sub", "Llocal/sub"},
{"amqp:/_topo/all/all/local/sub", "Llocal/sub"},
{"amqp://host:port/_local/my-addr", "Lmy-addr"},
+ {"_topo/area/router/my-addr", "Aarea"},
+ {"_topo/my-area/router/my-addr", "Rrouter"},
+ {"_topo/my-area/my-router/my-addr", "Lmy-addr"},
+ {"_topo/my-area/router", "Rrouter"},
{0, 0}
};
int idx;
diff --git a/qpid/extras/dispatch/tests/message_test.c b/qpid/extras/dispatch/tests/message_test.c
index 2873f48740..59f4e444dc 100644
--- a/qpid/extras/dispatch/tests/message_test.c
+++ b/qpid/extras/dispatch/tests/message_test.c
@@ -47,7 +47,7 @@ static void set_content(dx_message_content_t *content, size_t len)
dx_buffer_t *buf;
while (len > (size_t) (cursor - buffer)) {
- buf = dx_allocate_buffer();
+ buf = dx_buffer();
size_t segment = dx_buffer_capacity(buf);
size_t remaining = len - (size_t) (cursor - buffer);
if (segment > remaining)
@@ -62,7 +62,7 @@ static void set_content(dx_message_content_t *content, size_t len)
static char* test_send_to_messenger(void *context)
{
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_content_t *content = MSG_CONTENT(msg);
dx_message_compose_1(msg, "test_addr_0", 0);
@@ -78,7 +78,7 @@ static char* test_send_to_messenger(void *context)
return "Address mismatch in received message";
pn_message_free(pn_msg);
- dx_free_message(msg);
+ dx_message_free(msg);
return 0;
}
@@ -93,7 +93,7 @@ static char* test_receive_from_messenger(void *context)
int result = pn_message_encode(pn_msg, buffer, &size);
if (result != 0) return "Error in pn_message_encode";
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_content_t *content = MSG_CONTENT(msg);
set_content(content, size);
@@ -118,7 +118,7 @@ static char* test_receive_from_messenger(void *context)
return "Incorrect field content returned from field_copy";
pn_message_free(pn_msg);
- dx_free_message(msg);
+ dx_message_free(msg);
return 0;
}
@@ -133,7 +133,7 @@ static char* test_insufficient_check_depth(void *context)
int result = pn_message_encode(pn_msg, buffer, &size);
if (result != 0) return "Error in pn_message_encode";
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_content_t *content = MSG_CONTENT(msg);
set_content(content, size);
@@ -144,7 +144,7 @@ static char* test_insufficient_check_depth(void *context)
dx_field_iterator_t *iter = dx_message_field_iterator(msg, DX_FIELD_TO);
if (iter) return "Expected no iterator for the 'to' field";
- dx_free_message(msg);
+ dx_message_free(msg);
return 0;
}
@@ -159,7 +159,7 @@ static char* test_check_multiple(void *context)
int result = pn_message_encode(pn_msg, buffer, &size);
if (result != 0) return "Error in pn_message_encode";
- dx_message_t *msg = dx_allocate_message();
+ dx_message_t *msg = dx_message();
dx_message_content_t *content = MSG_CONTENT(msg);
set_content(content, size);
@@ -173,7 +173,7 @@ static char* test_check_multiple(void *context)
valid = dx_message_check(msg, DX_DEPTH_PROPERTIES);
if (!valid) return "dx_message_check returns 'invalid' for PROPERTIES";
- dx_free_message(msg);
+ dx_message_free(msg);
return 0;
}
diff --git a/qpid/extras/dispatch/tests/router_engine_test.py b/qpid/extras/dispatch/tests/router_engine_test.py
index 605e7568d3..e25ce35d22 100644
--- a/qpid/extras/dispatch/tests/router_engine_test.py
+++ b/qpid/extras/dispatch/tests/router_engine_test.py
@@ -18,393 +18,634 @@
#
import unittest
-from qpid.dispatch.router.router_engine import NeighborEngine, PathEngine, Configuration
+from qpid.dispatch.router.router_engine import NeighborEngine, PathEngine, Configuration, NodeTracker
from qpid.dispatch.router.data import LinkState, MessageHELLO
class Adapter(object):
- def __init__(self, domain):
- self._domain = domain
+ def __init__(self, domain):
+ self._domain = domain
- def log(self, level, text):
- print "Adapter.log(%d): domain=%s, text=%s" % (level, self._domain, text)
+ def log(self, level, text):
+ print "Adapter.log(%d): domain=%s, text=%s" % (level, self._domain, text)
- def send(self, dest, opcode, body):
- print "Adapter.send: domain=%s, dest=%s, opcode=%s, body=%s" % (self._domain, dest, opcode, body)
- def remote_bind(self, subject, peer):
- print "Adapter.remote_bind: subject=%s, peer=%s" % (subject, peer)
+ def send(self, dest, opcode, body):
+ print "Adapter.send: domain=%s, dest=%s, opcode=%s, body=%s" % (self._domain, dest, opcode, body)
- def remote_unbind(self, subject, peer):
- print "Adapter.remote_unbind: subject=%s, peer=%s" % (subject, peer)
+ def remote_bind(self, subject, peer):
+ print "Adapter.remote_bind: subject=%s, peer=%s" % (subject, peer)
+ def remote_unbind(self, subject, peer):
+ print "Adapter.remote_unbind: subject=%s, peer=%s" % (subject, peer)
+
+ def node_updated(self, address, reachable, neighbor, link_bit, router_bit):
+ print "Adapter.node_updated: address=%s, reachable=%r, neighbor=%r, link_bit=%d, router_bit=%d" % \
+ (address, reachable, neighbor, link_bit, router_bit)
-class DataTest(unittest.TestCase):
- def test_link_state(self):
- ls = LinkState(None, 'R1', 'area', 1, ['R2', 'R3'])
- self.assertEqual(ls.id, 'R1')
- self.assertEqual(ls.area, 'area')
- self.assertEqual(ls.ls_seq, 1)
- self.assertEqual(ls.peers, ['R2', 'R3'])
- ls.bump_sequence()
- self.assertEqual(ls.id, 'R1')
- self.assertEqual(ls.area, 'area')
- self.assertEqual(ls.ls_seq, 2)
- self.assertEqual(ls.peers, ['R2', 'R3'])
-
- result = ls.add_peer('R4')
- self.assertTrue(result)
- self.assertEqual(ls.peers, ['R2', 'R3', 'R4'])
- result = ls.add_peer('R2')
- self.assertFalse(result)
- self.assertEqual(ls.peers, ['R2', 'R3', 'R4'])
-
- result = ls.del_peer('R3')
- self.assertTrue(result)
- self.assertEqual(ls.peers, ['R2', 'R4'])
- result = ls.del_peer('R5')
- self.assertFalse(result)
- self.assertEqual(ls.peers, ['R2', 'R4'])
-
- encoded = ls.to_dict()
- new_ls = LinkState(encoded)
- self.assertEqual(new_ls.id, 'R1')
- self.assertEqual(new_ls.area, 'area')
- self.assertEqual(new_ls.ls_seq, 2)
- self.assertEqual(new_ls.peers, ['R2', 'R4'])
-
-
- def test_hello_message(self):
- msg1 = MessageHELLO(None, 'R1', 'area', ['R2', 'R3', 'R4'])
- self.assertEqual(msg1.get_opcode(), "HELLO")
- self.assertEqual(msg1.id, 'R1')
- self.assertEqual(msg1.area, 'area')
- self.assertEqual(msg1.seen_peers, ['R2', 'R3', 'R4'])
- encoded = msg1.to_dict()
- msg2 = MessageHELLO(encoded)
- self.assertEqual(msg2.get_opcode(), "HELLO")
- self.assertEqual(msg2.id, 'R1')
- self.assertEqual(msg2.area, 'area')
- self.assertEqual(msg2.seen_peers, ['R2', 'R3', 'R4'])
- self.assertTrue(msg2.is_seen('R3'))
- self.assertFalse(msg2.is_seen('R9'))
+class DataTest(unittest.TestCase):
+ def test_link_state(self):
+ ls = LinkState(None, 'R1', 'area', 1, ['R2', 'R3'])
+ self.assertEqual(ls.id, 'R1')
+ self.assertEqual(ls.area, 'area')
+ self.assertEqual(ls.ls_seq, 1)
+ self.assertEqual(ls.peers, ['R2', 'R3'])
+ ls.bump_sequence()
+ self.assertEqual(ls.id, 'R1')
+ self.assertEqual(ls.area, 'area')
+ self.assertEqual(ls.ls_seq, 2)
+ self.assertEqual(ls.peers, ['R2', 'R3'])
+
+ result = ls.add_peer('R4')
+ self.assertTrue(result)
+ self.assertEqual(ls.peers, ['R2', 'R3', 'R4'])
+ result = ls.add_peer('R2')
+ self.assertFalse(result)
+ self.assertEqual(ls.peers, ['R2', 'R3', 'R4'])
+
+ result = ls.del_peer('R3')
+ self.assertTrue(result)
+ self.assertEqual(ls.peers, ['R2', 'R4'])
+ result = ls.del_peer('R5')
+ self.assertFalse(result)
+ self.assertEqual(ls.peers, ['R2', 'R4'])
+
+ encoded = ls.to_dict()
+ new_ls = LinkState(encoded)
+ self.assertEqual(new_ls.id, 'R1')
+ self.assertEqual(new_ls.area, 'area')
+ self.assertEqual(new_ls.ls_seq, 2)
+ self.assertEqual(new_ls.peers, ['R2', 'R4'])
+
+
+ def test_hello_message(self):
+ msg1 = MessageHELLO(None, 'R1', 'area', ['R2', 'R3', 'R4'])
+ self.assertEqual(msg1.get_opcode(), "HELLO")
+ self.assertEqual(msg1.id, 'R1')
+ self.assertEqual(msg1.area, 'area')
+ self.assertEqual(msg1.seen_peers, ['R2', 'R3', 'R4'])
+ encoded = msg1.to_dict()
+ msg2 = MessageHELLO(encoded)
+ self.assertEqual(msg2.get_opcode(), "HELLO")
+ self.assertEqual(msg2.id, 'R1')
+ self.assertEqual(msg2.area, 'area')
+ self.assertEqual(msg2.seen_peers, ['R2', 'R3', 'R4'])
+ self.assertTrue(msg2.is_seen('R3'))
+ self.assertFalse(msg2.is_seen('R9'))
+
+
+class NodeTrackerTest(unittest.TestCase):
+ def log(self, level, text):
+ pass
+
+ def add_neighbor_router(self, address, router_bit, link_bit):
+ self.address = address
+ self.router_bit = router_bit
+ self.link_bit = link_bit
+ self.calls += 1
+
+ def del_neighbor_router(self, router_bit):
+ self.address = None
+ self.router_bit = router_bit
+ self.link_bit = None
+ self.calls += 1
+
+ def add_remote_router(self, address, router_bit):
+ self.address = address
+ self.router_bit = router_bit
+ self.link_bit = None
+ self.calls += 1
+
+ def del_remote_router(self, router_bit):
+ self.address = None
+ self.router_bit = router_bit
+ self.link_bit = None
+ self.calls += 1
+
+ def reset(self):
+ self.address = None
+ self.router_bit = None
+ self.link_bit = None
+ self.area = "area"
+ self.calls = 0
+
+ def test_node_tracker_limits(self):
+ tracker = NodeTracker(self, 5)
+
+ self.reset()
+ tracker.new_neighbor('A', 1)
+ self.assertEqual(self.address, 'amqp:/_topo/area/A')
+ self.assertEqual(self.link_bit, 1)
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_neighbor('B', 5)
+ self.assertEqual(self.address, 'amqp:/_topo/area/B')
+ self.assertEqual(self.link_bit, 5)
+ self.assertEqual(self.router_bit, 2)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_neighbor('C', 6)
+ self.assertEqual(self.address, 'amqp:/_topo/area/C')
+ self.assertEqual(self.link_bit, 6)
+ self.assertEqual(self.router_bit, 3)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_neighbor('D', 7)
+ self.assertEqual(self.address, 'amqp:/_topo/area/D')
+ self.assertEqual(self.link_bit, 7)
+ self.assertEqual(self.router_bit, 4)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ try:
+ tracker.new_neighbor('E', 9)
+ AssertFalse("We shouldn't be here")
+ except:
+ pass
+
+ self.reset()
+ tracker.lost_neighbor('C')
+ self.assertEqual(self.router_bit, 3)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_neighbor('E', 9)
+ self.assertEqual(self.address, 'amqp:/_topo/area/E')
+ self.assertEqual(self.link_bit, 9)
+ self.assertEqual(self.router_bit, 3)
+ self.assertEqual(self.calls, 1)
+
+
+ def test_node_tracker_remote_neighbor(self):
+ tracker = NodeTracker(self, 5)
+
+ self.reset()
+ tracker.new_node('A')
+ self.assertEqual(self.address, 'amqp:/_topo/area/A')
+ self.assertFalse(self.link_bit)
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_neighbor('A', 3)
+ self.assertEqual(self.address, 'amqp:/_topo/area/A')
+ self.assertEqual(self.link_bit, 3)
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 2)
+
+ self.reset()
+ tracker.lost_node('A')
+ self.assertFalse(self.address)
+ self.assertFalse(self.link_bit)
+ self.assertFalse(self.router_bit)
+ self.assertEqual(self.calls, 0)
+
+ self.reset()
+ tracker.lost_neighbor('A')
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 1)
+
+
+ def test_node_tracker_neighbor_remote(self):
+ tracker = NodeTracker(self, 5)
+
+ self.reset()
+ tracker.new_neighbor('A', 3)
+ self.assertEqual(self.address, 'amqp:/_topo/area/A')
+ self.assertEqual(self.link_bit, 3)
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 1)
+
+ self.reset()
+ tracker.new_node('A')
+ self.assertFalse(self.address)
+ self.assertFalse(self.link_bit)
+ self.assertFalse(self.router_bit)
+ self.assertEqual(self.calls, 0)
+
+ self.reset()
+ tracker.lost_neighbor('A')
+ self.assertEqual(self.address, 'amqp:/_topo/area/A')
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 2)
+
+ self.reset()
+ tracker.lost_node('A')
+ self.assertEqual(self.router_bit, 1)
+ self.assertEqual(self.calls, 1)
class NeighborTest(unittest.TestCase):
- def log(self, level, text):
- pass
-
- def send(self, dest, msg):
- self.sent.append((dest, msg))
-
- def local_link_state_changed(self, link_state):
- self.local_link_state = link_state
-
- def new_neighbor(self, rid):
- self.neighbors[rid] = None
-
- def lost_neighbor(self, rid):
- self.neighbors.pop(rid)
-
- def setUp(self):
- self.sent = []
- self.local_link_state = None
- self.id = "R1"
- self.area = "area"
- self.config = Configuration()
- self.neighbors = {}
-
- def test_hello_sent(self):
- self.sent = []
- self.local_link_state = None
- self.engine = NeighborEngine(self)
- self.engine.tick(0.5)
- self.assertEqual(self.sent, [])
- self.engine.tick(1.5)
- self.assertEqual(len(self.sent), 1)
- dest, msg = self.sent.pop(0)
- self.assertEqual(dest, "_local/qdxrouter")
- self.assertEqual(msg.get_opcode(), "HELLO")
- self.assertEqual(msg.id, self.id)
- self.assertEqual(msg.area, self.area)
- self.assertEqual(msg.seen_peers, [])
- self.assertEqual(self.local_link_state, None)
-
- def test_sees_peer(self):
- self.sent = []
- self.local_link_state = None
- self.engine = NeighborEngine(self)
- self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', []), 2.0)
- self.engine.tick(5.0)
- self.assertEqual(len(self.sent), 1)
- dest, msg = self.sent.pop(0)
- self.assertEqual(msg.seen_peers, ['R2'])
-
- def test_establish_peer(self):
- self.sent = []
- self.local_link_state = None
- self.engine = NeighborEngine(self)
- self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R1']), 0.5)
- self.engine.tick(1.0)
- self.engine.tick(2.0)
- self.engine.tick(3.0)
- self.assertEqual(self.local_link_state.id, 'R1')
- self.assertEqual(self.local_link_state.area, 'area')
- self.assertEqual(self.local_link_state.ls_seq, 1)
- self.assertEqual(self.local_link_state.peers, ['R2'])
-
- def test_establish_multiple_peers(self):
- self.sent = []
- self.local_link_state = None
- self.engine = NeighborEngine(self)
- self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R1']), 0.5)
- self.engine.tick(1.0)
- self.engine.handle_hello(MessageHELLO(None, 'R3', 'area', ['R1', 'R2']), 1.5)
- self.engine.tick(2.0)
- self.engine.handle_hello(MessageHELLO(None, 'R4', 'area', ['R1']), 2.5)
- self.engine.handle_hello(MessageHELLO(None, 'R5', 'area', ['R2']), 2.5)
- self.engine.handle_hello(MessageHELLO(None, 'R6', 'area', ['R1']), 2.5)
- self.engine.tick(3.0)
- self.assertEqual(self.local_link_state.id, 'R1')
- self.assertEqual(self.local_link_state.area, 'area')
- self.assertEqual(self.local_link_state.ls_seq, 3)
- self.local_link_state.peers.sort()
- self.assertEqual(self.local_link_state.peers, ['R2', 'R3', 'R4', 'R6'])
-
- def test_timeout_peer(self):
- self.sent = []
- self.local_link_state = None
- self.engine = NeighborEngine(self)
- self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R3', 'R1']), 2.0)
- self.engine.tick(5.0)
- self.engine.tick(17.1)
- self.assertEqual(self.local_link_state.id, 'R1')
- self.assertEqual(self.local_link_state.area, 'area')
- self.assertEqual(self.local_link_state.ls_seq, 2)
- self.assertEqual(self.local_link_state.peers, [])
+ def log(self, level, text):
+ pass
+
+ def send(self, dest, msg):
+ self.sent.append((dest, msg))
+
+ def local_link_state_changed(self, link_state):
+ self.local_link_state = link_state
+
+ def new_neighbor(self, rid, lbit):
+ self.neighbors[rid] = None
+
+ def lost_neighbor(self, rid):
+ self.neighbors.pop(rid)
+
+ def setUp(self):
+ self.sent = []
+ self.local_link_state = None
+ self.id = "R1"
+ self.area = "area"
+ self.config = Configuration()
+ self.neighbors = {}
+
+ def test_hello_sent(self):
+ self.sent = []
+ self.local_link_state = None
+ self.engine = NeighborEngine(self)
+ self.engine.tick(0.5)
+ self.assertEqual(self.sent, [])
+ self.engine.tick(1.5)
+ self.assertEqual(len(self.sent), 1)
+ dest, msg = self.sent.pop(0)
+ self.assertEqual(dest, "amqp:/_local/qdxhello")
+ self.assertEqual(msg.get_opcode(), "HELLO")
+ self.assertEqual(msg.id, self.id)
+ self.assertEqual(msg.area, self.area)
+ self.assertEqual(msg.seen_peers, [])
+ self.assertEqual(self.local_link_state, None)
+
+ def test_sees_peer(self):
+ self.sent = []
+ self.local_link_state = None
+ self.engine = NeighborEngine(self)
+ self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', []), 2.0, 0)
+ self.engine.tick(5.0)
+ self.assertEqual(len(self.sent), 1)
+ dest, msg = self.sent.pop(0)
+ self.assertEqual(msg.seen_peers, ['R2'])
+
+ def test_establish_peer(self):
+ self.sent = []
+ self.local_link_state = None
+ self.engine = NeighborEngine(self)
+ self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R1']), 0.5, 0)
+ self.engine.tick(1.0)
+ self.engine.tick(2.0)
+ self.engine.tick(3.0)
+ self.assertEqual(self.local_link_state.id, 'R1')
+ self.assertEqual(self.local_link_state.area, 'area')
+ self.assertEqual(self.local_link_state.ls_seq, 1)
+ self.assertEqual(self.local_link_state.peers, ['R2'])
+
+ def test_establish_multiple_peers(self):
+ self.sent = []
+ self.local_link_state = None
+ self.engine = NeighborEngine(self)
+ self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R1']), 0.5, 0)
+ self.engine.tick(1.0)
+ self.engine.handle_hello(MessageHELLO(None, 'R3', 'area', ['R1', 'R2']), 1.5, 0)
+ self.engine.tick(2.0)
+ self.engine.handle_hello(MessageHELLO(None, 'R4', 'area', ['R1']), 2.5, 0)
+ self.engine.handle_hello(MessageHELLO(None, 'R5', 'area', ['R2']), 2.5, 0)
+ self.engine.handle_hello(MessageHELLO(None, 'R6', 'area', ['R1']), 2.5, 0)
+ self.engine.tick(3.0)
+ self.assertEqual(self.local_link_state.id, 'R1')
+ self.assertEqual(self.local_link_state.area, 'area')
+ self.assertEqual(self.local_link_state.ls_seq, 3)
+ self.local_link_state.peers.sort()
+ self.assertEqual(self.local_link_state.peers, ['R2', 'R3', 'R4', 'R6'])
+
+ def test_timeout_peer(self):
+ self.sent = []
+ self.local_link_state = None
+ self.engine = NeighborEngine(self)
+ self.engine.handle_hello(MessageHELLO(None, 'R2', 'area', ['R3', 'R1']), 2.0, 0)
+ self.engine.tick(5.0)
+ self.engine.tick(17.1)
+ self.assertEqual(self.local_link_state.id, 'R1')
+ self.assertEqual(self.local_link_state.area, 'area')
+ self.assertEqual(self.local_link_state.ls_seq, 2)
+ self.assertEqual(self.local_link_state.peers, [])
class PathTest(unittest.TestCase):
- def setUp(self):
- self.id = 'R1'
- self.area = 'area'
- self.next_hops = None
- self.engine = PathEngine(self)
-
- def log(self, level, text):
- pass
-
- def next_hops_changed(self, nh):
- self.next_hops = nh
-
- def test_topology1(self):
- """
-
- +====+ +----+ +----+
- | R1 |------| R2 |------| R3 |
- +====+ +----+ +----+
-
- """
- collection = { 'R1': LinkState(None, 'R1', 'area', 1, ['R2']),
- 'R2': LinkState(None, 'R2', 'area', 1, ['R1', 'R3']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R2']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 2)
- self.assertEqual(self.next_hops['R2'], 'R2')
- self.assertEqual(self.next_hops['R3'], 'R2')
-
- def test_topology2(self):
- """
-
- +====+ +----+ +----+
- | R1 |------| R2 |------| R4 |
- +====+ +----+ +----+
- | |
- +----+ +----+ +----+
- | R3 |------| R5 |------| R6 |
- +----+ +----+ +----+
-
- """
- collection = { 'R1': LinkState(None, 'R1', 'area', 1, ['R2']),
- 'R2': LinkState(None, 'R2', 'area', 1, ['R1', 'R3', 'R4']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R2', 'R5']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R2', 'R5']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R3', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 5)
- self.assertEqual(self.next_hops['R2'], 'R2')
- self.assertEqual(self.next_hops['R3'], 'R2')
- self.assertEqual(self.next_hops['R4'], 'R2')
- self.assertEqual(self.next_hops['R5'], 'R2')
- self.assertEqual(self.next_hops['R6'], 'R2')
-
- def test_topology3(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- | |
- +====+ +----+ +----+
- | R1 |------| R5 |------| R6 |
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 5)
- self.assertEqual(self.next_hops['R2'], 'R3')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
- self.assertEqual(self.next_hops['R6'], 'R5')
-
- def test_topology4(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- | |
- +====+ +----+ +----+
- | R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 6)
- self.assertEqual(self.next_hops['R2'], 'R3')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
- self.assertEqual(self.next_hops['R6'], 'R5')
- self.assertEqual(self.next_hops['R7'], 'R5')
-
- def test_topology5(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- | | |
- | +====+ +----+ +----+
- +--------| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5', 'R2']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 6)
- self.assertEqual(self.next_hops['R2'], 'R2')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
- self.assertEqual(self.next_hops['R6'], 'R5')
- self.assertEqual(self.next_hops['R7'], 'R5')
-
- def test_topology5_with_asymmetry1(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- ^ | |
- ^ +====+ +----+ +----+
- +-<-<-<--| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5', 'R2']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 6)
- self.assertEqual(self.next_hops['R2'], 'R2')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
- self.assertEqual(self.next_hops['R6'], 'R5')
- self.assertEqual(self.next_hops['R7'], 'R5')
-
- def test_topology5_with_asymmetry2(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- v | |
- v +====+ +----+ +----+
- +->->->->| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 6)
- self.assertEqual(self.next_hops['R2'], 'R3')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
- self.assertEqual(self.next_hops['R6'], 'R5')
- self.assertEqual(self.next_hops['R7'], 'R5')
-
- def test_topology5_with_asymmetry3(self):
- """
-
- +----+ +----+ +----+
- | R2 |------| R3 |------| R4 |
- +----+ +----+ +----+
- v | |
- v +====+ +----+ +----+
- +->->->->| R1 |------| R5 |<-<-<-| R6 |------ R7 (no ls from R7)
- +====+ +----+ +----+
-
- """
- collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
- 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
- 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
- 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
- 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4']),
- 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
- self.engine.ls_collection_changed(collection)
- self.engine.tick(1.0)
- self.assertEqual(len(self.next_hops), 4)
- self.assertEqual(self.next_hops['R2'], 'R3')
- self.assertEqual(self.next_hops['R3'], 'R3')
- self.assertEqual(self.next_hops['R4'], 'R3')
- self.assertEqual(self.next_hops['R5'], 'R5')
+ def setUp(self):
+ self.id = 'R1'
+ self.area = 'area'
+ self.next_hops = None
+ self.valid_origins = None
+ self.engine = PathEngine(self)
+
+ def log(self, level, text):
+ pass
+
+ def next_hops_changed(self, nh):
+ self.next_hops = nh
+
+ def valid_origins_changed(self, vo):
+ self.valid_origins = vo
+
+ def test_topology1(self):
+ """
+
+ +====+ +----+ +----+
+ | R1 |------| R2 |------| R3 |
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R1': LinkState(None, 'R1', 'area', 1, ['R2']),
+ 'R2': LinkState(None, 'R2', 'area', 1, ['R1', 'R3']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R2']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 2)
+ self.assertEqual(self.next_hops['R2'], 'R2')
+ self.assertEqual(self.next_hops['R3'], 'R2')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.assertEqual(self.valid_origins['R2'], [])
+ self.assertEqual(self.valid_origins['R3'], [])
+
+ def test_topology2(self):
+ """
+
+ +====+ +----+ +----+
+ | R1 |------| R2 |------| R4 |
+ +====+ +----+ +----+
+ | |
+ +----+ +----+ +----+
+ | R3 |------| R5 |------| R6 |
+ +----+ +----+ +----+
+
+ """
+ collection = { 'R1': LinkState(None, 'R1', 'area', 1, ['R2']),
+ 'R2': LinkState(None, 'R2', 'area', 1, ['R1', 'R3', 'R4']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R2', 'R5']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R2', 'R5']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R3', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 5)
+ self.assertEqual(self.next_hops['R2'], 'R2')
+ self.assertEqual(self.next_hops['R3'], 'R2')
+ self.assertEqual(self.next_hops['R4'], 'R2')
+ self.assertEqual(self.next_hops['R5'], 'R2')
+ self.assertEqual(self.next_hops['R6'], 'R2')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.assertEqual(self.valid_origins['R2'], [])
+ self.assertEqual(self.valid_origins['R3'], [])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], [])
+ self.assertEqual(self.valid_origins['R6'], [])
+
+ def test_topology3(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ | |
+ +====+ +----+ +----+
+ | R1 |------| R5 |------| R6 |
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 5)
+ self.assertEqual(self.next_hops['R2'], 'R3')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+ self.assertEqual(self.next_hops['R6'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5', 'R6'])
+ self.assertEqual(self.valid_origins['R3'], ['R5', 'R6'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R6'], ['R2', 'R3'])
+
+ def test_topology4(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ | |
+ +====+ +----+ +----+
+ | R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 6)
+ self.assertEqual(self.next_hops['R2'], 'R3')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+ self.assertEqual(self.next_hops['R6'], 'R5')
+ self.assertEqual(self.next_hops['R7'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.valid_origins['R7'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R3'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R6'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R7'], ['R2', 'R3'])
+
+ def test_topology5(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ | | |
+ | +====+ +----+ +----+
+ +--------| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5', 'R2']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 6)
+ self.assertEqual(self.next_hops['R2'], 'R2')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+ self.assertEqual(self.next_hops['R6'], 'R5')
+ self.assertEqual(self.next_hops['R7'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.valid_origins['R7'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R3'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R6'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R7'], ['R2', 'R3'])
+
+ def test_topology5_with_asymmetry1(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ ^ | |
+ ^ +====+ +----+ +----+
+ +-<-<-<--| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5', 'R2']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 6)
+ self.assertEqual(self.next_hops['R2'], 'R2')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+ self.assertEqual(self.next_hops['R6'], 'R5')
+ self.assertEqual(self.next_hops['R7'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.valid_origins['R7'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R3'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R6'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R7'], ['R2', 'R3'])
+
+ def test_topology5_with_asymmetry2(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ v | |
+ v +====+ +----+ +----+
+ +->->->->| R1 |------| R5 |------| R6 |------ R7 (no ls from R7)
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4', 'R6']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 6)
+ self.assertEqual(self.next_hops['R2'], 'R3')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+ self.assertEqual(self.next_hops['R6'], 'R5')
+ self.assertEqual(self.next_hops['R7'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.valid_origins['R6'].sort()
+ self.valid_origins['R7'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R3'], ['R5', 'R6', 'R7'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R6'], ['R2', 'R3'])
+ self.assertEqual(self.valid_origins['R7'], ['R2', 'R3'])
+
+ def test_topology5_with_asymmetry3(self):
+ """
+
+ +----+ +----+ +----+
+ | R2 |------| R3 |------| R4 |
+ +----+ +----+ +----+
+ v | |
+ v +====+ +----+ +----+
+ +->->->->| R1 |------| R5 |<-<-<-| R6 |------ R7 (no ls from R7)
+ +====+ +----+ +----+
+
+ """
+ collection = { 'R2': LinkState(None, 'R2', 'area', 1, ['R3', 'R1']),
+ 'R3': LinkState(None, 'R3', 'area', 1, ['R1', 'R2', 'R4']),
+ 'R4': LinkState(None, 'R4', 'area', 1, ['R3', 'R5']),
+ 'R1': LinkState(None, 'R1', 'area', 1, ['R3', 'R5']),
+ 'R5': LinkState(None, 'R5', 'area', 1, ['R1', 'R4']),
+ 'R6': LinkState(None, 'R6', 'area', 1, ['R5', 'R7']) }
+ self.engine.ls_collection_changed(collection)
+ self.engine.tick(1.0)
+ self.assertEqual(len(self.next_hops), 4)
+ self.assertEqual(self.next_hops['R2'], 'R3')
+ self.assertEqual(self.next_hops['R3'], 'R3')
+ self.assertEqual(self.next_hops['R4'], 'R3')
+ self.assertEqual(self.next_hops['R5'], 'R5')
+
+ self.valid_origins['R2'].sort()
+ self.valid_origins['R3'].sort()
+ self.valid_origins['R4'].sort()
+ self.valid_origins['R5'].sort()
+ self.assertEqual(self.valid_origins['R2'], ['R5'])
+ self.assertEqual(self.valid_origins['R3'], ['R5'])
+ self.assertEqual(self.valid_origins['R4'], [])
+ self.assertEqual(self.valid_origins['R5'], ['R2', 'R3'])
if __name__ == '__main__':
- unittest.main()
+ unittest.main()
diff --git a/qpid/extras/dispatch/tests/system_tests_one_router.py b/qpid/extras/dispatch/tests/system_tests_one_router.py
index b25568d283..1154b3ed37 100644
--- a/qpid/extras/dispatch/tests/system_tests_one_router.py
+++ b/qpid/extras/dispatch/tests/system_tests_one_router.py
@@ -29,7 +29,7 @@ class RouterTest(unittest.TestCase):
if 'CTEST_SOURCE_DIR' not in os.environ:
raise Exception("Environment variable 'CTEST_SOURCE_DIR' not set")
srcdir = os.environ['CTEST_SOURCE_DIR']
- self.router = subprocess.Popen(['../router/dispatch-router', '-c', '%s/onerouter.conf' % srcdir],
+ self.router = subprocess.Popen(['../router/dispatch-router', '-c', '%s/config-1/A.conf' % srcdir],
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
time.sleep(1)
@@ -138,6 +138,65 @@ class RouterTest(unittest.TestCase):
M4.stop()
+ def test_2a_multicast_unsettled(self):
+ addr = "amqp://0.0.0.0:20000/pre_settled/multicast/1"
+ M1 = Messenger()
+ M2 = Messenger()
+ M3 = Messenger()
+ M4 = Messenger()
+
+ M1.timeout = 1.0
+ M2.timeout = 1.0
+ M3.timeout = 1.0
+ M4.timeout = 1.0
+
+ M1.outgoing_window = 5
+ M2.incoming_window = 5
+ M3.incoming_window = 5
+ M4.incoming_window = 5
+
+ M1.start()
+ M2.start()
+ M3.start()
+ M4.start()
+ self.subscribe(M2, addr)
+ self.subscribe(M3, addr)
+ self.subscribe(M4, addr)
+
+ tm = Message()
+ rm = Message()
+
+ tm.address = addr
+ for i in range(2):
+ tm.body = {'number': i}
+ M1.put(tm)
+ M1.send(0)
+
+ for i in range(2):
+ M2.recv(1)
+ trk = M2.get(rm)
+ M2.accept(trk)
+ M2.settle(trk)
+ self.assertEqual(i, rm.body['number'])
+
+ M3.recv(1)
+ trk = M3.get(rm)
+ M3.accept(trk)
+ M3.settle(trk)
+ self.assertEqual(i, rm.body['number'])
+
+ M4.recv(1)
+ trk = M4.get(rm)
+ M4.accept(trk)
+ M4.settle(trk)
+ self.assertEqual(i, rm.body['number'])
+
+ M1.stop()
+ M2.stop()
+ M3.stop()
+ M4.stop()
+
+
def test_3_propagated_disposition(self):
addr = "amqp://0.0.0.0:20000/unsettled/1"
M1 = Messenger()
@@ -310,8 +369,8 @@ class RouterTest(unittest.TestCase):
self.assertEqual(i, rm.body['number'])
da = rm.instructions
self.assertEqual(da.__class__, dict)
- self.assertEqual(da['qdx.ingress'], 'Qpid.Dispatch.Router.A')
- self.assertFalse('qdx.trace' in da)
+ self.assertEqual(da['qdx.ingress'], '_topo/area/Qpid.Dispatch.Router.A/')
+ self.assertEqual(da['qdx.trace'], ['_topo/area/Qpid.Dispatch.Router.A/'])
##
## Pre-existing ingress
@@ -329,7 +388,7 @@ class RouterTest(unittest.TestCase):
da = rm.instructions
self.assertEqual(da.__class__, dict)
self.assertEqual(da['qdx.ingress'], 'ingress-router')
- self.assertFalse('qdx.trace' in da)
+ self.assertEqual(da['qdx.trace'], ['_topo/area/Qpid.Dispatch.Router.A/'])
##
## Invalid trace type
@@ -346,8 +405,8 @@ class RouterTest(unittest.TestCase):
self.assertEqual(i, rm.body['number'])
da = rm.instructions
self.assertEqual(da.__class__, dict)
- self.assertEqual(da['qdx.ingress'], 'Qpid.Dispatch.Router.A')
- self.assertFalse('qdx.trace' in da)
+ self.assertEqual(da['qdx.ingress'], '_topo/area/Qpid.Dispatch.Router.A/')
+ self.assertEqual(da['qdx.trace'], ['_topo/area/Qpid.Dispatch.Router.A/'])
##
## Empty trace
@@ -364,8 +423,8 @@ class RouterTest(unittest.TestCase):
self.assertEqual(i, rm.body['number'])
da = rm.instructions
self.assertEqual(da.__class__, dict)
- self.assertEqual(da['qdx.ingress'], 'Qpid.Dispatch.Router.A')
- self.assertEqual(da['qdx.trace'], ['Qpid.Dispatch.Router.A'])
+ self.assertEqual(da['qdx.ingress'], '_topo/area/Qpid.Dispatch.Router.A/')
+ self.assertEqual(da['qdx.trace'], ['_topo/area/Qpid.Dispatch.Router.A/'])
##
## Non-empty trace
@@ -382,8 +441,8 @@ class RouterTest(unittest.TestCase):
self.assertEqual(i, rm.body['number'])
da = rm.instructions
self.assertEqual(da.__class__, dict)
- self.assertEqual(da['qdx.ingress'], 'Qpid.Dispatch.Router.A')
- self.assertEqual(da['qdx.trace'], ['first.hop', 'Qpid.Dispatch.Router.A'])
+ self.assertEqual(da['qdx.ingress'], '_topo/area/Qpid.Dispatch.Router.A/')
+ self.assertEqual(da['qdx.trace'], ['first.hop', '_topo/area/Qpid.Dispatch.Router.A/'])
M1.stop()
M2.stop()
diff --git a/qpid/extras/dispatch/tests/tool_test.c b/qpid/extras/dispatch/tests/tool_test.c
index ba047d928c..2c90714b3d 100644
--- a/qpid/extras/dispatch/tests/tool_test.c
+++ b/qpid/extras/dispatch/tests/tool_test.c
@@ -21,6 +21,8 @@
#include <stdio.h>
#include <string.h>
#include <qpid/dispatch/ctools.h>
+#include <qpid/dispatch/bitmask.h>
+#include "alloc_private.h"
typedef struct item_t {
DEQ_LINKS(struct item_t);
@@ -188,12 +190,43 @@ static char* test_deq_basic2(void *context)
}
+static char* test_bitmask(void *context)
+{
+ dx_bitmask_t *bm;
+ int num;
+
+ bm = dx_bitmask(0);
+ if (!bm) return "Can't allocate a bit mask";
+ if (dx_bitmask_first_set(bm, &num)) return "Expected no first set bit";
+
+ dx_bitmask_set_bit(bm, 3);
+ dx_bitmask_set_bit(bm, 500);
+
+ if (!dx_bitmask_first_set(bm, &num)) return "Expected first set bit";
+ if (num != 3) return "Expected first set bit to be 3";
+
+ dx_bitmask_clear_bit(bm, num);
+
+ if (!dx_bitmask_first_set(bm, &num)) return "Expected first set bit (2)";
+ if (num != 500) return "Expected first set bit to be 500";
+
+ dx_bitmask_clear_bit(bm, num);
+ if (dx_bitmask_first_set(bm, &num)) return "Expected no first set bit (2)";
+
+ dx_bitmask_free(bm);
+
+ return 0;
+}
+
+
int tool_tests(void)
{
int result = 0;
+ dx_alloc_initialize();
TEST_CASE(test_deq_basic, 0);
TEST_CASE(test_deq_basic2, 0);
+ TEST_CASE(test_bitmask, 0);
return result;
}
diff --git a/qpid/extras/dispatch/tools/src/py/qdstat b/qpid/extras/dispatch/tools/src/py/qdstat
new file mode 100755
index 0000000000..32594b4d4e
--- /dev/null
+++ b/qpid/extras/dispatch/tools/src/py/qdstat
@@ -0,0 +1,328 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+import os
+from optparse import OptionParser, OptionGroup
+import sys
+import locale
+import socket
+import re
+from proton import Messenger, Message
+
+home = os.environ.get("QD_TOOLS_HOME", os.path.normpath("/usr/share/qd-tools"))
+sys.path.append(os.path.join(home, "python"))
+
+from qdtoollibs import Display, Header, Sorter, YN, Commas, TimeLong
+
+
+class Config:
+ def __init__(self):
+ self._host = "0.0.0.0"
+ self._connTimeout = 10
+ self._types = ""
+ self._limit = 50
+ self._increasing = False
+ self._sortcol = None
+
+config = Config()
+conn_options = {}
+
+def OptionsAndArguments(argv):
+ """ Set global variables for options, return arguments """
+
+ global config
+ global conn_options
+
+ usage = \
+"""%prog -g [options]
+ %prog -c [options]
+ %prog -l [options]
+ %prog -n [options]
+ %prog -a [options]
+ %prog -m [options]"""
+
+ parser = OptionParser(usage=usage)
+
+ group1 = OptionGroup(parser, "General Options")
+ group1.add_option("-b", "--bus", action="store", type="string", default="0.0.0.0", metavar="<url>",
+ help="URL of the messaging bus to connect to")
+ group1.add_option("-t", "--timeout", action="store", type="int", default=10, metavar="<secs>",
+ help="Maximum time to wait for connection (in seconds)")
+ group1.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>",
+ help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ group1.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
+ group1.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
+ parser.add_option_group(group1)
+
+ group2 = OptionGroup(parser, "Command Options")
+ group2.add_option("-g", "--general", help="Show General Broker Stats", action="store_const", const="g", dest="show")
+ group2.add_option("-c", "--connections", help="Show Connections", action="store_const", const="c", dest="show")
+ group2.add_option("-l", "--links", help="Show Router Links", action="store_const", const="l", dest="show")
+ group2.add_option("-n", "--nodes", help="Show Router Nodes", action="store_const", const="n", dest="show")
+ group2.add_option("-a", "--address", help="Show Router Addresses", action="store_const", const="a", dest="show")
+ group2.add_option("-m", "--memory", help="Show Broker Memory Stats", action="store_const", const="m", dest="show")
+ parser.add_option_group(group2)
+
+ opts, args = parser.parse_args(args=argv)
+
+ if not opts.show:
+ parser.error("You must specify one of these options: -g, -c, -l, -n, -a, or -m. For details, try $ qdstat --help")
+
+ config._types = opts.show
+ config._host = opts.bus
+ config._connTimeout = opts.timeout
+
+ return args
+
+
+class BusManager:
+ def __init__(self):
+ pass
+
+ def SetHost(self, host):
+ self.M = Messenger()
+ self.M.start()
+ self.M.route("amqp:/*", "amqp://%s/$1" % host)
+ self.address = "amqp:/_local/$management"
+ self.reply = "amqp:/temp.reply-address/0001" # FIX THIS!
+ self.M.subscribe(self.reply)
+
+ def Disconnect(self):
+ self.M.stop()
+
+ def displayConn(self):
+ pass
+
+ def _addr_class(self, addr):
+ if not addr:
+ return "-"
+ if addr[0] == 'M' : return "mobile"
+ if addr[0] == 'R' : return "router"
+ if addr[0] == 'A' : return "area"
+ if addr[0] == 'L' : return "local"
+ return "unknown: %s" % addr[0]
+
+ def _addr_text(self, addr):
+ if not addr:
+ return "-"
+ return addr[1:]
+
+ def displayRouterLinks(self):
+ disp = Display(prefix=" ")
+ heads = []
+ heads.append(Header("type"))
+ heads.append(Header("dir"))
+ heads.append(Header("rindex"))
+ heads.append(Header("class"))
+ heads.append(Header("addr"))
+ rows = []
+
+ request = Message()
+ response = Message()
+
+ request.address = self.address
+ request.reply_to = self.reply
+ request.correlation_id = 1
+ request.properties = {u'operation':u'GET', u'type':u'org.apache.qpid.dispatch.router.link'}
+
+ self.M.put(request)
+ self.M.send()
+
+ self.M.recv()
+ self.M.get(response)
+
+ for link in response.body:
+ row = []
+ row.append(link['link-type'])
+ row.append(link['link-dir'])
+ if link['link-type'] == "router":
+ row.append(link['index'])
+ else:
+ row.append('-')
+ row.append(self._addr_class(link['owning-addr']))
+ row.append(self._addr_text(link['owning-addr']))
+ rows.append(row)
+ title = "Router Links"
+ dispRows = rows
+ disp.formattedTable(title, heads, dispRows)
+
+ def displayRouterNodes(self):
+ disp = Display(prefix=" ")
+ heads = []
+ heads.append(Header("class"))
+ heads.append(Header("address"))
+ heads.append(Header("rindex"))
+ heads.append(Header("next-hop"))
+ heads.append(Header("link"))
+ rows = []
+
+ request = Message()
+ response = Message()
+
+ request.address = self.address
+ request.reply_to = self.reply
+ request.correlation_id = 1
+ request.properties = {u'operation':u'GET', u'type':u'org.apache.qpid.dispatch.router.node'}
+
+ self.M.put(request)
+ self.M.send()
+
+ self.M.recv()
+ self.M.get(response)
+
+ for node in response.body:
+ row = []
+ row.append(self._addr_class(node['addr']))
+ row.append(self._addr_text(node['addr']))
+ row.append(node['index'])
+ if node['next-hop'] != None:
+ row.append(node['next-hop'])
+ else:
+ row.append('-')
+ if node['router-link'] != None:
+ row.append(node['router-link'])
+ else:
+ row.append('-')
+ rows.append(row)
+ title = "Router Nodes"
+ dispRows = rows
+ disp.formattedTable(title, heads, dispRows)
+
+ def displayAddresses(self):
+ disp = Display(prefix=" ")
+ heads = []
+ heads.append(Header("class"))
+ heads.append(Header("address"))
+ heads.append(Header("in-proc", Header.Y))
+ heads.append(Header("local", Header.COMMAS))
+ heads.append(Header("remote", Header.COMMAS))
+ heads.append(Header("in", Header.COMMAS))
+ heads.append(Header("out", Header.COMMAS))
+ heads.append(Header("thru", Header.COMMAS))
+ heads.append(Header("to-proc", Header.COMMAS))
+ heads.append(Header("from-proc", Header.COMMAS))
+ rows = []
+
+ request = Message()
+ response = Message()
+
+ request.address = self.address
+ request.reply_to = self.reply
+ request.correlation_id = 1
+ request.properties = {u'operation':u'GET', u'type':u'org.apache.qpid.dispatch.router.address'}
+
+ self.M.put(request)
+ self.M.send()
+
+ self.M.recv()
+ self.M.get(response)
+
+ for addr in response.body:
+ row = []
+ row.append(self._addr_class(addr['addr']))
+ row.append(self._addr_text(addr['addr']))
+ row.append(addr['in-process'])
+ row.append(addr['subscriber-count'])
+ row.append(addr['remote-count'])
+ row.append(addr['deliveries-ingress'])
+ row.append(addr['deliveries-egress'])
+ row.append(addr['deliveries-transit'])
+ row.append(addr['deliveries-to-container'])
+ row.append(addr['deliveries-from-container'])
+ rows.append(row)
+ title = "Router Addresses"
+ sorter = Sorter(heads, rows, 'address', 0, True)
+ dispRows = sorter.getSorted()
+ disp.formattedTable(title, heads, dispRows)
+
+ def displayMemory(self):
+ disp = Display(prefix=" ")
+ heads = []
+ heads.append(Header("type"))
+ heads.append(Header("size", Header.COMMAS))
+ heads.append(Header("batch"))
+ heads.append(Header("thread-max", Header.COMMAS))
+ heads.append(Header("total", Header.COMMAS))
+ heads.append(Header("in-threads", Header.COMMAS))
+ heads.append(Header("rebal-in", Header.COMMAS))
+ heads.append(Header("rebal-out", Header.COMMAS))
+ rows = []
+
+ request = Message()
+ response = Message()
+
+ request.address = self.address
+ request.reply_to = self.reply
+ request.correlation_id = 1
+ request.properties = {u'operation':u'GET', u'type':u'org.apache.qpid.dispatch.allocator'}
+
+ self.M.put(request)
+ self.M.send()
+
+ self.M.recv()
+ self.M.get(response)
+
+ for t in response.body:
+ row = []
+ row.append(t['name'])
+ row.append(t['type_size'])
+ row.append(t['transfer_batch_size'])
+ row.append(t['local_free_list_max'])
+ row.append(t['total_alloc_from_heap'])
+ row.append(t['held_by_threads'])
+ row.append(t['batches_rebalanced_to_threads'])
+ row.append(t['batches_rebalanced_to_global'])
+ rows.append(row)
+ title = "Types"
+ sorter = Sorter(heads, rows, 'type', 0, True)
+ dispRows = sorter.getSorted()
+ disp.formattedTable(title, heads, dispRows)
+
+ def displayMain(self, names, main):
+ if main == 'l': self.displayRouterLinks()
+ elif main == 'n': self.displayRouterNodes()
+ elif main == 'a': self.displayAddresses()
+ elif main == 'm': self.displayMemory()
+
+ def display(self, names):
+ self.displayMain(names, config._types)
+
+
+def main(argv=None):
+
+ args = OptionsAndArguments(argv)
+ bm = BusManager()
+
+ try:
+ bm.SetHost(config._host)
+ bm.display(args)
+ bm.Disconnect()
+ return 0
+ except KeyboardInterrupt:
+ print
+ except Exception,e:
+ print "Failed: %s - %s" % (e.__class__.__name__, e)
+
+ bm.Disconnect() # try to deallocate brokers
+ return 1
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/qpid/extras/dispatch/tools/src/py/qdtoollibs/__init__.py b/qpid/extras/dispatch/tools/src/py/qdtoollibs/__init__.py
new file mode 100644
index 0000000000..378bf24ef1
--- /dev/null
+++ b/qpid/extras/dispatch/tools/src/py/qdtoollibs/__init__.py
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+from qdtoollibs.disp import *
+
diff --git a/qpid/extras/dispatch/tools/src/py/qdtoollibs/disp.py b/qpid/extras/dispatch/tools/src/py/qdtoollibs/disp.py
new file mode 100644
index 0000000000..529a727449
--- /dev/null
+++ b/qpid/extras/dispatch/tools/src/py/qdtoollibs/disp.py
@@ -0,0 +1,270 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+from time import strftime, gmtime
+
+def YN(val):
+ if val:
+ return 'Y'
+ return 'N'
+
+def Commas(value):
+ sval = str(value)
+ result = ""
+ while True:
+ if len(sval) == 0:
+ return result
+ left = sval[:-3]
+ right = sval[-3:]
+ result = right + result
+ if len(left) > 0:
+ result = ',' + result
+ sval = left
+
+def TimeLong(value):
+ return strftime("%c", gmtime(value / 1000000000))
+
+def TimeShort(value):
+ return strftime("%X", gmtime(value / 1000000000))
+
+
+class Header:
+ """ """
+ NONE = 1
+ KMG = 2
+ YN = 3
+ Y = 4
+ TIME_LONG = 5
+ TIME_SHORT = 6
+ DURATION = 7
+ COMMAS = 8
+
+ def __init__(self, text, format=NONE):
+ self.text = text
+ self.format = format
+
+ def __repr__(self):
+ return self.text
+
+ def __str__(self):
+ return self.text
+
+ def formatted(self, value):
+ try:
+ if value == None:
+ return ''
+ if self.format == Header.NONE:
+ return value
+ if self.format == Header.KMG:
+ return self.num(value)
+ if self.format == Header.YN:
+ if value:
+ return 'Y'
+ return 'N'
+ if self.format == Header.Y:
+ if value:
+ return 'Y'
+ return ''
+ if self.format == Header.TIME_LONG:
+ return TimeLong(value)
+ if self.format == Header.TIME_SHORT:
+ return TimeShort(value)
+ if self.format == Header.DURATION:
+ if value < 0: value = 0
+ sec = value / 1000000000
+ min = sec / 60
+ hour = min / 60
+ day = hour / 24
+ result = ""
+ if day > 0:
+ result = "%dd " % day
+ if hour > 0 or result != "":
+ result += "%dh " % (hour % 24)
+ if min > 0 or result != "":
+ result += "%dm " % (min % 60)
+ result += "%ds" % (sec % 60)
+ return result
+ if self.format == Header.COMMAS:
+ return Commas(value)
+ except:
+ return "?"
+
+ def numCell(self, value, tag):
+ fp = float(value) / 1000.
+ if fp < 10.0:
+ return "%1.2f%c" % (fp, tag)
+ if fp < 100.0:
+ return "%2.1f%c" % (fp, tag)
+ return "%4d%c" % (value / 1000, tag)
+
+ def num(self, value):
+ if value < 1000:
+ return "%4d" % value
+ if value < 1000000:
+ return self.numCell(value, 'k')
+ value /= 1000
+ if value < 1000000:
+ return self.numCell(value, 'm')
+ value /= 1000
+ return self.numCell(value, 'g')
+
+
+class Display:
+ """ Display formatting """
+
+ def __init__(self, spacing=2, prefix=" "):
+ self.tableSpacing = spacing
+ self.tablePrefix = prefix
+ self.timestampFormat = "%X"
+
+ def formattedTable(self, title, heads, rows):
+ fRows = []
+ for row in rows:
+ fRow = []
+ col = 0
+ for cell in row:
+ fRow.append(heads[col].formatted(cell))
+ col += 1
+ fRows.append(fRow)
+ headtext = []
+ for head in heads:
+ headtext.append(head.text)
+ self.table(title, headtext, fRows)
+
+ def table(self, title, heads, rows):
+ """ Print a table with autosized columns """
+
+ # Pad the rows to the number of heads
+ for row in rows:
+ diff = len(heads) - len(row)
+ for idx in range(diff):
+ row.append("")
+
+ print title
+ if len (rows) == 0:
+ return
+ colWidth = []
+ col = 0
+ line = self.tablePrefix
+ for head in heads:
+ width = len (head)
+ for row in rows:
+ text = row[col]
+ if text.__class__ == str:
+ text = text.decode('utf-8')
+ cellWidth = len(unicode(text))
+ if cellWidth > width:
+ width = cellWidth
+ colWidth.append (width + self.tableSpacing)
+ line = line + head
+ if col < len (heads) - 1:
+ for i in range (colWidth[col] - len (head)):
+ line = line + " "
+ col = col + 1
+ print line
+ line = self.tablePrefix
+ for width in colWidth:
+ for i in range (width):
+ line = line + "="
+ print line
+
+ for row in rows:
+ line = self.tablePrefix
+ col = 0
+ for width in colWidth:
+ text = row[col]
+ if text.__class__ == str:
+ text = text.decode('utf-8')
+ line = line + unicode(text)
+ if col < len (heads) - 1:
+ for i in range (width - len(unicode(text))):
+ line = line + " "
+ col = col + 1
+ print line
+
+ def do_setTimeFormat (self, fmt):
+ """ Select timestamp format """
+ if fmt == "long":
+ self.timestampFormat = "%c"
+ elif fmt == "short":
+ self.timestampFormat = "%X"
+
+ def timestamp (self, nsec):
+ """ Format a nanosecond-since-the-epoch timestamp for printing """
+ return strftime (self.timestampFormat, gmtime (nsec / 1000000000))
+
+ def duration(self, nsec):
+ if nsec < 0: nsec = 0
+ sec = nsec / 1000000000
+ min = sec / 60
+ hour = min / 60
+ day = hour / 24
+ result = ""
+ if day > 0:
+ result = "%dd " % day
+ if hour > 0 or result != "":
+ result += "%dh " % (hour % 24)
+ if min > 0 or result != "":
+ result += "%dm " % (min % 60)
+ result += "%ds" % (sec % 60)
+ return result
+
+class Sortable:
+ """ """
+ def __init__(self, row, sortIndex):
+ self.row = row
+ self.sortIndex = sortIndex
+ if sortIndex >= len(row):
+ raise Exception("sort index exceeds row boundary")
+
+ def __cmp__(self, other):
+ return cmp(self.row[self.sortIndex], other.row[self.sortIndex])
+
+ def getRow(self):
+ return self.row
+
+class Sorter:
+ """ """
+ def __init__(self, heads, rows, sortCol, limit=0, inc=True):
+ col = 0
+ for head in heads:
+ if head.text == sortCol:
+ break
+ col += 1
+ if col == len(heads):
+ raise Exception("sortCol '%s', not found in headers" % sortCol)
+
+ list = []
+ for row in rows:
+ list.append(Sortable(row, col))
+ list.sort()
+ if not inc:
+ list.reverse()
+ count = 0
+ self.sorted = []
+ for row in list:
+ self.sorted.append(row.getRow())
+ count += 1
+ if count == limit:
+ break
+
+ def getSorted(self):
+ return self.sorted
diff --git a/qpid/java/amqp-1-0-client-jms/pom.xml b/qpid/java/amqp-1-0-client-jms/pom.xml
new file mode 100644
index 0000000000..ffcfd223ae
--- /dev/null
+++ b/qpid/java/amqp-1-0-client-jms/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-amqp-1-0-client-jms</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/qpid-amqp-1-0-client-jms-bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/assembly/qpid-amqp-1-0-client-jms-bin.xml b/qpid/java/amqp-1-0-client-jms/src/main/assembly/qpid-amqp-1-0-client-jms-bin.xml
new file mode 100644
index 0000000000..96fd0704bb
--- /dev/null
+++ b/qpid/java/amqp-1-0-client-jms/src/main/assembly/qpid-amqp-1-0-client-jms-bin.xml
@@ -0,0 +1,27 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <baseDirectory>qpid-amqp-1-0-client-jms/${project.version}</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/AmqpMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/AmqpMessage.java
index de42b36ef2..4c8ff9d998 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/AmqpMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/AmqpMessage.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms;
-
-import org.apache.qpid.amqp_1_0.type.Section;
-
-import java.util.ListIterator;
-
-public interface AmqpMessage extends Message
-{
- int getSectionCount();
-
- Section getSection(int position);
-
- ListIterator<Section> sectionIterator();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms;
+
+import org.apache.qpid.amqp_1_0.type.Section;
+
+import java.util.ListIterator;
+
+public interface AmqpMessage extends Message
+{
+ int getSectionCount();
+
+ Section getSection(int position);
+
+ ListIterator<Section> sectionIterator();
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/BytesMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/BytesMessage.java
index 3475319fe4..5ae4c2695a 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/BytesMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/BytesMessage.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface BytesMessage extends Message, javax.jms.BytesMessage
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface BytesMessage extends Message, javax.jms.BytesMessage
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Connection.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Connection.java
index 97447917f6..08e3c4673e 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Connection.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Connection.java
@@ -1,37 +1,37 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-
-public interface Connection extends javax.jms.Connection
-{
-
- ConnectionMetaData getMetaData() throws JMSException;
-
- Session createSession(boolean transacted, int acknowledgeMode) throws JMSException;
-
- Session createSession(Session.AcknowledgeMode acknowledgeMode) throws JMSException;
-
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+
+public interface Connection extends javax.jms.Connection
+{
+
+ ConnectionMetaData getMetaData() throws JMSException;
+
+ Session createSession(boolean transacted, int acknowledgeMode) throws JMSException;
+
+ Session createSession(Session.AcknowledgeMode acknowledgeMode) throws JMSException;
+
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ConnectionMetaData.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ConnectionMetaData.java
index 3802d6e416..425d7f9795 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ConnectionMetaData.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ConnectionMetaData.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface ConnectionMetaData extends javax.jms.ConnectionMetaData
-{
- int getAMQPMajorVersion();
-
- int getAMQPMinorVersion();
-
- int getAMQPRevisionVersion();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface ConnectionMetaData extends javax.jms.ConnectionMetaData
+{
+ int getAMQPMajorVersion();
+
+ int getAMQPMinorVersion();
+
+ int getAMQPRevisionVersion();
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Destination.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Destination.java
index 0b467b3c99..a7f37eea14 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Destination.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Destination.java
@@ -1,28 +1,28 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface Destination extends javax.jms.Destination
-{
- public String getAddress();
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface Destination extends javax.jms.Destination
+{
+ public String getAddress();
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/JavaSerializable.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/JavaSerializable.java
index 0c9179bc2b..0202ac80a7 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/JavaSerializable.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/JavaSerializable.java
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface JavaSerializable
-{
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface JavaSerializable
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MapMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MapMessage.java
index 81754ecc93..a758d04237 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MapMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MapMessage.java
@@ -1,37 +1,37 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-import java.util.Set;
-
-public interface MapMessage extends Message, javax.jms.MapMessage
-{
- public Object get(Object key) throws JMSException;
-
- public Object put(Object key, Object val) throws JMSException;
-
- public boolean itemExists(Object key) throws JMSException;
-
- Set<Object> keySet() throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+import java.util.Set;
+
+public interface MapMessage extends Message, javax.jms.MapMessage
+{
+ public Object get(Object key) throws JMSException;
+
+ public Object put(Object key, Object val) throws JMSException;
+
+ public boolean itemExists(Object key) throws JMSException;
+
+ Set<Object> keySet() throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Message.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Message.java
index 1481c54ee1..1e774abbd6 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Message.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Message.java
@@ -1,178 +1,178 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import org.apache.qpid.amqp_1_0.messaging.MessageAttributes;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.UnsignedByte;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.UnsignedLong;
-import org.apache.qpid.amqp_1_0.type.UnsignedShort;
-
-import javax.jms.JMSException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-
-public interface Message extends javax.jms.Message
-{
-
- Destination getJMSReplyTo() throws JMSException;
-
- Destination getJMSDestination() throws JMSException;
-
- // properties can be keyed by any valid apache.qpid.amqp_1_0 datatype, not just strings
-
- boolean propertyExists(Object name) throws JMSException;
-
- boolean getBooleanProperty(Object name) throws JMSException;
-
- byte getByteProperty(Object name) throws JMSException;
-
- short getShortProperty(Object name) throws JMSException;
-
- int getIntProperty(Object name) throws JMSException;
-
- long getLongProperty(Object name) throws JMSException;
-
- float getFloatProperty(Object name) throws JMSException;
-
- double getDoubleProperty(Object name) throws JMSException;
-
- String getStringProperty(Object name) throws JMSException;
-
- Object getObjectProperty(Object name) throws JMSException;
-
- // apache.qpid.amqp_1_0 allows for lists, maps, and unsigned integral data types
-
- List<Object> getListProperty(Object name) throws JMSException;
-
- Map<Object,Object> getMapProperty(Object name) throws JMSException;
-
- UnsignedByte getUnsignedByteProperty(Object name) throws JMSException;
-
- UnsignedShort getUnsignedShortProperty(Object name) throws JMSException;
-
- UnsignedInteger getUnsignedIntProperty(Object name) throws JMSException;
-
- UnsignedLong getUnsignedLongProperty(Object name) throws JMSException;
-
- // properties can be keyed by any valid apache.qpid.amqp_1_0 datatype, not just strings
-
- void setBooleanProperty(Object name, boolean b) throws JMSException;
-
- void setByteProperty(Object name, byte b) throws JMSException;
-
- void setShortProperty(Object name, short i) throws JMSException;
-
- void setIntProperty(Object name, int i) throws JMSException;
-
- void setLongProperty(Object name, long l) throws JMSException;
-
- void setFloatProperty(Object name, float v) throws JMSException;
-
- void setDoubleProperty(Object name, double v) throws JMSException;
-
- void setStringProperty(Object name, String s1) throws JMSException;
-
- void setObjectProperty(Object name, Object o) throws JMSException;
-
- // apache.qpid.amqp_1_0 allows for lists, maps, and unsigned integral data types
-
- void setListProperty(Object name, List<Object> list) throws JMSException;
-
- void setMapProperty(Object name, Map<Object,Object> map) throws JMSException;
-
- void setUnsignedByteProperty(Object name, UnsignedByte b) throws JMSException;
-
- void setUnsignedShortProperty(Object name, UnsignedShort s) throws JMSException;
-
- void setUnsignedIntProperty(Object name, UnsignedInteger i) throws JMSException;
-
- void setUnsignedLongProperty(Object name, UnsignedLong l) throws JMSException;
-
- // delegation accessors for Header section
-
- UnsignedInteger getDeliveryFailures();
-
- void setDeliveryFailures(UnsignedInteger failures);
-
- MessageAttributes getHeaderMessageAttrs();
-
- void setHeaderMessageAttrs(MessageAttributes messageAttrs);
-
- MessageAttributes getHeaderDeliveryAttrs();
-
- void setHeaderDeliveryAttrs(MessageAttributes deliveryAttrs);
-
- Boolean getDurable();
-
- void setDurable(Boolean durable);
-
- UnsignedByte getPriority();
-
- void setPriority(UnsignedByte priority);
-
- Date getTransmitTime();
-
- void setTransmitTime(Date transmitTime);
-
- UnsignedInteger getTtl();
-
- void setTtl(UnsignedInteger ttl);
-
- UnsignedInteger getFormerAcquirers();
-
- void setFormerAcquirers(UnsignedInteger formerAcquirers);
-
- // delegation accessors for Properties section
-
- Object getMessageId();
-
- void setMessageId(Object messageId);
-
- Binary getUserId();
-
- void setUserId(Binary userId);
-
- String getTo();
-
- void setTo(String to);
-
- String getSubject();
-
- void setSubject(String subject);
-
- String getReplyTo();
-
- void setReplyTo(String replyTo);
-
- Object getCorrelationId();
-
- void setCorrelationId(Binary correlationId);
-
- Symbol getContentType();
-
- void setContentType(Symbol contentType);
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import org.apache.qpid.amqp_1_0.messaging.MessageAttributes;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.UnsignedByte;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.UnsignedShort;
+
+import javax.jms.JMSException;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+
+public interface Message extends javax.jms.Message
+{
+
+ Destination getJMSReplyTo() throws JMSException;
+
+ Destination getJMSDestination() throws JMSException;
+
+ // properties can be keyed by any valid apache.qpid.amqp_1_0 datatype, not just strings
+
+ boolean propertyExists(Object name) throws JMSException;
+
+ boolean getBooleanProperty(Object name) throws JMSException;
+
+ byte getByteProperty(Object name) throws JMSException;
+
+ short getShortProperty(Object name) throws JMSException;
+
+ int getIntProperty(Object name) throws JMSException;
+
+ long getLongProperty(Object name) throws JMSException;
+
+ float getFloatProperty(Object name) throws JMSException;
+
+ double getDoubleProperty(Object name) throws JMSException;
+
+ String getStringProperty(Object name) throws JMSException;
+
+ Object getObjectProperty(Object name) throws JMSException;
+
+ // apache.qpid.amqp_1_0 allows for lists, maps, and unsigned integral data types
+
+ List<Object> getListProperty(Object name) throws JMSException;
+
+ Map<Object,Object> getMapProperty(Object name) throws JMSException;
+
+ UnsignedByte getUnsignedByteProperty(Object name) throws JMSException;
+
+ UnsignedShort getUnsignedShortProperty(Object name) throws JMSException;
+
+ UnsignedInteger getUnsignedIntProperty(Object name) throws JMSException;
+
+ UnsignedLong getUnsignedLongProperty(Object name) throws JMSException;
+
+ // properties can be keyed by any valid apache.qpid.amqp_1_0 datatype, not just strings
+
+ void setBooleanProperty(Object name, boolean b) throws JMSException;
+
+ void setByteProperty(Object name, byte b) throws JMSException;
+
+ void setShortProperty(Object name, short i) throws JMSException;
+
+ void setIntProperty(Object name, int i) throws JMSException;
+
+ void setLongProperty(Object name, long l) throws JMSException;
+
+ void setFloatProperty(Object name, float v) throws JMSException;
+
+ void setDoubleProperty(Object name, double v) throws JMSException;
+
+ void setStringProperty(Object name, String s1) throws JMSException;
+
+ void setObjectProperty(Object name, Object o) throws JMSException;
+
+ // apache.qpid.amqp_1_0 allows for lists, maps, and unsigned integral data types
+
+ void setListProperty(Object name, List<Object> list) throws JMSException;
+
+ void setMapProperty(Object name, Map<Object,Object> map) throws JMSException;
+
+ void setUnsignedByteProperty(Object name, UnsignedByte b) throws JMSException;
+
+ void setUnsignedShortProperty(Object name, UnsignedShort s) throws JMSException;
+
+ void setUnsignedIntProperty(Object name, UnsignedInteger i) throws JMSException;
+
+ void setUnsignedLongProperty(Object name, UnsignedLong l) throws JMSException;
+
+ // delegation accessors for Header section
+
+ UnsignedInteger getDeliveryFailures();
+
+ void setDeliveryFailures(UnsignedInteger failures);
+
+ MessageAttributes getHeaderMessageAttrs();
+
+ void setHeaderMessageAttrs(MessageAttributes messageAttrs);
+
+ MessageAttributes getHeaderDeliveryAttrs();
+
+ void setHeaderDeliveryAttrs(MessageAttributes deliveryAttrs);
+
+ Boolean getDurable();
+
+ void setDurable(Boolean durable);
+
+ UnsignedByte getPriority();
+
+ void setPriority(UnsignedByte priority);
+
+ Date getTransmitTime();
+
+ void setTransmitTime(Date transmitTime);
+
+ UnsignedInteger getTtl();
+
+ void setTtl(UnsignedInteger ttl);
+
+ UnsignedInteger getFormerAcquirers();
+
+ void setFormerAcquirers(UnsignedInteger formerAcquirers);
+
+ // delegation accessors for Properties section
+
+ Object getMessageId();
+
+ void setMessageId(Object messageId);
+
+ Binary getUserId();
+
+ void setUserId(Binary userId);
+
+ String getTo();
+
+ void setTo(String to);
+
+ String getSubject();
+
+ void setSubject(String subject);
+
+ String getReplyTo();
+
+ void setReplyTo(String replyTo);
+
+ Object getCorrelationId();
+
+ void setCorrelationId(Binary correlationId);
+
+ Symbol getContentType();
+
+ void setContentType(Symbol contentType);
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageConsumer.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageConsumer.java
index fe235f098f..7c28a7ef7e 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageConsumer.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageConsumer.java
@@ -1,36 +1,36 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-
-public interface MessageConsumer extends javax.jms.MessageConsumer
-{
-
- Message receive() throws JMSException;
-
- Message receive(long l) throws JMSException;
-
- Message receiveNoWait() throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+
+public interface MessageConsumer extends javax.jms.MessageConsumer
+{
+
+ Message receive() throws JMSException;
+
+ Message receive(long l) throws JMSException;
+
+ Message receiveNoWait() throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageProducer.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageProducer.java
index 98987c2409..19090e713c 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageProducer.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageProducer.java
@@ -1,27 +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.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-
-public interface MessageProducer extends javax.jms.MessageProducer
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+
+public interface MessageProducer extends javax.jms.MessageProducer
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageRejectedException.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageRejectedException.java
index bc2b6349c8..fa559e060f 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageRejectedException.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/MessageRejectedException.java
@@ -22,8 +22,13 @@ import javax.jms.JMSException;
public class MessageRejectedException extends JMSException
{
- public MessageRejectedException(String s)
+ public MessageRejectedException(String reason)
{
- super(s);
+ super(reason);
+ }
+
+ public MessageRejectedException(java.lang.String reason, java.lang.String errorCode)
+ {
+ super(reason, errorCode);
}
}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ObjectMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ObjectMessage.java
index 8b59aa284a..4dcd96d1ec 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ObjectMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/ObjectMessage.java
@@ -1,27 +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.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface ObjectMessage extends Message, javax.jms.ObjectMessage
-{
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface ObjectMessage extends Message, javax.jms.ObjectMessage
+{
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Queue.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Queue.java
index 40beac08d1..880eadea9b 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Queue.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Queue.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface Queue extends Destination, javax.jms.Queue
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface Queue extends Destination, javax.jms.Queue
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueBrowser.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueBrowser.java
index 5bb88569a1..b6d20cbdd5 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueBrowser.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueBrowser.java
@@ -1,30 +1,30 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface QueueBrowser extends javax.jms.QueueBrowser
-{
- Queue getQueue() throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface QueueBrowser extends javax.jms.QueueBrowser
+{
+ Queue getQueue() throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueConnection.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueConnection.java
index 1375f1c5f2..5404fbeb56 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueConnection.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueConnection.java
@@ -1,30 +1,30 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface QueueConnection extends javax.jms.QueueConnection, Connection
-{
- QueueSession createQueueSession(boolean b, int i) throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface QueueConnection extends javax.jms.QueueConnection, Connection
+{
+ QueueSession createQueueSession(boolean b, int i) throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueReceiver.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueReceiver.java
index 9cc1a36ca7..3b2fcb7b45 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueReceiver.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueReceiver.java
@@ -1,29 +1,29 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface QueueReceiver extends MessageConsumer, javax.jms.QueueReceiver
-{
- Queue getQueue() throws JMSException;
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface QueueReceiver extends MessageConsumer, javax.jms.QueueReceiver
+{
+ Queue getQueue() throws JMSException;
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSender.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSender.java
index 824e48364c..27116463d1 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSender.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSender.java
@@ -1,29 +1,29 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface QueueSender extends MessageProducer, javax.jms.QueueSender
-{
- Queue getQueue() throws JMSException;
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface QueueSender extends MessageProducer, javax.jms.QueueSender
+{
+ Queue getQueue() throws JMSException;
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSession.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSession.java
index 28d30f60c5..4ccd5d96a6 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSession.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/QueueSession.java
@@ -1,42 +1,42 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-
-public interface QueueSession extends Session, javax.jms.QueueSession
-{
- Queue createQueue(String s) throws JMSException;
-
- QueueReceiver createReceiver(javax.jms.Queue queue) throws JMSException;
-
- QueueReceiver createReceiver(javax.jms.Queue queue, String s) throws JMSException;
-
- QueueSender createSender(javax.jms.Queue queue) throws JMSException;
-
- QueueBrowser createBrowser(javax.jms.Queue queue) throws JMSException;
-
- QueueBrowser createBrowser(javax.jms.Queue queue, String s) throws JMSException;
-
- TemporaryQueue createTemporaryQueue() throws JMSException;
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+
+public interface QueueSession extends Session, javax.jms.QueueSession
+{
+ Queue createQueue(String s) throws JMSException;
+
+ QueueReceiver createReceiver(javax.jms.Queue queue) throws JMSException;
+
+ QueueReceiver createReceiver(javax.jms.Queue queue, String s) throws JMSException;
+
+ QueueSender createSender(javax.jms.Queue queue) throws JMSException;
+
+ QueueBrowser createBrowser(javax.jms.Queue queue) throws JMSException;
+
+ QueueBrowser createBrowser(javax.jms.Queue queue, String s) throws JMSException;
+
+ TemporaryQueue createTemporaryQueue() throws JMSException;
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Session.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Session.java
index 0ce9baecea..387bfeddb1 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Session.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Session.java
@@ -1,75 +1,75 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.Topic;
-
-
-import java.io.Serializable;
-
-public interface Session extends javax.jms.Session
-{
- static enum AcknowledgeMode { SESSION_TRANSACTED, AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE };
-
- BytesMessage createBytesMessage() throws JMSException;
-
- MapMessage createMapMessage() throws JMSException;
-
- Message createMessage() throws JMSException;
-
- ObjectMessage createObjectMessage() throws JMSException;
-
- ObjectMessage createObjectMessage(Serializable serializable) throws JMSException;
-
- StreamMessage createStreamMessage() throws JMSException;
-
- TextMessage createTextMessage() throws JMSException;
-
- TextMessage createTextMessage(String s) throws JMSException;
-
- AmqpMessage createAmqpMessage() throws JMSException;
-
- MessageProducer createProducer(Destination destination) throws JMSException;
-
- MessageConsumer createConsumer(Destination destination) throws JMSException;
-
- MessageConsumer createConsumer(Destination destination, String s) throws JMSException;
-
- MessageConsumer createConsumer(Destination destination, String s, boolean b) throws JMSException;
-
- TopicSubscriber createDurableSubscriber(Topic topic, String s) throws JMSException;
-
- TopicSubscriber createDurableSubscriber(Topic topic, String s, String s1, boolean b)
- throws JMSException;
-
- QueueBrowser createBrowser(Queue queue) throws JMSException;
-
- QueueBrowser createBrowser(Queue queue, String s) throws JMSException;
-
- TemporaryQueue createTemporaryQueue() throws JMSException;
-
- TemporaryTopic createTemporaryTopic() throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+
+import java.io.Serializable;
+
+public interface Session extends javax.jms.Session
+{
+ static enum AcknowledgeMode { SESSION_TRANSACTED, AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE };
+
+ BytesMessage createBytesMessage() throws JMSException;
+
+ MapMessage createMapMessage() throws JMSException;
+
+ Message createMessage() throws JMSException;
+
+ ObjectMessage createObjectMessage() throws JMSException;
+
+ ObjectMessage createObjectMessage(Serializable serializable) throws JMSException;
+
+ StreamMessage createStreamMessage() throws JMSException;
+
+ TextMessage createTextMessage() throws JMSException;
+
+ TextMessage createTextMessage(String s) throws JMSException;
+
+ AmqpMessage createAmqpMessage() throws JMSException;
+
+ MessageProducer createProducer(Destination destination) throws JMSException;
+
+ MessageConsumer createConsumer(Destination destination) throws JMSException;
+
+ MessageConsumer createConsumer(Destination destination, String s) throws JMSException;
+
+ MessageConsumer createConsumer(Destination destination, String s, boolean b) throws JMSException;
+
+ TopicSubscriber createDurableSubscriber(Topic topic, String s) throws JMSException;
+
+ TopicSubscriber createDurableSubscriber(Topic topic, String s, String s1, boolean b)
+ throws JMSException;
+
+ QueueBrowser createBrowser(Queue queue) throws JMSException;
+
+ QueueBrowser createBrowser(Queue queue, String s) throws JMSException;
+
+ TemporaryQueue createTemporaryQueue() throws JMSException;
+
+ TemporaryTopic createTemporaryTopic() throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/StreamMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/StreamMessage.java
index d207a708c9..6fc728f4bb 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/StreamMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/StreamMessage.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface StreamMessage extends Message, javax.jms.StreamMessage
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface StreamMessage extends Message, javax.jms.StreamMessage
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryQueue.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryQueue.java
index 182f9a4c85..e08e4b5996 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryQueue.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryQueue.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface TemporaryQueue extends Queue, TemporaryDestination, javax.jms.TemporaryQueue
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface TemporaryQueue extends Queue, TemporaryDestination, javax.jms.TemporaryQueue
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryTopic.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryTopic.java
index 277681079b..a9ceabdc2a 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryTopic.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TemporaryTopic.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface TemporaryTopic extends Topic, TemporaryDestination, javax.jms.TemporaryTopic
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface TemporaryTopic extends Topic, TemporaryDestination, javax.jms.TemporaryTopic
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TextMessage.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TextMessage.java
index 1dbcd5f84f..d6911e2357 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TextMessage.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TextMessage.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface TextMessage extends Message, javax.jms.TextMessage
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface TextMessage extends Message, javax.jms.TextMessage
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Topic.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Topic.java
index 755d698a04..c401081176 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Topic.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/Topic.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface Topic extends Destination, javax.jms.Topic
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface Topic extends Destination, javax.jms.Topic
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicConnection.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicConnection.java
index 1431c7d2cb..8334a186f5 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicConnection.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicConnection.java
@@ -1,30 +1,30 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface TopicConnection extends Connection, javax.jms.TopicConnection
-{
- TopicSession createTopicSession(boolean b, int i) throws JMSException;
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface TopicConnection extends Connection, javax.jms.TopicConnection
+{
+ TopicSession createTopicSession(boolean b, int i) throws JMSException;
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicPublisher.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicPublisher.java
index dde6c8b606..66aa69b518 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicPublisher.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicPublisher.java
@@ -1,26 +1,26 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-public interface TopicPublisher extends MessageProducer, javax.jms.TopicPublisher
-{
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+public interface TopicPublisher extends MessageProducer, javax.jms.TopicPublisher
+{
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSession.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSession.java
index 2c02ff199e..764d00380b 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSession.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSession.java
@@ -1,43 +1,43 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-
-public interface TopicSession extends Session,javax.jms.TopicSession
-{
- Topic createTopic(String s) throws JMSException;
-
- TopicSubscriber createSubscriber(javax.jms.Topic topic) throws JMSException;
-
- TopicSubscriber createSubscriber(javax.jms.Topic topic, String s, boolean b) throws JMSException;
-
- TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String s) throws JMSException;
-
- TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String s, String s1, boolean b)
- throws JMSException;
-
- TopicPublisher createPublisher(javax.jms.Topic topic) throws JMSException;
-
- TemporaryTopic createTemporaryTopic() throws JMSException;
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+
+public interface TopicSession extends Session,javax.jms.TopicSession
+{
+ Topic createTopic(String s) throws JMSException;
+
+ TopicSubscriber createSubscriber(javax.jms.Topic topic) throws JMSException;
+
+ TopicSubscriber createSubscriber(javax.jms.Topic topic, String s, boolean b) throws JMSException;
+
+ TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String s) throws JMSException;
+
+ TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String s, String s1, boolean b)
+ throws JMSException;
+
+ TopicPublisher createPublisher(javax.jms.Topic topic) throws JMSException;
+
+ TemporaryTopic createTemporaryTopic() throws JMSException;
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSubscriber.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSubscriber.java
index 00e5e9aca9..c0546b8a75 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSubscriber.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/TopicSubscriber.java
@@ -1,29 +1,29 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms;
-
-import javax.jms.JMSException;
-
-public interface TopicSubscriber extends MessageConsumer, javax.jms.TopicSubscriber
-{
- Topic getTopic() throws JMSException;
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms;
+
+import javax.jms.JMSException;
+
+public interface TopicSubscriber extends MessageConsumer, javax.jms.TopicSubscriber
+{
+ Topic getTopic() throws JMSException;
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java
index 0ca629db7e..ed6f86a972 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.AmqpMessage;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
-import org.apache.qpid.amqp_1_0.type.messaging.Footer;
-import org.apache.qpid.amqp_1_0.type.messaging.Header;
-import org.apache.qpid.amqp_1_0.type.messaging.MessageAnnotations;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import java.util.*;
-
-public class AmqpMessageImpl extends MessageImpl implements AmqpMessage
-{
- private List<Section> _sections;
-
- protected AmqpMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, List<Section> sections,
- Footer footer, SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- _sections = sections;
- }
-
- protected AmqpMessageImpl(final SessionImpl session)
- {
- super(new Header(), new MessageAnnotations(new HashMap()), new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
- session);
- _sections = new ArrayList<Section>();
- }
-
- public int getSectionCount()
- {
- return _sections.size();
- }
-
- public Section getSection(final int position)
- {
- return _sections.get(position);
- }
-
- public ListIterator<Section> sectionIterator()
- {
- return _sections.listIterator();
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
- sections.addAll(_sections);
- sections.add(getFooter());
- return sections;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.AmqpMessage;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
+import org.apache.qpid.amqp_1_0.type.messaging.Footer;
+import org.apache.qpid.amqp_1_0.type.messaging.Header;
+import org.apache.qpid.amqp_1_0.type.messaging.MessageAnnotations;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import java.util.*;
+
+public class AmqpMessageImpl extends MessageImpl implements AmqpMessage
+{
+ private List<Section> _sections;
+
+ protected AmqpMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, List<Section> sections,
+ Footer footer, SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ _sections = sections;
+ }
+
+ protected AmqpMessageImpl(final SessionImpl session)
+ {
+ super(new Header(), new MessageAnnotations(new HashMap()), new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
+ session);
+ _sections = new ArrayList<Section>();
+ }
+
+ public int getSectionCount()
+ {
+ return _sections.size();
+ }
+
+ public Section getSection(final int position)
+ {
+ return _sections.get(position);
+ }
+
+ public ListIterator<Section> sectionIterator()
+ {
+ return _sections.listIterator();
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+ sections.addAll(_sections);
+ sections.add(getFooter());
+ return sections;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/BytesMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/BytesMessageImpl.java
index 83cc8eafb5..e45c5a73fe 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/BytesMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/BytesMessageImpl.java
@@ -1,538 +1,538 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.BytesMessage;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import java.io.*;
-import java.util.*;
-
-public class BytesMessageImpl extends MessageImpl implements BytesMessage
-{
- private DataInputStream _dataAsInput;
- private DataOutputStream _dataAsOutput;
- private ByteArrayOutputStream _bytesOut;
- private Data _dataIn;
-
- // message created for reading
- protected BytesMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, Data data,
- Footer footer, SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- _dataIn = data;
- final Binary dataBuffer = data.getValue();
- _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));
-
- }
-
- // message created to be sent
- protected BytesMessageImpl(final SessionImpl session)
- {
- super(new Header(),
- new MessageAnnotations(new HashMap()),
- new Properties(),
- new ApplicationProperties(new HashMap()),
- new Footer(Collections.EMPTY_MAP),
- session);
-
- _bytesOut = new ByteArrayOutputStream();
- _dataAsOutput = new DataOutputStream(_bytesOut);
- }
-
-
- private Data getDataSection()
- {
- if(_bytesOut != null)
- {
- return new Data(new Binary(_bytesOut.toByteArray()));
- }
- else
- {
- return _dataIn;
- }
- }
-
- @Override
- protected boolean isReadOnly()
- {
- return _dataIn != null;
- }
-
- public long getBodyLength() throws JMSException
- {
- checkReadable();
- return getDataSection().getValue().getLength();
- }
-
- public boolean readBoolean() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readBoolean();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
-
- public byte readByte() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readByte();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public int readUnsignedByte() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readUnsignedByte();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public short readShort() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readShort();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public int readUnsignedShort() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readUnsignedShort();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public char readChar() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readChar();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public int readInt() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readInt();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public long readLong() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readLong();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public float readFloat() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readFloat();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public double readDouble() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readDouble();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public String readUTF() throws JMSException
- {
- checkReadable();
- try
- {
- return _dataAsInput.readUTF();
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public int readBytes(byte[] bytes) throws JMSException
- {
-
- return readBytes(bytes, bytes.length);
- }
-
- public int readBytes(byte[] bytes, int length) throws JMSException
- {
- checkReadable();
-
- try
- {
- int offset = 0;
- while(offset < length)
- {
- int read = _dataAsInput.read(bytes, offset, length - offset);
- if(read < 0)
- {
- break;
- }
- offset += read;
- }
-
- if(offset == 0 && length != 0)
- {
- return -1;
- }
- else
- {
- return offset;
- }
- }
- catch (IOException e)
- {
- throw handleInputException(e);
- }
- }
-
- public void writeBoolean(boolean b) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeBoolean(b);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
-
- }
-
- public void writeByte(byte b) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeByte(b);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeShort(short i) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeShort(i);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeChar(char c) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeChar(c);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeInt(int i) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeInt(i);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeLong(long l) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeLong(l);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeFloat(float v) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeFloat(v);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeDouble(double v) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeDouble(v);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeUTF(String s) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.writeUTF(s);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeBytes(byte[] bytes) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.write(bytes);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeBytes(byte[] bytes, int off, int len) throws JMSException
- {
- checkWritable();
- try
- {
- _dataAsOutput.write(bytes, off, len);
- }
- catch (IOException e)
- {
- throw handleOutputException(e);
- }
- }
-
- public void writeObject(Object o) throws JMSException
- {
- checkWritable();
- if(o == null)
- {
- throw new NullPointerException("Value passed to BytesMessage.writeObject() must be non null");
- }
- else if (o instanceof Boolean)
- {
- writeBoolean((Boolean)o);
- }
- else if (o instanceof Byte)
- {
- writeByte((Byte)o);
- }
- else if (o instanceof Short)
- {
- writeShort((Short)o);
- }
- else if (o instanceof Character)
- {
- writeChar((Character)o);
- }
- else if (o instanceof Integer)
- {
- writeInt((Integer)o);
- }
- else if(o instanceof Long)
- {
- writeLong((Long)o);
- }
- else if(o instanceof Float)
- {
- writeFloat((Float) o);
- }
- else if(o instanceof Double)
- {
- writeDouble((Double) o);
- }
- else if(o instanceof String)
- {
- writeUTF((String) o);
- }
- else if(o instanceof byte[])
- {
- writeBytes((byte[])o);
- }
- else
- {
- throw new MessageFormatException("Value passed to BytesMessage.writeObject() must be of primitive type. Type passed was " + o.getClass().getName());
- }
- }
-
- public void reset() throws JMSException
- {
- if(_bytesOut != null)
- {
- byte[] data = _bytesOut.toByteArray();
- _dataIn = new Data(new Binary(data));
- _dataAsInput = new DataInputStream(new ByteArrayInputStream(data));
- _dataAsOutput = null;
- _bytesOut = null;
- }
- else
- {
-
- final Binary dataBuffer = _dataIn.getValue();
- _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));
-
- }
- }
-
- private JMSException handleInputException(final IOException e)
- {
- JMSException ex;
- if(e instanceof EOFException)
- {
- ex = new MessageEOFException(e.getMessage());
- }
- else
- {
- ex = new MessageFormatException(e.getMessage());
- }
- ex.initCause(e);
- ex.setLinkedException(e);
- return ex;
- }
-
- private JMSException handleOutputException(final IOException e)
- {
- JMSException ex = new JMSException(e.getMessage());
- ex.initCause(e);
- ex.setLinkedException(e);
- return ex;
- }
-
- @Override
- public void clearBody() throws JMSException
- {
- super.clearBody();
- _bytesOut = new ByteArrayOutputStream();
- _dataAsOutput = new DataOutputStream(_bytesOut);
- _dataAsInput = null;
- _dataIn = null;
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
- sections.add(getDataSection());
- sections.add(getFooter());
- return sections;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.BytesMessage;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageEOFException;
+import javax.jms.MessageFormatException;
+import java.io.*;
+import java.util.*;
+
+public class BytesMessageImpl extends MessageImpl implements BytesMessage
+{
+ private DataInputStream _dataAsInput;
+ private DataOutputStream _dataAsOutput;
+ private ByteArrayOutputStream _bytesOut;
+ private Data _dataIn;
+
+ // message created for reading
+ protected BytesMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, Data data,
+ Footer footer, SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ _dataIn = data;
+ final Binary dataBuffer = data.getValue();
+ _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));
+
+ }
+
+ // message created to be sent
+ protected BytesMessageImpl(final SessionImpl session)
+ {
+ super(new Header(),
+ new MessageAnnotations(new HashMap()),
+ new Properties(),
+ new ApplicationProperties(new HashMap()),
+ new Footer(Collections.EMPTY_MAP),
+ session);
+
+ _bytesOut = new ByteArrayOutputStream();
+ _dataAsOutput = new DataOutputStream(_bytesOut);
+ }
+
+
+ private Data getDataSection()
+ {
+ if(_bytesOut != null)
+ {
+ return new Data(new Binary(_bytesOut.toByteArray()));
+ }
+ else
+ {
+ return _dataIn;
+ }
+ }
+
+ @Override
+ protected boolean isReadOnly()
+ {
+ return _dataIn != null;
+ }
+
+ public long getBodyLength() throws JMSException
+ {
+ checkReadable();
+ return getDataSection().getValue().getLength();
+ }
+
+ public boolean readBoolean() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readBoolean();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+
+ public byte readByte() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readByte();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public int readUnsignedByte() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readUnsignedByte();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public short readShort() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readShort();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public int readUnsignedShort() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readUnsignedShort();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public char readChar() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readChar();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public int readInt() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readInt();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public long readLong() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readLong();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public float readFloat() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readFloat();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public double readDouble() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readDouble();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public String readUTF() throws JMSException
+ {
+ checkReadable();
+ try
+ {
+ return _dataAsInput.readUTF();
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public int readBytes(byte[] bytes) throws JMSException
+ {
+
+ return readBytes(bytes, bytes.length);
+ }
+
+ public int readBytes(byte[] bytes, int length) throws JMSException
+ {
+ checkReadable();
+
+ try
+ {
+ int offset = 0;
+ while(offset < length)
+ {
+ int read = _dataAsInput.read(bytes, offset, length - offset);
+ if(read < 0)
+ {
+ break;
+ }
+ offset += read;
+ }
+
+ if(offset == 0 && length != 0)
+ {
+ return -1;
+ }
+ else
+ {
+ return offset;
+ }
+ }
+ catch (IOException e)
+ {
+ throw handleInputException(e);
+ }
+ }
+
+ public void writeBoolean(boolean b) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeBoolean(b);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+
+ }
+
+ public void writeByte(byte b) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeByte(b);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeShort(short i) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeShort(i);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeChar(char c) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeChar(c);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeInt(int i) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeInt(i);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeLong(long l) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeLong(l);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeFloat(float v) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeFloat(v);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeDouble(double v) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeDouble(v);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeUTF(String s) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.writeUTF(s);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeBytes(byte[] bytes) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.write(bytes);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeBytes(byte[] bytes, int off, int len) throws JMSException
+ {
+ checkWritable();
+ try
+ {
+ _dataAsOutput.write(bytes, off, len);
+ }
+ catch (IOException e)
+ {
+ throw handleOutputException(e);
+ }
+ }
+
+ public void writeObject(Object o) throws JMSException
+ {
+ checkWritable();
+ if(o == null)
+ {
+ throw new NullPointerException("Value passed to BytesMessage.writeObject() must be non null");
+ }
+ else if (o instanceof Boolean)
+ {
+ writeBoolean((Boolean)o);
+ }
+ else if (o instanceof Byte)
+ {
+ writeByte((Byte)o);
+ }
+ else if (o instanceof Short)
+ {
+ writeShort((Short)o);
+ }
+ else if (o instanceof Character)
+ {
+ writeChar((Character)o);
+ }
+ else if (o instanceof Integer)
+ {
+ writeInt((Integer)o);
+ }
+ else if(o instanceof Long)
+ {
+ writeLong((Long)o);
+ }
+ else if(o instanceof Float)
+ {
+ writeFloat((Float) o);
+ }
+ else if(o instanceof Double)
+ {
+ writeDouble((Double) o);
+ }
+ else if(o instanceof String)
+ {
+ writeUTF((String) o);
+ }
+ else if(o instanceof byte[])
+ {
+ writeBytes((byte[])o);
+ }
+ else
+ {
+ throw new MessageFormatException("Value passed to BytesMessage.writeObject() must be of primitive type. Type passed was " + o.getClass().getName());
+ }
+ }
+
+ public void reset() throws JMSException
+ {
+ if(_bytesOut != null)
+ {
+ byte[] data = _bytesOut.toByteArray();
+ _dataIn = new Data(new Binary(data));
+ _dataAsInput = new DataInputStream(new ByteArrayInputStream(data));
+ _dataAsOutput = null;
+ _bytesOut = null;
+ }
+ else
+ {
+
+ final Binary dataBuffer = _dataIn.getValue();
+ _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));
+
+ }
+ }
+
+ private JMSException handleInputException(final IOException e)
+ {
+ JMSException ex;
+ if(e instanceof EOFException)
+ {
+ ex = new MessageEOFException(e.getMessage());
+ }
+ else
+ {
+ ex = new MessageFormatException(e.getMessage());
+ }
+ ex.initCause(e);
+ ex.setLinkedException(e);
+ return ex;
+ }
+
+ private JMSException handleOutputException(final IOException e)
+ {
+ JMSException ex = new JMSException(e.getMessage());
+ ex.initCause(e);
+ ex.setLinkedException(e);
+ return ex;
+ }
+
+ @Override
+ public void clearBody() throws JMSException
+ {
+ super.clearBody();
+ _bytesOut = new ByteArrayOutputStream();
+ _dataAsOutput = new DataOutputStream(_bytesOut);
+ _dataAsInput = null;
+ _dataIn = null;
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+ sections.add(getDataSection());
+ sections.add(getFooter());
+ return sections;
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
index fccee73595..f46840e9ae 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionFactoryImpl.java
@@ -33,6 +33,7 @@ import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import org.apache.qpid.amqp_1_0.jms.ConnectionFactory;
+
public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnectionFactory, QueueConnectionFactory
{
private String _host;
@@ -45,7 +46,10 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
private String _queuePrefix;
private String _topicPrefix;
- private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id", "true"));;
+ private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id", "true"));
+ private boolean _syncPublish = Boolean.parseBoolean(System.getProperty("qpid.sync_publish", "false"));
+ private int _maxSessions = Integer.getInteger("qpid.max_sessions", 0);
+
public ConnectionFactoryImpl(final String host,
final int port,
@@ -82,6 +86,18 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
final String remoteHost,
final boolean ssl)
{
+ this(host, port, username, password, clientId, remoteHost, ssl,0);
+ }
+
+ public ConnectionFactoryImpl(final String host,
+ final int port,
+ final String username,
+ final String password,
+ final String clientId,
+ final String remoteHost,
+ final boolean ssl,
+ final int maxSessions)
+ {
_host = host;
_port = port;
_username = username;
@@ -89,6 +105,7 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
_clientId = clientId;
_remoteHost = remoteHost;
_ssl = ssl;
+ _maxSessions = maxSessions;
}
public ConnectionImpl createConnection() throws JMSException
@@ -98,10 +115,11 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
public ConnectionImpl createConnection(final String username, final String password) throws JMSException
{
- ConnectionImpl connection = new ConnectionImpl(_host, _port, username, password, _clientId, _remoteHost, _ssl);
+ ConnectionImpl connection = new ConnectionImpl(_host, _port, username, password, _clientId, _remoteHost, _ssl, _maxSessions);
connection.setQueuePrefix(_queuePrefix);
connection.setTopicPrefix(_topicPrefix);
connection.setUseBinaryMessageId(_useBinaryMessageId);
+ connection.setSyncPublish(_syncPublish);
return connection;
}
@@ -153,6 +171,8 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
String remoteHost = null;
boolean binaryMessageId = true;
+ boolean syncPublish = false;
+ int maxSessions = 0;
if(userInfo != null)
{
@@ -185,6 +205,14 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
{
binaryMessageId = Boolean.parseBoolean(keyValuePair[1]);
}
+ else if (keyValuePair[0].equalsIgnoreCase("sync-publish"))
+ {
+ syncPublish = Boolean.parseBoolean(keyValuePair[1]);
+ }
+ else if(keyValuePair[0].equalsIgnoreCase("max-sessions"))
+ {
+ maxSessions = Integer.parseInt(keyValuePair[1]);
+ }
}
}
@@ -194,8 +222,9 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
}
ConnectionFactoryImpl connectionFactory =
- new ConnectionFactoryImpl(host, port, username, password, clientId, remoteHost, ssl);
+ new ConnectionFactoryImpl(host, port, username, password, clientId, remoteHost, ssl, maxSessions);
connectionFactory.setUseBinaryMessageId(binaryMessageId);
+ connectionFactory.setSyncPublish(syncPublish);
return connectionFactory;
@@ -253,4 +282,9 @@ public class ConnectionFactoryImpl implements ConnectionFactory, TopicConnection
{
_useBinaryMessageId = useBinaryMessageId;
}
+
+ public void setSyncPublish(boolean syncPublish)
+ {
+ _syncPublish = syncPublish;
+ }
}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
index 09335e3c74..80875fcfa7 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
@@ -1,525 +1,574 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.ConnectionException;
-import org.apache.qpid.amqp_1_0.jms.Connection;
-import org.apache.qpid.amqp_1_0.jms.ConnectionMetaData;
-import org.apache.qpid.amqp_1_0.jms.Session;
-import org.apache.qpid.amqp_1_0.transport.Container;
-
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-import javax.jms.Queue;
-import java.util.*;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.transport.*;
-import org.apache.qpid.amqp_1_0.type.transport.Error;
-
-public class ConnectionImpl implements Connection, QueueConnection, TopicConnection
-{
-
- private ConnectionMetaData _connectionMetaData;
- private volatile ExceptionListener _exceptionListener;
-
- private final List<SessionImpl> _sessions = new ArrayList<SessionImpl>();
-
- private final Object _lock = new Object();
-
- private org.apache.qpid.amqp_1_0.client.Connection _conn;
- private boolean _isQueueConnection;
- private boolean _isTopicConnection;
- private final Collection<CloseTask> _closeTasks = new ArrayList<CloseTask>();
- private String _host;
- private int _port;
- private final String _username;
- private final String _password;
- private String _remoteHost;
- private final boolean _ssl;
- private String _clientId;
- private String _queuePrefix;
- private String _topicPrefix;
- private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id", "true"));
-
- private static enum State
- {
- UNCONNECTED,
- STOPPED,
- STARTED,
- CLOSED
- }
-
- private volatile State _state = State.UNCONNECTED;
-
- public ConnectionImpl(String host, int port, String username, String password, String clientId) throws JMSException
- {
- this(host,port,username,password,clientId,false);
- }
-
- public ConnectionImpl(String host, int port, String username, String password, String clientId, boolean ssl) throws JMSException
- {
- this(host,port,username,password,clientId,null,ssl);
- }
-
- public ConnectionImpl(String host, int port, String username, String password, String clientId, String remoteHost, boolean ssl) throws JMSException
- {
- _host = host;
- _port = port;
- _username = username;
- _password = password;
- _clientId = clientId;
- _remoteHost = remoteHost;
- _ssl = ssl;
- }
-
- private void connect() throws JMSException
- {
- synchronized(_lock)
- {
- // already connected?
- if( _state == State.UNCONNECTED )
- {
- _state = State.STOPPED;
-
- Container container = _clientId == null ? new Container() : new Container(_clientId);
- // TODO - authentication, containerId, clientId, ssl?, etc
- try
- {
- _conn = new org.apache.qpid.amqp_1_0.client.Connection(_host,
- _port, _username, _password, container, _remoteHost, _ssl);
- // TODO - retrieve negotiated AMQP version
- _connectionMetaData = new ConnectionMetaDataImpl(1,0,0);
- }
- catch (ConnectionException e)
- {
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.setLinkedException(e);
- jmsEx.initCause(e);
- throw jmsEx;
- }
- }
- }
- }
-
- private void checkNotConnected(String msg) throws IllegalStateException
- {
- synchronized(_lock)
- {
- if( _state != State.UNCONNECTED )
- {
- throw new IllegalStateException(msg);
- }
- }
- }
-
- public SessionImpl createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
- {
- Session.AcknowledgeMode ackMode;
-
- try
- {
- ackMode = transacted ? Session.AcknowledgeMode.SESSION_TRANSACTED
- : Session.AcknowledgeMode.values()[acknowledgeMode];
- }
- catch (IndexOutOfBoundsException e)
- {
- JMSException jmsEx = new JMSException("Unknown acknowledgement mode " + acknowledgeMode);
- jmsEx.setLinkedException(e);
- jmsEx.initCause(e);
- throw jmsEx;
- }
-
- return createSession(ackMode);
- }
-
- public SessionImpl createSession(final Session.AcknowledgeMode acknowledgeMode) throws JMSException
- {
- boolean started = false;
- synchronized(_lock)
- {
- if(_state == State.CLOSED)
- {
- throw new IllegalStateException("Cannot create a session on a closed connection");
- }
- else if(_state == State.UNCONNECTED)
- {
- connect();
- started = true;
- }
-
- try
- {
- SessionImpl session = new SessionImpl(this, acknowledgeMode);
- session.setQueueSession(_isQueueConnection);
- session.setTopicSession(_isTopicConnection);
- _sessions.add(session);
-
- if(_state == State.STARTED)
- {
- session.start();
- }
-
- return session;
- }
- catch(JMSException e)
- {
- Error remoteError;
- if(started
- && e.getLinkedException() instanceof ConnectionErrorException
- && (remoteError = ((ConnectionErrorException)e.getLinkedException()).getRemoteError()).getCondition() == ConnectionError.REDIRECT)
- {
- String networkHost = (String) remoteError.getInfo().get(Symbol.valueOf("network-host"));
- int port = (Integer) remoteError.getInfo().get(Symbol.valueOf("port"));
- String hostName = (String) remoteError.getInfo().get(Symbol.valueOf("hostname"));
- reconnect(networkHost,port,hostName);
- return createSession(acknowledgeMode);
-
- }
- else
- {
- throw e;
- }
- }
- }
-
-
- }
-
- void removeSession(SessionImpl session)
- {
- synchronized (_lock)
- {
- _sessions.remove(session);
- }
- }
-
- private void reconnect(String networkHost, int port, String hostName)
- {
- synchronized(_lock)
- {
- _state = State.UNCONNECTED;
- _host = networkHost;
- _port = port;
- _remoteHost = hostName;
- _conn = null;
- }
- }
-
- public String getClientID() throws JMSException
- {
- checkClosed();
- return _clientId;
- }
-
- public void setClientID(final String value) throws JMSException
- {
- checkNotConnected("Cannot set client-id to \""
- + value
- + "\"; client-id must be set before the connection is used");
- if( _clientId !=null )
- {
- throw new IllegalStateException("client-id has already been set");
- }
- _clientId = value;
- }
-
- public ConnectionMetaData getMetaData() throws JMSException
- {
- checkClosed();
- return _connectionMetaData;
- }
-
- public ExceptionListener getExceptionListener() throws JMSException
- {
- checkClosed();
- return _exceptionListener;
- }
-
- public void setExceptionListener(final ExceptionListener exceptionListener) throws JMSException
- {
- checkClosed();
- _exceptionListener = exceptionListener;
- }
-
- public void start() throws JMSException
- {
- synchronized(_lock)
- {
- checkClosed();
- connect();
- if(_state == State.STOPPED)
- {
- // TODO
-
- _state = State.STARTED;
-
- for(SessionImpl session : _sessions)
- {
- session.start();
- }
-
- }
-
- _lock.notifyAll();
- }
-
- }
-
- public void stop() throws JMSException
- {
- synchronized(_lock)
- {
- switch(_state)
- {
- case STARTED:
- for(SessionImpl session : _sessions)
- {
- session.stop();
- }
- case UNCONNECTED:
- _state = State.STOPPED;
- break;
- case CLOSED:
- throw new javax.jms.IllegalStateException("Closed");
- }
-
- _lock.notifyAll();
- }
- }
-
-
- static interface CloseTask
- {
- public void onClose() throws JMSException;
- }
-
- void addOnCloseTask(CloseTask task)
- {
- synchronized (_lock)
- {
- _closeTasks.add(task);
- }
- }
-
-
- void removeOnCloseTask(CloseTask task)
- {
- synchronized (_lock)
- {
- _closeTasks.remove(task);
- }
- }
-
- public void close() throws JMSException
- {
- synchronized(_lock)
- {
- if(_state != State.CLOSED)
- {
- stop();
- List<SessionImpl> sessions = new ArrayList<SessionImpl>(_sessions);
- for(SessionImpl session : sessions)
- {
- session.close();
- }
- for(CloseTask task : _closeTasks)
- {
- task.onClose();
- }
- if(_conn != null && _state != State.UNCONNECTED ) {
- _conn.close();
- }
- _state = State.CLOSED;
- }
-
- _lock.notifyAll();
- }
- }
-
- private void checkClosed() throws IllegalStateException
- {
- if(_state == State.CLOSED)
- throw new IllegalStateException("Closed");
- }
-
- public ConnectionConsumer createConnectionConsumer(final Destination destination,
- final String s,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- checkClosed();
- return null; //TODO
- }
-
- public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
- {
- checkClosed();
- SessionImpl session = createSession(transacted, acknowledgeMode);
- session.setTopicSession(true);
- return session;
- }
-
- public ConnectionConsumer createConnectionConsumer(final Topic topic,
- final String s,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- checkClosed();
- return null; //TODO
- }
-
- public ConnectionConsumer createDurableConnectionConsumer(final Topic topic,
- final String s,
- final String s1,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- checkClosed();
- if (_isQueueConnection)
- {
- throw new IllegalStateException("QueueConnection cannot be used to create Pub/Sub based resources.");
- }
- return null; //TODO
- }
-
- public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
- {
- checkClosed();
- SessionImpl session = createSession(transacted, acknowledgeMode);
- session.setQueueSession(true);
- return session;
- }
-
- public ConnectionConsumer createConnectionConsumer(final Queue queue,
- final String s,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- checkClosed();
- return null; //TODO
- }
-
-
-
- protected org.apache.qpid.amqp_1_0.client.Connection getClientConnection()
- {
- return _conn;
- }
-
- public boolean isStarted()
- {
- return _state == State.STARTED;
- }
-
- void setQueueConnection(final boolean queueConnection)
- {
- _isQueueConnection = queueConnection;
- }
-
- void setTopicConnection(final boolean topicConnection)
- {
- _isTopicConnection = topicConnection;
- }
-
- public String getTopicPrefix()
- {
- return _topicPrefix;
- }
-
- public void setTopicPrefix(String topicPrefix)
- {
- _topicPrefix = topicPrefix;
- }
-
- public String getQueuePrefix()
- {
- return _queuePrefix;
- }
-
- public void setQueuePrefix(String queueprefix)
- {
- _queuePrefix = queueprefix;
- }
-
- DecodedDestination toDecodedDestination(DestinationImpl dest)
- {
- String address = dest.getAddress();
- Set<String> kind = null;
- Class clazz = dest.getClass();
- if( clazz==QueueImpl.class )
- {
- kind = MessageImpl.JMS_QUEUE_ATTRIBUTES;
- if( _queuePrefix!=null )
- {
- // Avoid double prefixing..
- if( !address.startsWith(_queuePrefix) )
- {
- address = _queuePrefix+address;
- }
- }
- }
- else if( clazz==TopicImpl.class )
- {
- kind = MessageImpl.JMS_TOPIC_ATTRIBUTES;
- if( _topicPrefix!=null )
- {
- // Avoid double prefixing..
- if( !address.startsWith(_topicPrefix) )
- {
- address = _topicPrefix+address;
- }
- }
- }
- else if( clazz==TemporaryQueueImpl.class )
- {
- kind = MessageImpl.JMS_TEMP_QUEUE_ATTRIBUTES;
- }
- else if( clazz==TemporaryTopicImpl.class )
- {
- kind = MessageImpl.JMS_TEMP_TOPIC_ATTRIBUTES;
- }
- return new DecodedDestination(address, kind);
- }
-
- DecodedDestination toDecodedDestination(String address, Set<String> kind)
- {
- if( (kind == null || kind.equals(MessageImpl.JMS_QUEUE_ATTRIBUTES)) && _queuePrefix!=null && address.startsWith(_queuePrefix))
- {
- return new DecodedDestination(address.substring(_queuePrefix.length()), MessageImpl.JMS_QUEUE_ATTRIBUTES);
- }
- if( (kind == null || kind.equals(MessageImpl.JMS_TOPIC_ATTRIBUTES)) && _topicPrefix!=null && address.startsWith(_topicPrefix))
- {
- return new DecodedDestination(address.substring(_topicPrefix.length()), MessageImpl.JMS_TOPIC_ATTRIBUTES);
- }
- return new DecodedDestination(address, kind);
- }
-
- void setUseBinaryMessageId(boolean useBinaryMessageId)
- {
- _useBinaryMessageId = useBinaryMessageId;
- }
-
- boolean useBinaryMessageId()
- {
- return _useBinaryMessageId;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.ConnectionException;
+import org.apache.qpid.amqp_1_0.jms.Connection;
+import org.apache.qpid.amqp_1_0.jms.ConnectionMetaData;
+import org.apache.qpid.amqp_1_0.jms.Session;
+import org.apache.qpid.amqp_1_0.transport.Container;
+
+import javax.jms.*;
+import javax.jms.IllegalStateException;
+import javax.jms.Queue;
+
+import java.util.*;
+
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class ConnectionImpl implements Connection, QueueConnection, TopicConnection
+{
+
+ private ConnectionMetaData _connectionMetaData;
+ private volatile ExceptionListener _exceptionListener;
+
+ private final List<SessionImpl> _sessions = new ArrayList<SessionImpl>();
+
+ private final Object _lock = new Object();
+
+ private org.apache.qpid.amqp_1_0.client.Connection _conn;
+ private boolean _isQueueConnection;
+ private boolean _isTopicConnection;
+ private final Collection<CloseTask> _closeTasks = new ArrayList<CloseTask>();
+ private String _host;
+ private int _port;
+ private final String _username;
+ private final String _password;
+ private String _remoteHost;
+ private final boolean _ssl;
+ private String _clientId;
+ private String _queuePrefix;
+ private String _topicPrefix;
+ private boolean _useBinaryMessageId = Boolean.parseBoolean(System.getProperty("qpid.use_binary_message_id", "true"));
+ private boolean _syncPublish = Boolean.parseBoolean(System.getProperty("qpid.sync_publish", "false"));
+ private int _maxSessions;
+
+ private static enum State
+ {
+ UNCONNECTED,
+ STOPPED,
+ STARTED,
+ CLOSED
+ }
+
+ private volatile State _state = State.UNCONNECTED;
+
+ public ConnectionImpl(String host, int port, String username, String password, String clientId) throws JMSException
+ {
+ this(host,port,username,password,clientId,false);
+ }
+
+ public ConnectionImpl(String host, int port, String username, String password, String clientId, boolean ssl) throws JMSException
+ {
+ this(host,port,username,password,clientId,null,ssl);
+ }
+
+ public ConnectionImpl(String host, int port, String username, String password, String clientId, String remoteHost, boolean ssl) throws JMSException
+ {
+ this(host, port, username, password, clientId, remoteHost, ssl,0);
+ }
+
+ public ConnectionImpl(String host, int port, String username, String password, String clientId, String remoteHost, boolean ssl, int maxSessions) throws JMSException
+ {
+ _host = host;
+ _port = port;
+ _username = username;
+ _password = password;
+ _clientId = clientId;
+ _remoteHost = remoteHost;
+ _ssl = ssl;
+ _maxSessions = maxSessions;
+ }
+
+ private void connect() throws JMSException
+ {
+ synchronized(_lock)
+ {
+ // already connected?
+ if( _state == State.UNCONNECTED )
+ {
+ _state = State.STOPPED;
+
+ Container container = _clientId == null ? new Container() : new Container(_clientId);
+ // TODO - authentication, containerId, clientId, ssl?, etc
+ try
+ {
+ _conn = new org.apache.qpid.amqp_1_0.client.Connection(_host,
+ _port, _username, _password, container, _remoteHost, _ssl,
+ _maxSessions - 1);
+ _conn.setConnectionErrorTask(new ConnectionErrorTask());
+ // TODO - retrieve negotiated AMQP version
+ _connectionMetaData = new ConnectionMetaDataImpl(1,0,0);
+ }
+ catch (ConnectionException e)
+ {
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.setLinkedException(e);
+ jmsEx.initCause(e);
+ throw jmsEx;
+ }
+ }
+ }
+ }
+
+ private void checkNotConnected(String msg) throws IllegalStateException
+ {
+ synchronized(_lock)
+ {
+ if( _state != State.UNCONNECTED )
+ {
+ throw new IllegalStateException(msg);
+ }
+ }
+ }
+
+ public SessionImpl createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+ {
+ Session.AcknowledgeMode ackMode;
+
+ try
+ {
+ ackMode = transacted ? Session.AcknowledgeMode.SESSION_TRANSACTED
+ : Session.AcknowledgeMode.values()[acknowledgeMode];
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ JMSException jmsEx = new JMSException("Unknown acknowledgement mode " + acknowledgeMode);
+ jmsEx.setLinkedException(e);
+ jmsEx.initCause(e);
+ throw jmsEx;
+ }
+
+ return createSession(ackMode);
+ }
+
+ public SessionImpl createSession(final Session.AcknowledgeMode acknowledgeMode) throws JMSException
+ {
+ boolean started = false;
+ synchronized(_lock)
+ {
+ if(_state == State.CLOSED)
+ {
+ throw new IllegalStateException("Cannot create a session on a closed connection");
+ }
+ else if(_state == State.UNCONNECTED)
+ {
+ connect();
+ started = true;
+ }
+
+ try
+ {
+ SessionImpl session = new SessionImpl(this, acknowledgeMode);
+ session.setQueueSession(_isQueueConnection);
+ session.setTopicSession(_isTopicConnection);
+ _sessions.add(session);
+
+ if(_state == State.STARTED)
+ {
+ session.start();
+ }
+
+ return session;
+ }
+ catch(JMSException e)
+ {
+ Error remoteError;
+ if(started
+ && e.getLinkedException() instanceof ConnectionErrorException
+ && (remoteError = ((ConnectionErrorException)e.getLinkedException()).getRemoteError()).getCondition() == ConnectionError.REDIRECT)
+ {
+ String networkHost = (String) remoteError.getInfo().get(Symbol.valueOf("network-host"));
+ int port = (Integer) remoteError.getInfo().get(Symbol.valueOf("port"));
+ String hostName = (String) remoteError.getInfo().get(Symbol.valueOf("hostname"));
+ reconnect(networkHost,port,hostName);
+ return createSession(acknowledgeMode);
+
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ }
+
+
+ }
+
+ void removeSession(SessionImpl session)
+ {
+ synchronized (_lock)
+ {
+ _sessions.remove(session);
+ }
+ }
+
+ private void reconnect(String networkHost, int port, String hostName)
+ {
+ synchronized(_lock)
+ {
+ _state = State.UNCONNECTED;
+ _host = networkHost;
+ _port = port;
+ _remoteHost = hostName;
+ _conn = null;
+ }
+ }
+
+ public String getClientID() throws JMSException
+ {
+ checkClosed();
+ return _clientId;
+ }
+
+ public void setClientID(final String value) throws JMSException
+ {
+ checkNotConnected("Cannot set client-id to \""
+ + value
+ + "\"; client-id must be set before the connection is used");
+ if( _clientId !=null )
+ {
+ throw new IllegalStateException("client-id has already been set");
+ }
+ _clientId = value;
+ }
+
+ public ConnectionMetaData getMetaData() throws JMSException
+ {
+ checkClosed();
+ return _connectionMetaData;
+ }
+
+ public ExceptionListener getExceptionListener() throws JMSException
+ {
+ checkClosed();
+ return _exceptionListener;
+ }
+
+ public void setExceptionListener(final ExceptionListener exceptionListener) throws JMSException
+ {
+ checkClosed();
+ _exceptionListener = exceptionListener;
+ }
+
+ public void start() throws JMSException
+ {
+ synchronized(_lock)
+ {
+ checkClosed();
+ connect();
+ if(_state == State.STOPPED)
+ {
+ // TODO
+
+ _state = State.STARTED;
+
+ for(SessionImpl session : _sessions)
+ {
+ session.start();
+ }
+
+ }
+
+ _lock.notifyAll();
+ }
+
+ }
+
+ public void stop() throws JMSException
+ {
+ synchronized(_lock)
+ {
+ switch(_state)
+ {
+ case STARTED:
+ for(SessionImpl session : _sessions)
+ {
+ session.stop();
+ }
+ case UNCONNECTED:
+ _state = State.STOPPED;
+ break;
+ case CLOSED:
+ throw new javax.jms.IllegalStateException("Closed");
+ }
+
+ _lock.notifyAll();
+ }
+ }
+
+
+ static interface CloseTask
+ {
+ public void onClose() throws JMSException;
+ }
+
+ void addOnCloseTask(CloseTask task)
+ {
+ synchronized (_lock)
+ {
+ _closeTasks.add(task);
+ }
+ }
+
+
+ void removeOnCloseTask(CloseTask task)
+ {
+ synchronized (_lock)
+ {
+ _closeTasks.remove(task);
+ }
+ }
+
+ public void close() throws JMSException
+ {
+ synchronized(_lock)
+ {
+ if(_state != State.CLOSED)
+ {
+ stop();
+ List<SessionImpl> sessions = new ArrayList<SessionImpl>(_sessions);
+ for(SessionImpl session : sessions)
+ {
+ session.close();
+ }
+ for(CloseTask task : _closeTasks)
+ {
+ task.onClose();
+ }
+ if(_conn != null && _state != State.UNCONNECTED ) {
+ _conn.close();
+ }
+ _state = State.CLOSED;
+ }
+
+ _lock.notifyAll();
+ }
+ }
+
+ private void checkClosed() throws IllegalStateException
+ {
+ if(_state == State.CLOSED)
+ throw new IllegalStateException("Closed");
+ }
+
+ public ConnectionConsumer createConnectionConsumer(final Destination destination,
+ final String s,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ checkClosed();
+ return null; //TODO
+ }
+
+ public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+ {
+ checkClosed();
+ SessionImpl session = createSession(transacted, acknowledgeMode);
+ session.setTopicSession(true);
+ return session;
+ }
+
+ public ConnectionConsumer createConnectionConsumer(final Topic topic,
+ final String s,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ checkClosed();
+ return null; //TODO
+ }
+
+ public ConnectionConsumer createDurableConnectionConsumer(final Topic topic,
+ final String s,
+ final String s1,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ checkClosed();
+ if (_isQueueConnection)
+ {
+ throw new IllegalStateException("QueueConnection cannot be used to create Pub/Sub based resources.");
+ }
+ return null; //TODO
+ }
+
+ public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+ {
+ checkClosed();
+ SessionImpl session = createSession(transacted, acknowledgeMode);
+ session.setQueueSession(true);
+ return session;
+ }
+
+ public ConnectionConsumer createConnectionConsumer(final Queue queue,
+ final String s,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ checkClosed();
+ return null; //TODO
+ }
+
+
+
+ protected org.apache.qpid.amqp_1_0.client.Connection getClientConnection()
+ {
+ return _conn;
+ }
+
+ public boolean isStarted()
+ {
+ return _state == State.STARTED;
+ }
+
+ void setQueueConnection(final boolean queueConnection)
+ {
+ _isQueueConnection = queueConnection;
+ }
+
+ void setTopicConnection(final boolean topicConnection)
+ {
+ _isTopicConnection = topicConnection;
+ }
+
+ public String getTopicPrefix()
+ {
+ return _topicPrefix;
+ }
+
+ public void setTopicPrefix(String topicPrefix)
+ {
+ _topicPrefix = topicPrefix;
+ }
+
+ public String getQueuePrefix()
+ {
+ return _queuePrefix;
+ }
+
+ public void setQueuePrefix(String queueprefix)
+ {
+ _queuePrefix = queueprefix;
+ }
+
+ DecodedDestination toDecodedDestination(DestinationImpl dest)
+ {
+ String address = dest.getAddress();
+ Set<String> kind = null;
+ Class clazz = dest.getClass();
+ if( clazz==QueueImpl.class )
+ {
+ kind = MessageImpl.JMS_QUEUE_ATTRIBUTES;
+ if( _queuePrefix!=null )
+ {
+ // Avoid double prefixing..
+ if( !address.startsWith(_queuePrefix) )
+ {
+ address = _queuePrefix+address;
+ }
+ }
+ }
+ else if( clazz==TopicImpl.class )
+ {
+ kind = MessageImpl.JMS_TOPIC_ATTRIBUTES;
+ if( _topicPrefix!=null )
+ {
+ // Avoid double prefixing..
+ if( !address.startsWith(_topicPrefix) )
+ {
+ address = _topicPrefix+address;
+ }
+ }
+ }
+ else if( clazz==TemporaryQueueImpl.class )
+ {
+ kind = MessageImpl.JMS_TEMP_QUEUE_ATTRIBUTES;
+ }
+ else if( clazz==TemporaryTopicImpl.class )
+ {
+ kind = MessageImpl.JMS_TEMP_TOPIC_ATTRIBUTES;
+ }
+ return new DecodedDestination(address, kind);
+ }
+
+ DecodedDestination toDecodedDestination(String address, Set<String> kind)
+ {
+ if( (kind == null || kind.equals(MessageImpl.JMS_QUEUE_ATTRIBUTES)) && _queuePrefix!=null && address.startsWith(_queuePrefix))
+ {
+ return new DecodedDestination(address.substring(_queuePrefix.length()), MessageImpl.JMS_QUEUE_ATTRIBUTES);
+ }
+ if( (kind == null || kind.equals(MessageImpl.JMS_TOPIC_ATTRIBUTES)) && _topicPrefix!=null && address.startsWith(_topicPrefix))
+ {
+ return new DecodedDestination(address.substring(_topicPrefix.length()), MessageImpl.JMS_TOPIC_ATTRIBUTES);
+ }
+ return new DecodedDestination(address, kind);
+ }
+
+ void setUseBinaryMessageId(boolean useBinaryMessageId)
+ {
+ _useBinaryMessageId = useBinaryMessageId;
+ }
+
+ boolean useBinaryMessageId()
+ {
+ return _useBinaryMessageId;
+ }
+
+ void setSyncPublish(boolean syncPublish)
+ {
+ _syncPublish = syncPublish;
+ }
+
+ boolean syncPublish()
+ {
+ return _syncPublish;
+ }
+
+ private class ConnectionErrorTask implements Runnable
+ {
+
+ @Override
+ public void run()
+ {
+
+ try
+ {
+ final ExceptionListener exceptionListener = getExceptionListener();
+
+ if(exceptionListener != null)
+ {
+ final org.apache.qpid.amqp_1_0.type.transport.Error connectionError = _conn.getConnectionError();
+ if(connectionError != null)
+ {
+ exceptionListener.onException(new JMSException(connectionError.getDescription(),
+ connectionError.getCondition().toString()));
+ }
+ }
+ }
+ catch (JMSException ignored)
+ {
+ // ignored
+ }
+ }
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionMetaDataImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionMetaDataImpl.java
index 8159c7116b..64f7c065a7 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionMetaDataImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionMetaDataImpl.java
@@ -1,105 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.ConnectionMetaData;
-
-import javax.jms.JMSException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-
-public class ConnectionMetaDataImpl implements ConnectionMetaData
-{
- private static final int JMS_MAJOR_VERSION = 1;
- private static final int JMS_MINOR_VERSION = 1;
-
- private static final int PROVIDER_MAJOR_VERSION = 1;
- private static final int PROVIDER_MINOR_VERSION = 0;
-
-
- private final int _amqpMajorVersion;
- private final int _amqpMinorVersion;
- private final int _amqpRevisionVersion;
- private static final Collection<String> _jmsxProperties = Arrays.asList("JMSXGroupID", "JMSXGroupSeq");
-
- public ConnectionMetaDataImpl(final int amqpMajorVersion, final int amqpMinorVersion, final int amqpRevisionVersion)
- {
- _amqpMajorVersion = amqpMajorVersion;
- _amqpMinorVersion = amqpMinorVersion;
- _amqpRevisionVersion = amqpRevisionVersion;
- }
-
- public String getJMSVersion() throws JMSException
- {
- return getJMSMajorVersion() + "." + getJMSMinorVersion();
- }
-
- public int getJMSMajorVersion() throws JMSException
- {
- return JMS_MAJOR_VERSION;
- }
-
- public int getJMSMinorVersion() throws JMSException
- {
- return JMS_MINOR_VERSION;
- }
-
- public String getJMSProviderName() throws JMSException
- {
- return "AMQP.ORG";
- }
-
- public String getProviderVersion() throws JMSException
- {
- return getProviderMajorVersion() + "." + getProviderMinorVersion();
- }
-
- public int getProviderMajorVersion() throws JMSException
- {
- return PROVIDER_MAJOR_VERSION;
- }
-
- public int getProviderMinorVersion() throws JMSException
- {
- return PROVIDER_MINOR_VERSION;
- }
-
- public Enumeration getJMSXPropertyNames() throws JMSException
- {
-
- return Collections.enumeration(_jmsxProperties);
- }
-
- public int getAMQPMajorVersion()
- {
- return _amqpMajorVersion;
- }
-
- public int getAMQPMinorVersion()
- {
- return _amqpMinorVersion;
- }
-
- public int getAMQPRevisionVersion()
- {
- return _amqpRevisionVersion;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.ConnectionMetaData;
+
+import javax.jms.JMSException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+
+public class ConnectionMetaDataImpl implements ConnectionMetaData
+{
+ private static final int JMS_MAJOR_VERSION = 1;
+ private static final int JMS_MINOR_VERSION = 1;
+
+ private static final int PROVIDER_MAJOR_VERSION = 1;
+ private static final int PROVIDER_MINOR_VERSION = 0;
+
+
+ private final int _amqpMajorVersion;
+ private final int _amqpMinorVersion;
+ private final int _amqpRevisionVersion;
+ private static final Collection<String> _jmsxProperties = Arrays.asList("JMSXGroupID", "JMSXGroupSeq");
+
+ public ConnectionMetaDataImpl(final int amqpMajorVersion, final int amqpMinorVersion, final int amqpRevisionVersion)
+ {
+ _amqpMajorVersion = amqpMajorVersion;
+ _amqpMinorVersion = amqpMinorVersion;
+ _amqpRevisionVersion = amqpRevisionVersion;
+ }
+
+ public String getJMSVersion() throws JMSException
+ {
+ return getJMSMajorVersion() + "." + getJMSMinorVersion();
+ }
+
+ public int getJMSMajorVersion() throws JMSException
+ {
+ return JMS_MAJOR_VERSION;
+ }
+
+ public int getJMSMinorVersion() throws JMSException
+ {
+ return JMS_MINOR_VERSION;
+ }
+
+ public String getJMSProviderName() throws JMSException
+ {
+ return "AMQP.ORG";
+ }
+
+ public String getProviderVersion() throws JMSException
+ {
+ return getProviderMajorVersion() + "." + getProviderMinorVersion();
+ }
+
+ public int getProviderMajorVersion() throws JMSException
+ {
+ return PROVIDER_MAJOR_VERSION;
+ }
+
+ public int getProviderMinorVersion() throws JMSException
+ {
+ return PROVIDER_MINOR_VERSION;
+ }
+
+ public Enumeration getJMSXPropertyNames() throws JMSException
+ {
+
+ return Collections.enumeration(_jmsxProperties);
+ }
+
+ public int getAMQPMajorVersion()
+ {
+ return _amqpMajorVersion;
+ }
+
+ public int getAMQPMinorVersion()
+ {
+ return _amqpMinorVersion;
+ }
+
+ public int getAMQPRevisionVersion()
+ {
+ return _amqpRevisionVersion;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/DestinationImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/DestinationImpl.java
index b4ca2c6302..924c5b9857 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/DestinationImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/DestinationImpl.java
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.Destination;
-import org.apache.qpid.amqp_1_0.jms.Queue;
-import org.apache.qpid.amqp_1_0.jms.Topic;
-
-import javax.jms.JMSException;
-import java.util.WeakHashMap;
-
-public class DestinationImpl implements Destination, Queue, Topic
-{
- private static final WeakHashMap<String, DestinationImpl> DESTINATION_CACHE =
- new WeakHashMap<String, DestinationImpl>();
-
- private final String _address;
-
- protected DestinationImpl(String address)
- {
- _address = address;
- }
-
- public String getAddress()
- {
- return _address;
- }
-
- public static DestinationImpl valueOf(String address)
- {
- return address == null ? null : createDestination(address);
- }
-
- @Override
- public int hashCode()
- {
- return _address.hashCode();
- }
-
- @Override
- public boolean equals(final Object obj)
- {
- return obj != null
- && obj.getClass() == getClass()
- && _address.equals(((DestinationImpl)obj)._address);
- }
-
- public static synchronized DestinationImpl createDestination(final String address)
- {
- DestinationImpl destination = DESTINATION_CACHE.get(address);
- if(destination == null)
- {
- destination = new DestinationImpl(address);
- DESTINATION_CACHE.put(address, destination);
- }
- return destination;
- }
-
- public String getQueueName() throws JMSException
- {
- return getAddress();
- }
-
- public String getTopicName() throws JMSException
- {
- return getAddress();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.Destination;
+import org.apache.qpid.amqp_1_0.jms.Queue;
+import org.apache.qpid.amqp_1_0.jms.Topic;
+
+import javax.jms.JMSException;
+import java.util.WeakHashMap;
+
+public class DestinationImpl implements Destination, Queue, Topic
+{
+ private static final WeakHashMap<String, DestinationImpl> DESTINATION_CACHE =
+ new WeakHashMap<String, DestinationImpl>();
+
+ private final String _address;
+
+ protected DestinationImpl(String address)
+ {
+ _address = address;
+ }
+
+ public String getAddress()
+ {
+ return _address;
+ }
+
+ public static DestinationImpl valueOf(String address)
+ {
+ return address == null ? null : createDestination(address);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return _address.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj)
+ {
+ return obj != null
+ && obj.getClass() == getClass()
+ && _address.equals(((DestinationImpl)obj)._address);
+ }
+
+ public static synchronized DestinationImpl createDestination(final String address)
+ {
+ DestinationImpl destination = DESTINATION_CACHE.get(address);
+ if(destination == null)
+ {
+ destination = new DestinationImpl(address);
+ DESTINATION_CACHE.put(address, destination);
+ }
+ return destination;
+ }
+
+ public String getQueueName() throws JMSException
+ {
+ return getAddress();
+ }
+
+ public String getTopicName() throws JMSException
+ {
+ return getAddress();
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MapMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MapMessageImpl.java
index 47811a0f5a..cb57936d3d 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MapMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MapMessageImpl.java
@@ -1,444 +1,444 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.MapMessage;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-import java.util.*;
-
-public class MapMessageImpl extends MessageImpl implements MapMessage
-{
- private Map _map;
-
- public MapMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, Map map,
- Footer footer,
- SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- _map = map;
- }
-
- MapMessageImpl(final SessionImpl session)
- {
- super(new Header(), new MessageAnnotations(new HashMap()),
- new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
- session);
- _map = new HashMap();
- }
-
- public boolean getBoolean(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Boolean)
- {
- return ((Boolean) value).booleanValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Boolean.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to boolean.");
- }
- }
-
- public byte getByte(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Byte)
- {
- return ((Byte) value).byteValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Byte.valueOf((String) value).byteValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to byte.");
- } }
-
- public short getShort(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Short)
- {
- return ((Short) value).shortValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).shortValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Short.valueOf((String) value).shortValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to short.");
- } }
-
- public char getChar(String name) throws JMSException
- {
- Object value = get(name);
-
- if (!itemExists(name))
- {
- throw new MessageFormatException("Property " + name + " not present");
- }
- else if (value instanceof Character)
- {
- return ((Character) value).charValue();
- }
- else if (value == null)
- {
- throw new NullPointerException("Property " + name + " has null value and therefore cannot "
- + "be converted to char.");
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to boolan.");
- } }
-
- public int getInt(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Integer)
- {
- return ((Integer) value).intValue();
- }
- else if (value instanceof Short)
- {
- return ((Short) value).intValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).intValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Integer.valueOf((String) value).intValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to int.");
- }
- }
-
- public long getLong(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Long)
- {
- return ((Long) value).longValue();
- }
- else if (value instanceof Integer)
- {
- return ((Integer) value).longValue();
- }
-
- if (value instanceof Short)
- {
- return ((Short) value).longValue();
- }
-
- if (value instanceof Byte)
- {
- return ((Byte) value).longValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Long.valueOf((String) value).longValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to long.");
- }
- }
-
- public float getFloat(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Float)
- {
- return ((Float) value).floatValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Float.valueOf((String) value).floatValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to float.");
- }
- }
-
- public double getDouble(String name) throws JMSException
- {
- Object value = get(name);
-
- if (value instanceof Double)
- {
- return ((Double) value).doubleValue();
- }
- else if (value instanceof Float)
- {
- return ((Float) value).doubleValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Double.valueOf((String) value).doubleValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to double.");
- }
- }
-
- public String getString(String name) throws JMSException
- {
- Object value = get(name);
-
- if ((value instanceof String) || (value == null))
- {
- return (String) value;
- }
- else if (value instanceof byte[] || value instanceof Binary)
- {
- throw new MessageFormatException("Property " + name + " of type byte[] " + "cannot be converted to String.");
- }
- else
- {
- return value.toString();
- }
- }
-
- public byte[] getBytes(String name) throws JMSException
- {
- Object value = get(name);
-
- if (!itemExists(name))
- {
- throw new MessageFormatException("Property " + name + " not present");
- }
- else if ((value instanceof byte[]) || (value == null))
- {
- return (byte[]) value;
- }
- else if(value instanceof Binary)
- {
- return ((Binary)value).getArray();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to byte[].");
- } }
-
- public Object getObject(String s) throws JMSException
- {
- Object val = get(s);
- return val instanceof Binary ? ((Binary)val).getArray() : val;
- }
-
- public Enumeration getMapNames() throws JMSException
- {
- return Collections.enumeration(keySet());
- }
-
- public void setBoolean(String name, boolean val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setByte(String name, byte val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setShort(String name, short val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setChar(String name, char val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setInt(String name, int val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setLong(String name, long val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setFloat(String name, float val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setDouble(String name, double val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setString(String name, String val) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- put(name, val);
- }
-
- public void setBytes(String name, byte[] val) throws JMSException
- {
- setBytes(name, val, 0, val == null ? 0 : val.length);
- }
-
- public void setBytes(String name, byte[] bytes, int offset, int length) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- byte[] val;
-
- if(bytes == null)
- {
- val = null;
- }
- else
- {
- val = new byte[length];
- System.arraycopy(bytes,offset,val,0,length);
- }
-
- put(name, new Binary(val));
- }
-
- public void setObject(String name, Object value) throws JMSException
- {
- checkWritable();
- checkPropertyName(name);
- if ((value instanceof Boolean) || (value instanceof Byte) || (value instanceof Short) || (value instanceof Integer)
- || (value instanceof Long) || (value instanceof Character) || (value instanceof Float)
- || (value instanceof Double) || (value instanceof String) || (value instanceof byte[]) || (value == null))
- {
- put(name, value);
- }
- else
- {
- throw new MessageFormatException("Cannot set property " + name + " to value " + value + "of type "
- + value.getClass().getName() + ".");
- } }
-
- public boolean itemExists(String s)
- {
- return _map.containsKey(s);
- }
-
- public Object get(final Object key)
- {
- return _map.get(key);
- }
-
- public Object put(final Object key, final Object val)
- {
- return _map.put(key, val);
- }
-
- public boolean itemExists(final Object key)
- {
- return _map.containsKey(key);
- }
-
- public Set<Object> keySet()
- {
- return _map.keySet();
- }
-
- @Override
- public void clearBody() throws JMSException
- {
- super.clearBody();
- _map.clear();
- }
-
- private void checkPropertyName(String propName)
- {
- if ((propName == null) || propName.equals(""))
- {
- throw new IllegalArgumentException("Property name cannot be null, or the empty String.");
- }
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
- sections.add(new AmqpValue(_map));
- sections.add(getFooter());
- return sections;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.MapMessage;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageFormatException;
+import java.util.*;
+
+public class MapMessageImpl extends MessageImpl implements MapMessage
+{
+ private Map _map;
+
+ public MapMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, Map map,
+ Footer footer,
+ SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ _map = map;
+ }
+
+ MapMessageImpl(final SessionImpl session)
+ {
+ super(new Header(), new MessageAnnotations(new HashMap()),
+ new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
+ session);
+ _map = new HashMap();
+ }
+
+ public boolean getBoolean(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Boolean)
+ {
+ return ((Boolean) value).booleanValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Boolean.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to boolean.");
+ }
+ }
+
+ public byte getByte(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Byte)
+ {
+ return ((Byte) value).byteValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Byte.valueOf((String) value).byteValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to byte.");
+ } }
+
+ public short getShort(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Short)
+ {
+ return ((Short) value).shortValue();
+ }
+ else if (value instanceof Byte)
+ {
+ return ((Byte) value).shortValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Short.valueOf((String) value).shortValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to short.");
+ } }
+
+ public char getChar(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (!itemExists(name))
+ {
+ throw new MessageFormatException("Property " + name + " not present");
+ }
+ else if (value instanceof Character)
+ {
+ return ((Character) value).charValue();
+ }
+ else if (value == null)
+ {
+ throw new NullPointerException("Property " + name + " has null value and therefore cannot "
+ + "be converted to char.");
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to boolan.");
+ } }
+
+ public int getInt(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Integer)
+ {
+ return ((Integer) value).intValue();
+ }
+ else if (value instanceof Short)
+ {
+ return ((Short) value).intValue();
+ }
+ else if (value instanceof Byte)
+ {
+ return ((Byte) value).intValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Integer.valueOf((String) value).intValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to int.");
+ }
+ }
+
+ public long getLong(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Long)
+ {
+ return ((Long) value).longValue();
+ }
+ else if (value instanceof Integer)
+ {
+ return ((Integer) value).longValue();
+ }
+
+ if (value instanceof Short)
+ {
+ return ((Short) value).longValue();
+ }
+
+ if (value instanceof Byte)
+ {
+ return ((Byte) value).longValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Long.valueOf((String) value).longValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to long.");
+ }
+ }
+
+ public float getFloat(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Float)
+ {
+ return ((Float) value).floatValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Float.valueOf((String) value).floatValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to float.");
+ }
+ }
+
+ public double getDouble(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (value instanceof Double)
+ {
+ return ((Double) value).doubleValue();
+ }
+ else if (value instanceof Float)
+ {
+ return ((Float) value).doubleValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Double.valueOf((String) value).doubleValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to double.");
+ }
+ }
+
+ public String getString(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if ((value instanceof String) || (value == null))
+ {
+ return (String) value;
+ }
+ else if (value instanceof byte[] || value instanceof Binary)
+ {
+ throw new MessageFormatException("Property " + name + " of type byte[] " + "cannot be converted to String.");
+ }
+ else
+ {
+ return value.toString();
+ }
+ }
+
+ public byte[] getBytes(String name) throws JMSException
+ {
+ Object value = get(name);
+
+ if (!itemExists(name))
+ {
+ throw new MessageFormatException("Property " + name + " not present");
+ }
+ else if ((value instanceof byte[]) || (value == null))
+ {
+ return (byte[]) value;
+ }
+ else if(value instanceof Binary)
+ {
+ return ((Binary)value).getArray();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to byte[].");
+ } }
+
+ public Object getObject(String s) throws JMSException
+ {
+ Object val = get(s);
+ return val instanceof Binary ? ((Binary)val).getArray() : val;
+ }
+
+ public Enumeration getMapNames() throws JMSException
+ {
+ return Collections.enumeration(keySet());
+ }
+
+ public void setBoolean(String name, boolean val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setByte(String name, byte val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setShort(String name, short val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setChar(String name, char val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setInt(String name, int val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setLong(String name, long val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setFloat(String name, float val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setDouble(String name, double val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setString(String name, String val) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ put(name, val);
+ }
+
+ public void setBytes(String name, byte[] val) throws JMSException
+ {
+ setBytes(name, val, 0, val == null ? 0 : val.length);
+ }
+
+ public void setBytes(String name, byte[] bytes, int offset, int length) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ byte[] val;
+
+ if(bytes == null)
+ {
+ val = null;
+ }
+ else
+ {
+ val = new byte[length];
+ System.arraycopy(bytes,offset,val,0,length);
+ }
+
+ put(name, new Binary(val));
+ }
+
+ public void setObject(String name, Object value) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(name);
+ if ((value instanceof Boolean) || (value instanceof Byte) || (value instanceof Short) || (value instanceof Integer)
+ || (value instanceof Long) || (value instanceof Character) || (value instanceof Float)
+ || (value instanceof Double) || (value instanceof String) || (value instanceof byte[]) || (value == null))
+ {
+ put(name, value);
+ }
+ else
+ {
+ throw new MessageFormatException("Cannot set property " + name + " to value " + value + "of type "
+ + value.getClass().getName() + ".");
+ } }
+
+ public boolean itemExists(String s)
+ {
+ return _map.containsKey(s);
+ }
+
+ public Object get(final Object key)
+ {
+ return _map.get(key);
+ }
+
+ public Object put(final Object key, final Object val)
+ {
+ return _map.put(key, val);
+ }
+
+ public boolean itemExists(final Object key)
+ {
+ return _map.containsKey(key);
+ }
+
+ public Set<Object> keySet()
+ {
+ return _map.keySet();
+ }
+
+ @Override
+ public void clearBody() throws JMSException
+ {
+ super.clearBody();
+ _map.clear();
+ }
+
+ private void checkPropertyName(String propName)
+ {
+ if ((propName == null) || propName.equals(""))
+ {
+ throw new IllegalArgumentException("Property name cannot be null, or the empty String.");
+ }
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+ sections.add(new AmqpValue(_map));
+ sections.add(getFooter());
+ return sections;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageConsumerImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageConsumerImpl.java
index d2b34e0f13..9cbeb93dde 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageConsumerImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageConsumerImpl.java
@@ -1,485 +1,485 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import javax.jms.MessageListener;
-import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.Message;
-import org.apache.qpid.amqp_1_0.client.Receiver;
-import org.apache.qpid.amqp_1_0.client.Transaction;
-import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
-import org.apache.qpid.amqp_1_0.jms.Queue;
-import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
-import org.apache.qpid.amqp_1_0.jms.Session;
-import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
-import org.apache.qpid.amqp_1_0.jms.Topic;
-import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.messaging.Filter;
-import org.apache.qpid.amqp_1_0.type.messaging.JMSSelectorFilter;
-import org.apache.qpid.amqp_1_0.type.messaging.Modified;
-import org.apache.qpid.amqp_1_0.type.messaging.NoLocalFilter;
-import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
-import org.apache.qpid.amqp_1_0.type.transport.Error;
-
-public class MessageConsumerImpl implements MessageConsumer, QueueReceiver, TopicSubscriber
-{
- private static final Symbol NO_LOCAL_FILTER_NAME = Symbol.valueOf("no-local");
- private static final Symbol JMS_SELECTOR_FILTER_NAME = Symbol.valueOf("jms-selector");
- private String _selector;
- private boolean _noLocal;
- private DestinationImpl _destination;
- private SessionImpl _session;
- private Receiver _receiver;
- private Binary _lastUnackedMessage;
- MessageListener _messageListener;
-
- private boolean _isQueueConsumer;
- private boolean _isTopicSubscriber;
-
- private boolean _closed = false;
- private String _linkName;
- private boolean _durable;
- private Collection<Binary> _txnMsgs = Collections.synchronizedCollection(new ArrayList<Binary>());
- private Binary _lastTxnUpdate;
- private final List<Message> _recoverReplayMessages = new ArrayList<Message>();
- private final List<Message> _replaymessages = new ArrayList<Message>();
-
- MessageConsumerImpl(final Destination destination,
- final SessionImpl session,
- final String selector,
- final boolean noLocal) throws JMSException
- {
- this(destination,session,selector,noLocal,null,false);
- }
-
- MessageConsumerImpl(final Destination destination,
- final SessionImpl session,
- final String selector,
- final boolean noLocal,
- final String linkName,
- final boolean durable) throws JMSException
- {
- _selector = selector;
- _noLocal = noLocal;
- _linkName = linkName;
- _durable = durable;
- if(destination instanceof DestinationImpl)
- {
- _destination = (DestinationImpl) destination;
- if(destination instanceof javax.jms.Queue)
- {
- _isQueueConsumer = true;
- }
- else if(destination instanceof javax.jms.Topic)
- {
- _isTopicSubscriber = true;
- }
- if(destination instanceof TemporaryDestination)
- {
- ((TemporaryDestination)destination).addConsumer(this);
- }
- }
- else
- {
- throw new InvalidDestinationException("Invalid destination class " + destination.getClass().getName());
- }
- _session = session;
-
- _receiver = createClientReceiver();
- _receiver.setRemoteErrorListener(new Runnable()
- {
- @Override
- public void run()
- {
- try
- {
- final ExceptionListener exceptionListener = _session.getConnection().getExceptionListener();
-
- if(exceptionListener != null)
- {
- final Error receiverError = _receiver.getError();
- exceptionListener.onException(new JMSException(receiverError.getDescription(),
- receiverError.getCondition().getValue().toString()));
-
- }
- }
- catch (JMSException e)
- {
-
- }
- }
- });
-
-
- }
-
- protected Receiver createClientReceiver() throws JMSException
- {
- try
- {
- return _session.getClientSession().createReceiver(_session.toAddress(_destination), AcknowledgeMode.ALO,
- _linkName, _durable, getFilters(), null);
- }
- catch (ConnectionErrorException e)
- {
- Error error = e.getRemoteError();
- if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
- {
- throw new InvalidSelectorException(e.getMessage());
- }
- else
- {
- throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
-
- }
- }
- }
-
- Map<Symbol, Filter> getFilters()
- {
- if(_selector == null || _selector.trim().equals(""))
- {
- if(_noLocal)
- {
- return Collections.singletonMap(NO_LOCAL_FILTER_NAME, (Filter) NoLocalFilter.INSTANCE);
- }
- else
- {
- return null;
-
- }
- }
- else if(_noLocal)
- {
- Map<Symbol, Filter> filters = new HashMap<Symbol, Filter>();
- filters.put(NO_LOCAL_FILTER_NAME, NoLocalFilter.INSTANCE);
- filters.put(JMS_SELECTOR_FILTER_NAME, new JMSSelectorFilter(_selector));
- return filters;
- }
- else
- {
- return Collections.singletonMap(JMS_SELECTOR_FILTER_NAME, (Filter)new JMSSelectorFilter(_selector));
- }
-
-
- }
-
- public String getMessageSelector() throws JMSException
- {
- checkClosed();
- return _selector;
- }
-
- public MessageListener getMessageListener() throws IllegalStateException
- {
- checkClosed();
- return _messageListener;
- }
-
- public void setMessageListener(final MessageListener messageListener) throws JMSException
- {
- checkClosed();
- _messageListener = messageListener;
- _receiver.setMessageArrivalListener(new Receiver.MessageArrivalListener()
- {
-
- public void messageArrived(final Receiver receiver)
- {
- _session.messageArrived(MessageConsumerImpl.this);
- }
- });
- _session.messageListenerSet( this );
-
- }
-
- public MessageImpl receive() throws JMSException
- {
- checkClosed();
- return receiveImpl(-1L);
- }
-
- public MessageImpl receive(final long timeout) throws JMSException
- {
- checkClosed();
- // TODO - validate timeout > 0
-
- return receiveImpl(timeout);
- }
-
- public MessageImpl receiveNoWait() throws JMSException
- {
- checkClosed();
- return receiveImpl(0L);
- }
-
- private MessageImpl receiveImpl(long timeout) throws JMSException
- {
-
- org.apache.qpid.amqp_1_0.client.Message msg;
- boolean redelivery;
- if(_replaymessages.isEmpty())
- {
- checkReceiverError();
- msg = receive0(timeout);
- redelivery = false;
- }
- else
- {
- msg = _replaymessages.remove(0);
- redelivery = true;
- }
-
- if(msg != null)
- {
- preReceiveAction(msg);
- }
- return createJMSMessage(msg, redelivery);
- }
-
- void checkReceiverError() throws JMSException
- {
- final Error receiverError = _receiver.getError();
- if(receiverError != null)
- {
- JMSException jmsException =
- new JMSException(receiverError.getDescription(), receiverError.getCondition().toString());
-
- throw jmsException;
- }
- }
-
- Message receive0(final long timeout)
- {
-
- Message message = _receiver.receive(timeout);
- if(_session.getAckModeEnum() == Session.AcknowledgeMode.CLIENT_ACKNOWLEDGE)
- {
- _recoverReplayMessages.add(message);
- }
- return message;
- }
-
-
- void acknowledge(final org.apache.qpid.amqp_1_0.client.Message msg)
- {
- _receiver.acknowledge(msg.getDeliveryTag(), _session.getTxn());
- }
-
- MessageImpl createJMSMessage(final Message msg, boolean redelivery)
- {
- if(msg != null)
- {
- MessageFactory factory = _session.getMessageFactory();
- final MessageImpl message = factory.createMessage(_destination, msg);
- message.setFromQueue(_isQueueConsumer);
- message.setFromTopic(_isTopicSubscriber);
- if(redelivery)
- {
- if(!message.getJMSRedelivered())
- {
- message.setJMSRedelivered(true);
- }
- }
-
- return message;
- }
- else
- {
- return null;
- }
- }
-
- public void close() throws JMSException
- {
- if(!_closed)
- {
- _closed = true;
-
- closeUnderlyingReceiver(_receiver);
-
- if(_destination instanceof TemporaryDestination)
- {
- ((TemporaryDestination)_destination).removeConsumer(this);
- }
- }
- }
-
- protected void closeUnderlyingReceiver(Receiver receiver)
- {
- receiver.close();
- }
-
- private void checkClosed() throws IllegalStateException
- {
- if(_closed)
- {
- throw new javax.jms.IllegalStateException("Closed");
- }
- }
-
- void setLastUnackedMessage(final Binary deliveryTag)
- {
- _lastUnackedMessage = deliveryTag;
- }
-
- void preReceiveAction(final org.apache.qpid.amqp_1_0.client.Message msg)
- {
- int acknowledgeMode = _session.getAckModeEnum().ordinal();
-
- if(acknowledgeMode == Session.AUTO_ACKNOWLEDGE
- || acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE
- || acknowledgeMode == Session.SESSION_TRANSACTED)
- {
- acknowledge(msg);
- if(acknowledgeMode == Session.SESSION_TRANSACTED)
- {
- _txnMsgs.add(msg.getDeliveryTag());
- }
- }
- else if(acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
- {
- setLastUnackedMessage(msg.getDeliveryTag());
- }
- }
-
- void acknowledgeAll()
- {
- if(_lastUnackedMessage != null)
- {
- Transaction txn = _session.getTxn();
- _receiver.acknowledgeAll(_lastUnackedMessage, txn, null);
- if(txn != null)
- {
- _lastTxnUpdate = _lastUnackedMessage;
- }
- _lastUnackedMessage = null;
-
- }
- _recoverReplayMessages.clear();
- if(!_replaymessages.isEmpty())
- {
- _recoverReplayMessages.addAll(_replaymessages);
- }
- }
-
- void postRollback()
- {
- if(_lastTxnUpdate != null)
- {
- final Modified outcome = new Modified();
- outcome.setDeliveryFailed(true);
- _receiver.updateAll(outcome, _lastTxnUpdate);
- _lastTxnUpdate = null;
- }
- for(Binary tag : _txnMsgs)
- {
- _receiver.modified(tag);
- }
- _txnMsgs.clear();
- }
-
- void postCommit()
- {
- _lastTxnUpdate = null;
- _txnMsgs.clear();
- }
-
- public DestinationImpl getDestination() throws IllegalStateException
- {
- checkClosed();
- return _destination;
- }
-
-
- public SessionImpl getSession() throws IllegalStateException
- {
- checkClosed();
- return _session;
- }
-
- public boolean getNoLocal() throws IllegalStateException
- {
- checkClosed();
- return _noLocal;
- }
-
- public void start()
- {
- _receiver.setCredit(UnsignedInteger.valueOf(100), true);
- }
-
- public Queue getQueue() throws JMSException
- {
- return (Queue) getDestination();
- }
-
- public Topic getTopic() throws JMSException
- {
- return (Topic) getDestination();
- }
-
- void setQueueConsumer(final boolean queueConsumer)
- {
- _isQueueConsumer = queueConsumer;
- }
-
- void setTopicSubscriber(final boolean topicSubscriber)
- {
- _isTopicSubscriber = topicSubscriber;
- }
-
- String getLinkName()
- {
- return _linkName;
- }
-
- boolean isDurable()
- {
- return _durable;
- }
-
- void doRecover()
- {
- _replaymessages.clear();
- if(!_recoverReplayMessages.isEmpty())
- {
- _replaymessages.addAll(_recoverReplayMessages);
- for(Message msg : _replaymessages)
- {
- _session.messageArrived(this);
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.InvalidSelectorException;
+import javax.jms.JMSException;
+import javax.jms.MessageListener;
+import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.Message;
+import org.apache.qpid.amqp_1_0.client.Receiver;
+import org.apache.qpid.amqp_1_0.client.Transaction;
+import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
+import org.apache.qpid.amqp_1_0.jms.Queue;
+import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
+import org.apache.qpid.amqp_1_0.jms.Session;
+import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
+import org.apache.qpid.amqp_1_0.jms.Topic;
+import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.messaging.Filter;
+import org.apache.qpid.amqp_1_0.type.messaging.JMSSelectorFilter;
+import org.apache.qpid.amqp_1_0.type.messaging.Modified;
+import org.apache.qpid.amqp_1_0.type.messaging.NoLocalFilter;
+import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class MessageConsumerImpl implements MessageConsumer, QueueReceiver, TopicSubscriber
+{
+ private static final Symbol NO_LOCAL_FILTER_NAME = Symbol.valueOf("no-local");
+ private static final Symbol JMS_SELECTOR_FILTER_NAME = Symbol.valueOf("jms-selector");
+ private String _selector;
+ private boolean _noLocal;
+ private DestinationImpl _destination;
+ private SessionImpl _session;
+ private Receiver _receiver;
+ private Binary _lastUnackedMessage;
+ MessageListener _messageListener;
+
+ private boolean _isQueueConsumer;
+ private boolean _isTopicSubscriber;
+
+ private boolean _closed = false;
+ private String _linkName;
+ private boolean _durable;
+ private Collection<Binary> _txnMsgs = Collections.synchronizedCollection(new ArrayList<Binary>());
+ private Binary _lastTxnUpdate;
+ private final List<Message> _recoverReplayMessages = new ArrayList<Message>();
+ private final List<Message> _replaymessages = new ArrayList<Message>();
+
+ MessageConsumerImpl(final Destination destination,
+ final SessionImpl session,
+ final String selector,
+ final boolean noLocal) throws JMSException
+ {
+ this(destination,session,selector,noLocal,null,false);
+ }
+
+ MessageConsumerImpl(final Destination destination,
+ final SessionImpl session,
+ final String selector,
+ final boolean noLocal,
+ final String linkName,
+ final boolean durable) throws JMSException
+ {
+ _selector = selector;
+ _noLocal = noLocal;
+ _linkName = linkName;
+ _durable = durable;
+ if(destination instanceof DestinationImpl)
+ {
+ _destination = (DestinationImpl) destination;
+ if(destination instanceof javax.jms.Queue)
+ {
+ _isQueueConsumer = true;
+ }
+ else if(destination instanceof javax.jms.Topic)
+ {
+ _isTopicSubscriber = true;
+ }
+ if(destination instanceof TemporaryDestination)
+ {
+ ((TemporaryDestination)destination).addConsumer(this);
+ }
+ }
+ else
+ {
+ throw new InvalidDestinationException("Invalid destination class " + destination.getClass().getName());
+ }
+ _session = session;
+
+ _receiver = createClientReceiver();
+ _receiver.setRemoteErrorListener(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ final ExceptionListener exceptionListener = _session.getConnection().getExceptionListener();
+
+ if(exceptionListener != null)
+ {
+ final Error receiverError = _receiver.getError();
+ exceptionListener.onException(new JMSException(receiverError.getDescription(),
+ receiverError.getCondition().getValue().toString()));
+
+ }
+ }
+ catch (JMSException e)
+ {
+
+ }
+ }
+ });
+
+
+ }
+
+ protected Receiver createClientReceiver() throws JMSException
+ {
+ try
+ {
+ return _session.getClientSession().createReceiver(_session.toAddress(_destination), AcknowledgeMode.ALO,
+ _linkName, _durable, getFilters(), null);
+ }
+ catch (ConnectionErrorException e)
+ {
+ Error error = e.getRemoteError();
+ if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
+ {
+ throw new InvalidSelectorException(e.getMessage());
+ }
+ else
+ {
+ throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
+
+ }
+ }
+ }
+
+ Map<Symbol, Filter> getFilters()
+ {
+ if(_selector == null || _selector.trim().equals(""))
+ {
+ if(_noLocal)
+ {
+ return Collections.singletonMap(NO_LOCAL_FILTER_NAME, (Filter) NoLocalFilter.INSTANCE);
+ }
+ else
+ {
+ return null;
+
+ }
+ }
+ else if(_noLocal)
+ {
+ Map<Symbol, Filter> filters = new HashMap<Symbol, Filter>();
+ filters.put(NO_LOCAL_FILTER_NAME, NoLocalFilter.INSTANCE);
+ filters.put(JMS_SELECTOR_FILTER_NAME, new JMSSelectorFilter(_selector));
+ return filters;
+ }
+ else
+ {
+ return Collections.singletonMap(JMS_SELECTOR_FILTER_NAME, (Filter)new JMSSelectorFilter(_selector));
+ }
+
+
+ }
+
+ public String getMessageSelector() throws JMSException
+ {
+ checkClosed();
+ return _selector;
+ }
+
+ public MessageListener getMessageListener() throws IllegalStateException
+ {
+ checkClosed();
+ return _messageListener;
+ }
+
+ public void setMessageListener(final MessageListener messageListener) throws JMSException
+ {
+ checkClosed();
+ _messageListener = messageListener;
+ _receiver.setMessageArrivalListener(new Receiver.MessageArrivalListener()
+ {
+
+ public void messageArrived(final Receiver receiver)
+ {
+ _session.messageArrived(MessageConsumerImpl.this);
+ }
+ });
+ _session.messageListenerSet( this );
+
+ }
+
+ public MessageImpl receive() throws JMSException
+ {
+ checkClosed();
+ return receiveImpl(-1L);
+ }
+
+ public MessageImpl receive(final long timeout) throws JMSException
+ {
+ checkClosed();
+ // TODO - validate timeout > 0
+
+ return receiveImpl(timeout);
+ }
+
+ public MessageImpl receiveNoWait() throws JMSException
+ {
+ checkClosed();
+ return receiveImpl(0L);
+ }
+
+ private MessageImpl receiveImpl(long timeout) throws JMSException
+ {
+
+ org.apache.qpid.amqp_1_0.client.Message msg;
+ boolean redelivery;
+ if(_replaymessages.isEmpty())
+ {
+ checkReceiverError();
+ msg = receive0(timeout);
+ redelivery = false;
+ }
+ else
+ {
+ msg = _replaymessages.remove(0);
+ redelivery = true;
+ }
+
+ if(msg != null)
+ {
+ preReceiveAction(msg);
+ }
+ return createJMSMessage(msg, redelivery);
+ }
+
+ void checkReceiverError() throws JMSException
+ {
+ final Error receiverError = _receiver.getError();
+ if(receiverError != null)
+ {
+ JMSException jmsException =
+ new JMSException(receiverError.getDescription(), receiverError.getCondition().toString());
+
+ throw jmsException;
+ }
+ }
+
+ Message receive0(final long timeout)
+ {
+
+ Message message = _receiver.receive(timeout);
+ if(_session.getAckModeEnum() == Session.AcknowledgeMode.CLIENT_ACKNOWLEDGE)
+ {
+ _recoverReplayMessages.add(message);
+ }
+ return message;
+ }
+
+
+ void acknowledge(final org.apache.qpid.amqp_1_0.client.Message msg)
+ {
+ _receiver.acknowledge(msg.getDeliveryTag(), _session.getTxn());
+ }
+
+ MessageImpl createJMSMessage(final Message msg, boolean redelivery)
+ {
+ if(msg != null)
+ {
+ MessageFactory factory = _session.getMessageFactory();
+ final MessageImpl message = factory.createMessage(_destination, msg);
+ message.setFromQueue(_isQueueConsumer);
+ message.setFromTopic(_isTopicSubscriber);
+ if(redelivery)
+ {
+ if(!message.getJMSRedelivered())
+ {
+ message.setJMSRedelivered(true);
+ }
+ }
+
+ return message;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void close() throws JMSException
+ {
+ if(!_closed)
+ {
+ _closed = true;
+
+ closeUnderlyingReceiver(_receiver);
+
+ if(_destination instanceof TemporaryDestination)
+ {
+ ((TemporaryDestination)_destination).removeConsumer(this);
+ }
+ }
+ }
+
+ protected void closeUnderlyingReceiver(Receiver receiver)
+ {
+ receiver.close();
+ }
+
+ private void checkClosed() throws IllegalStateException
+ {
+ if(_closed)
+ {
+ throw new javax.jms.IllegalStateException("Closed");
+ }
+ }
+
+ void setLastUnackedMessage(final Binary deliveryTag)
+ {
+ _lastUnackedMessage = deliveryTag;
+ }
+
+ void preReceiveAction(final org.apache.qpid.amqp_1_0.client.Message msg)
+ {
+ int acknowledgeMode = _session.getAckModeEnum().ordinal();
+
+ if(acknowledgeMode == Session.AUTO_ACKNOWLEDGE
+ || acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE
+ || acknowledgeMode == Session.SESSION_TRANSACTED)
+ {
+ acknowledge(msg);
+ if(acknowledgeMode == Session.SESSION_TRANSACTED)
+ {
+ _txnMsgs.add(msg.getDeliveryTag());
+ }
+ }
+ else if(acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
+ {
+ setLastUnackedMessage(msg.getDeliveryTag());
+ }
+ }
+
+ void acknowledgeAll()
+ {
+ if(_lastUnackedMessage != null)
+ {
+ Transaction txn = _session.getTxn();
+ _receiver.acknowledgeAll(_lastUnackedMessage, txn, null);
+ if(txn != null)
+ {
+ _lastTxnUpdate = _lastUnackedMessage;
+ }
+ _lastUnackedMessage = null;
+
+ }
+ _recoverReplayMessages.clear();
+ if(!_replaymessages.isEmpty())
+ {
+ _recoverReplayMessages.addAll(_replaymessages);
+ }
+ }
+
+ void postRollback()
+ {
+ if(_lastTxnUpdate != null)
+ {
+ final Modified outcome = new Modified();
+ outcome.setDeliveryFailed(true);
+ _receiver.updateAll(outcome, _lastTxnUpdate);
+ _lastTxnUpdate = null;
+ }
+ for(Binary tag : _txnMsgs)
+ {
+ _receiver.modified(tag);
+ }
+ _txnMsgs.clear();
+ }
+
+ void postCommit()
+ {
+ _lastTxnUpdate = null;
+ _txnMsgs.clear();
+ }
+
+ public DestinationImpl getDestination() throws IllegalStateException
+ {
+ checkClosed();
+ return _destination;
+ }
+
+
+ public SessionImpl getSession() throws IllegalStateException
+ {
+ checkClosed();
+ return _session;
+ }
+
+ public boolean getNoLocal() throws IllegalStateException
+ {
+ checkClosed();
+ return _noLocal;
+ }
+
+ public void start()
+ {
+ _receiver.setCredit(UnsignedInteger.valueOf(100), true);
+ }
+
+ public Queue getQueue() throws JMSException
+ {
+ return (Queue) getDestination();
+ }
+
+ public Topic getTopic() throws JMSException
+ {
+ return (Topic) getDestination();
+ }
+
+ void setQueueConsumer(final boolean queueConsumer)
+ {
+ _isQueueConsumer = queueConsumer;
+ }
+
+ void setTopicSubscriber(final boolean topicSubscriber)
+ {
+ _isTopicSubscriber = topicSubscriber;
+ }
+
+ String getLinkName()
+ {
+ return _linkName;
+ }
+
+ boolean isDurable()
+ {
+ return _durable;
+ }
+
+ void doRecover()
+ {
+ _replaymessages.clear();
+ if(!_recoverReplayMessages.isEmpty())
+ {
+ _replaymessages.addAll(_recoverReplayMessages);
+ for(Message msg : _replaymessages)
+ {
+ _session.messageArrived(this);
+ }
+ }
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageFactory.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageFactory.java
index 216107e53e..a52510d132 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageFactory.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageFactory.java
@@ -1,191 +1,191 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.client.Message;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.*;
-
-class MessageFactory
-{
- private final SessionImpl _session;
-
-
- MessageFactory(final SessionImpl session)
- {
- _session = session;
- }
-
- public MessageImpl createMessage(final DestinationImpl destination, final Message msg)
- {
- MessageImpl message;
- List<Section> payload = msg.getPayload();
- Header header = null;
- MessageAnnotations messageAnnotations = null;
-
- Properties properties = null;
- ApplicationProperties appProperties = null;
- Footer footer;
-
- Iterator<Section> iter = payload.iterator();
- List<Section> body = new ArrayList<Section>();
-
- Section section = iter.hasNext() ? iter.next() : null;
-
- if(section instanceof Header)
- {
- header = (Header) section;
- section = iter.hasNext() ? iter.next() : null;
- }
-
- if(section instanceof MessageAnnotations)
- {
- messageAnnotations = (MessageAnnotations) section;
- section = iter.hasNext() ? iter.next() : null;
- }
-
- if(section instanceof Properties)
- {
- properties = (Properties) section;
- section = iter.hasNext() ? iter.next() : null;
- }
-
- if(section instanceof ApplicationProperties)
- {
- appProperties = (ApplicationProperties) section;
- section = iter.hasNext() ? iter.next() : null;
- }
-
- while(section != null && !(section instanceof Footer))
- {
- body.add(section);
- section = iter.hasNext() ? iter.next() : null;
- }
-
- footer = (Footer) section;
-
- if(body.size() == 1)
- {
- Section bodySection = body.get(0);
- if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof Map)
- {
- message = new MapMessageImpl(header, messageAnnotations, properties, appProperties, (Map) ((AmqpValue)bodySection).getValue(), footer, _session);
- }
- else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof List)
- {
- message = new StreamMessageImpl(header, messageAnnotations, properties, appProperties,
- (List) ((AmqpValue)bodySection).getValue(), footer, _session);
- }
- else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof String)
- {
- message = new TextMessageImpl(header, messageAnnotations, properties, appProperties,
- (String) ((AmqpValue)bodySection).getValue(), footer, _session);
- }
- else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof Binary)
- {
-
- Binary value = (Binary) ((AmqpValue) bodySection).getValue();
- message = new BytesMessageImpl(header, messageAnnotations, properties, appProperties,
- new Data(value), footer, _session);
- }
- else if(bodySection instanceof Data)
- {
- if(properties != null && ObjectMessageImpl.CONTENT_TYPE.equals(properties.getContentType()))
- {
-
-
- message = new ObjectMessageImpl(header, messageAnnotations, properties, appProperties,
- (Data) bodySection,
- footer,
- _session);
- }
- else
- {
- message = new BytesMessageImpl(header, messageAnnotations, properties, appProperties, (Data) bodySection, footer, _session);
- }
- }
- else if(bodySection instanceof AmqpSequence)
- {
- message = new StreamMessageImpl(header, messageAnnotations, properties, appProperties, ((AmqpSequence) bodySection).getValue(), footer, _session);
- }
-
- /*else if(bodySection instanceof AmqpDataSection)
- {
- AmqpDataSection dataSection = (AmqpDataSection) bodySection;
-
- List<Object> data = new ArrayList<Object>();
-
- ListIterator<Object> dataIter = dataSection.iterator();
-
- while(dataIter.hasNext())
- {
- data.add(dataIter.next());
- }
-
- if(data.size() == 1)
- {
- final Object obj = data.get(0);
- if( obj instanceof String)
- {
- message = new TextMessageImpl(header,properties,appProperties,(String) data.get(0),footer, _session);
- }
- else if(obj instanceof JavaSerializable)
- {
- // TODO - ObjectMessage
- message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
- }
- else if(obj instanceof Serializable)
- {
- message = new ObjectMessageImpl(header,properties,footer,appProperties,(Serializable)obj, _session);
- }
- else
- {
- message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
- }
- }
- else
- {
- // not a text message
- message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
- }
- }*/
- else
- {
- message = new AmqpMessageImpl(header,messageAnnotations, properties,appProperties,body,footer, _session);
- }
- }
- else
- {
- message = new AmqpMessageImpl(header,messageAnnotations, properties,appProperties,body,footer, _session);
- }
-
- message.setReadOnly();
-
- return message;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.client.Message;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+import java.util.*;
+
+class MessageFactory
+{
+ private final SessionImpl _session;
+
+
+ MessageFactory(final SessionImpl session)
+ {
+ _session = session;
+ }
+
+ public MessageImpl createMessage(final DestinationImpl destination, final Message msg)
+ {
+ MessageImpl message;
+ List<Section> payload = msg.getPayload();
+ Header header = null;
+ MessageAnnotations messageAnnotations = null;
+
+ Properties properties = null;
+ ApplicationProperties appProperties = null;
+ Footer footer;
+
+ Iterator<Section> iter = payload.iterator();
+ List<Section> body = new ArrayList<Section>();
+
+ Section section = iter.hasNext() ? iter.next() : null;
+
+ if(section instanceof Header)
+ {
+ header = (Header) section;
+ section = iter.hasNext() ? iter.next() : null;
+ }
+
+ if(section instanceof MessageAnnotations)
+ {
+ messageAnnotations = (MessageAnnotations) section;
+ section = iter.hasNext() ? iter.next() : null;
+ }
+
+ if(section instanceof Properties)
+ {
+ properties = (Properties) section;
+ section = iter.hasNext() ? iter.next() : null;
+ }
+
+ if(section instanceof ApplicationProperties)
+ {
+ appProperties = (ApplicationProperties) section;
+ section = iter.hasNext() ? iter.next() : null;
+ }
+
+ while(section != null && !(section instanceof Footer))
+ {
+ body.add(section);
+ section = iter.hasNext() ? iter.next() : null;
+ }
+
+ footer = (Footer) section;
+
+ if(body.size() == 1)
+ {
+ Section bodySection = body.get(0);
+ if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof Map)
+ {
+ message = new MapMessageImpl(header, messageAnnotations, properties, appProperties, (Map) ((AmqpValue)bodySection).getValue(), footer, _session);
+ }
+ else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof List)
+ {
+ message = new StreamMessageImpl(header, messageAnnotations, properties, appProperties,
+ (List) ((AmqpValue)bodySection).getValue(), footer, _session);
+ }
+ else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof String)
+ {
+ message = new TextMessageImpl(header, messageAnnotations, properties, appProperties,
+ (String) ((AmqpValue)bodySection).getValue(), footer, _session);
+ }
+ else if(bodySection instanceof AmqpValue && ((AmqpValue)bodySection).getValue() instanceof Binary)
+ {
+
+ Binary value = (Binary) ((AmqpValue) bodySection).getValue();
+ message = new BytesMessageImpl(header, messageAnnotations, properties, appProperties,
+ new Data(value), footer, _session);
+ }
+ else if(bodySection instanceof Data)
+ {
+ if(properties != null && ObjectMessageImpl.CONTENT_TYPE.equals(properties.getContentType()))
+ {
+
+
+ message = new ObjectMessageImpl(header, messageAnnotations, properties, appProperties,
+ (Data) bodySection,
+ footer,
+ _session);
+ }
+ else
+ {
+ message = new BytesMessageImpl(header, messageAnnotations, properties, appProperties, (Data) bodySection, footer, _session);
+ }
+ }
+ else if(bodySection instanceof AmqpSequence)
+ {
+ message = new StreamMessageImpl(header, messageAnnotations, properties, appProperties, ((AmqpSequence) bodySection).getValue(), footer, _session);
+ }
+
+ /*else if(bodySection instanceof AmqpDataSection)
+ {
+ AmqpDataSection dataSection = (AmqpDataSection) bodySection;
+
+ List<Object> data = new ArrayList<Object>();
+
+ ListIterator<Object> dataIter = dataSection.iterator();
+
+ while(dataIter.hasNext())
+ {
+ data.add(dataIter.next());
+ }
+
+ if(data.size() == 1)
+ {
+ final Object obj = data.get(0);
+ if( obj instanceof String)
+ {
+ message = new TextMessageImpl(header,properties,appProperties,(String) data.get(0),footer, _session);
+ }
+ else if(obj instanceof JavaSerializable)
+ {
+ // TODO - ObjectMessage
+ message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
+ }
+ else if(obj instanceof Serializable)
+ {
+ message = new ObjectMessageImpl(header,properties,footer,appProperties,(Serializable)obj, _session);
+ }
+ else
+ {
+ message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
+ }
+ }
+ else
+ {
+ // not a text message
+ message = new AmqpMessageImpl(header,properties,appProperties,body,footer, _session);
+ }
+ }*/
+ else
+ {
+ message = new AmqpMessageImpl(header,messageAnnotations, properties,appProperties,body,footer, _session);
+ }
+ }
+ else
+ {
+ message = new AmqpMessageImpl(header,messageAnnotations, properties,appProperties,body,footer, _session);
+ }
+
+ message.setReadOnly();
+
+ return message;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
index fba50c5477..fed9b5904f 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageImpl.java
@@ -1,1332 +1,1353 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.Message;
-import org.apache.qpid.amqp_1_0.messaging.MessageAttributes;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.UnsignedByte;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.UnsignedLong;
-import org.apache.qpid.amqp_1_0.type.UnsignedShort;
-import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
-import org.apache.qpid.amqp_1_0.type.messaging.Footer;
-import org.apache.qpid.amqp_1_0.type.messaging.Header;
-import org.apache.qpid.amqp_1_0.type.messaging.MessageAnnotations;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-import java.nio.charset.Charset;
-import java.util.*;
-
-public abstract class MessageImpl implements Message
-{
- static final Set<Class> _supportedClasses =
- new HashSet<Class>(Arrays.asList(Boolean.class, Byte.class, Short.class, Integer.class, Long.class,
- Float.class, Double.class, Character.class, String.class, byte[].class));
- static final Symbol JMS_TYPE = Symbol.valueOf("x-opt-jms-type");
- static final Symbol TO_TYPE = Symbol.valueOf("x-opt-to-type");
- static final Symbol REPLY_TO_TYPE = Symbol.valueOf("x-opt-reply-type");
-
- static final String QUEUE_ATTRIBUTE = "queue";
- static final String TOPIC_ATTRIBUTE = "topic";
- static final String TEMPORARY_ATTRIBUTE = "temporary";
-
- static final Set<String> JMS_QUEUE_ATTRIBUTES = set(QUEUE_ATTRIBUTE);
- static final Set<String> JMS_TOPIC_ATTRIBUTES = set(TOPIC_ATTRIBUTE);
- static final Set<String> JMS_TEMP_QUEUE_ATTRIBUTES = set(QUEUE_ATTRIBUTE, TEMPORARY_ATTRIBUTE);
- static final Set<String> JMS_TEMP_TOPIC_ATTRIBUTES = set(TOPIC_ATTRIBUTE, TEMPORARY_ATTRIBUTE);
-
- private Header _header;
- private Properties _properties;
- private ApplicationProperties _applicationProperties;
- private Footer _footer;
- private final SessionImpl _sessionImpl;
- private boolean _readOnly;
- private MessageAnnotations _messageAnnotations;
-
- private boolean _isFromQueue;
- private boolean _isFromTopic;
- private long _expiration;
-
- protected MessageImpl(Header header,
- MessageAnnotations messageAnnotations,
- Properties properties,
- ApplicationProperties appProperties,
- Footer footer,
- SessionImpl session)
- {
- _header = header == null ? new Header() : header;
- _properties = properties == null ? new Properties() : properties;
- _messageAnnotations = messageAnnotations == null ? new MessageAnnotations(new HashMap()) : messageAnnotations;
- _footer = footer == null ? new Footer(Collections.EMPTY_MAP) : footer;
- _applicationProperties = appProperties == null ? new ApplicationProperties(new HashMap()) : appProperties;
- _sessionImpl = session;
- }
-
- public String getJMSMessageID() throws JMSException
- {
- Object messageId = getMessageId();
-
- return messageId == null ? null : "ID:"+messageId.toString();
- }
-
- public void setJMSMessageID(String messageId) throws InvalidJMSMEssageIdException
- {
- if(messageId == null)
- {
- setMessageId(null);
- }
- else if(messageId.startsWith("ID:"))
- {
- setMessageId(messageId.substring(3));
- }
- else
- {
- throw new InvalidJMSMEssageIdException(messageId);
- }
- }
-
- public long getJMSTimestamp() throws JMSException
- {
- Date transmitTime = getTransmitTime();
- return transmitTime == null ? 0 : transmitTime.getTime();
- }
-
- public void setJMSTimestamp(long l) throws JMSException
- {
- setTransmitTime(new Date(l));
- if(_expiration != 0l)
- {
- setTtl(UnsignedInteger.valueOf(_expiration-getTransmitTime().getTime()));
- }
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- {
-
- Object o = getCorrelationId();
- if(o instanceof Binary)
- {
- Binary correlationIdBinary = (Binary) o;
- byte[] correlationId = new byte[correlationIdBinary.getLength()];
- correlationIdBinary.asByteBuffer().get(correlationId);
- return correlationId;
- }
- else
- {
- return o == null ? null : o.toString().getBytes();
- }
-
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] correlationId) throws JMSException
- {
- if(correlationId == null)
- {
- setCorrelationId(null);
- }
- else
- {
- byte[] dup = new byte[correlationId.length];
- System.arraycopy(correlationId,0,dup,0,correlationId.length);
- setCorrelationId(new Binary(dup));
- }
- }
-
- public void setJMSCorrelationID(String s) throws JMSException
- {
- getProperties().setCorrelationId(s);
- }
-
- public String getJMSCorrelationID() throws JMSException
- {
- Object o = getProperties().getCorrelationId();
- if(o instanceof Binary)
- {
- Binary id = (Binary) o;
- return new String(id.getArray(), id.getArrayOffset(), id.getLength());
- }
- else
- {
- return o == null ? null : o.toString();
- }
- }
-
- public DestinationImpl getJMSReplyTo() throws JMSException
- {
- return toDestination(getReplyTo(), splitCommaSeparateSet((String) getMessageAnnotation(REPLY_TO_TYPE)));
- }
-
- public void setJMSReplyTo(Destination destination) throws NonAMQPDestinationException
- {
- if( destination==null )
- {
- setReplyTo(null);
- messageAnnotationMap().remove(REPLY_TO_TYPE);
- }
- else
- {
- DecodedDestination dd = toDecodedDestination(destination);
- setReplyTo(dd.getAddress());
- messageAnnotationMap().put(REPLY_TO_TYPE, join(",", dd.getAttributes()));
- }
- }
-
- public DestinationImpl getJMSDestination() throws JMSException
- {
- Set<String> type = splitCommaSeparateSet((String) getMessageAnnotation(TO_TYPE));
- if( type==null )
- {
- if( _isFromQueue )
- {
- type = JMS_QUEUE_ATTRIBUTES;
- }
- else if( _isFromTopic )
- {
- type = JMS_TOPIC_ATTRIBUTES;
- }
- }
- return toDestination(getTo(), type);
- }
-
- public void setJMSDestination(Destination destination) throws NonAMQPDestinationException
- {
- if( destination==null )
- {
- setTo(null);
- messageAnnotationMap().remove(TO_TYPE);
- }
- else
- {
- DecodedDestination dd = toDecodedDestination(destination);
- setTo(dd.getAddress());
- messageAnnotationMap().put(TO_TYPE, join(",", dd.getAttributes()));
- }
- }
-
- public int getJMSDeliveryMode() throws JMSException
- {
- if(Boolean.FALSE.equals(getDurable()))
- {
- return DeliveryMode.NON_PERSISTENT;
- }
- else
- {
- return DeliveryMode.PERSISTENT;
- }
- }
-
- public void setJMSDeliveryMode(int deliveryMode) throws JMSException
- {
- switch(deliveryMode)
- {
- case DeliveryMode.NON_PERSISTENT:
- setDurable(false);
- break;
- case DeliveryMode.PERSISTENT:
- setDurable(true);
- break;
- default:
- //TODO
- }
- }
-
- public boolean getJMSRedelivered()
- {
- UnsignedInteger failures = getDeliveryFailures();
- return failures != null && (failures.intValue() != 0);
- }
-
- public void setJMSRedelivered(boolean redelivered)
- {
- UnsignedInteger failures = getDeliveryFailures();
- if(redelivered)
- {
- if(failures == null || UnsignedInteger.ZERO.equals(failures))
- {
- setDeliveryFailures(UnsignedInteger.ONE);
- }
- }
- else
- {
- setDeliveryFailures(null);
- }
- }
-
- public String getJMSType() throws JMSException
- {
- final Object attrValue = getMessageAnnotation(JMS_TYPE);
- return attrValue instanceof String ? attrValue.toString() : null;
- }
-
- public void setJMSType(String s) throws JMSException
- {
- messageAnnotationMap().put(JMS_TYPE, s);
- }
-
- public long getJMSExpiration() throws JMSException
- {
- final UnsignedInteger ttl = getTtl();
- return ttl == null || ttl.longValue() == 0 ? 0 : getJMSTimestamp() + ttl.longValue();
- }
-
- public void setJMSExpiration(long l) throws JMSException
- {
- _expiration = l;
- if(l == 0)
- {
- setTtl(UnsignedInteger.ZERO);
- }
- else
- {
- if(getTransmitTime() == null)
- {
- setTransmitTime(new Date());
- }
- setTtl(UnsignedInteger.valueOf(l - getTransmitTime().getTime()));
- }
- }
-
- public int getJMSPriority() throws JMSException
- {
- UnsignedByte priority = getPriority();
- return priority == null ? DEFAULT_PRIORITY : priority.intValue();
- }
-
- public void setJMSPriority(int i) throws InvalidJMSPriorityException
- {
- if(i >= 0 && i <= 255)
- {
- setPriority(UnsignedByte.valueOf((byte)i));
- }
- else
- {
- throw new InvalidJMSPriorityException(i);
- }
- }
-
- public void clearProperties() throws JMSException
- {
- _applicationProperties.getValue().clear();
- }
-
- public boolean propertyExists(final String s) throws JMSException
- {
- return propertyExists((Object) s);
- }
-
- public boolean getBooleanProperty(final String s) throws JMSException
- {
- return getBooleanProperty((Object) s);
- }
-
- public byte getByteProperty(final String s) throws JMSException
- {
- return getByteProperty((Object)s);
- }
-
- public short getShortProperty(final String s) throws JMSException
- {
- return getShortProperty((Object)s);
- }
-
- public int getIntProperty(final String s) throws JMSException
- {
- return getIntProperty((Object)s);
- }
-
- public long getLongProperty(final String s) throws JMSException
- {
- return getLongProperty((Object)s);
- }
-
- public float getFloatProperty(final String s) throws JMSException
- {
- return getFloatProperty((Object)s);
- }
-
- public double getDoubleProperty(final String s) throws JMSException
- {
- return getDoubleProperty((Object)s);
- }
-
- public String getStringProperty(final String s) throws JMSException
- {
- return getStringProperty((Object)s);
- }
-
- public Object getObjectProperty(final String s) throws JMSException
- {
- return getObjectProperty((Object)s);
- }
-
- public boolean propertyExists(Object name) throws JMSException
- {
- return _applicationProperties.getValue().containsKey(name);
- }
-
- public boolean getBooleanProperty(Object name) throws JMSException
- {
-
- Object value = getProperty(name);
-
- if (value instanceof Boolean)
- {
- return ((Boolean) value).booleanValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Boolean.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to boolean.");
- }
- }
-
- public byte getByteProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Byte)
- {
- return ((Byte) value).byteValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Byte.valueOf((String) value).byteValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to byte.");
- }
- }
-
- public short getShortProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Short)
- {
- return ((Short) value).shortValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).shortValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Short.valueOf((String) value).shortValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to short.");
- }
- }
-
- private Object getProperty(final Object name)
- {
- return _applicationProperties.getValue().get(name);
- }
-
- public int getIntProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Integer)
- {
- return ((Integer) value).intValue();
- }
- else if (value instanceof Short)
- {
- return ((Short) value).intValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).intValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Integer.valueOf((String) value).intValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to int.");
- }
- }
-
- public long getLongProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Long)
- {
- return ((Long) value).longValue();
- }
- else if (value instanceof Integer)
- {
- return ((Integer) value).longValue();
- }
-
- if (value instanceof Short)
- {
- return ((Short) value).longValue();
- }
-
- if (value instanceof Byte)
- {
- return ((Byte) value).longValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Long.valueOf((String) value).longValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to long.");
- }
- }
-
- public float getFloatProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Float)
- {
- return ((Float) value).floatValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Float.valueOf((String) value).floatValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to float.");
- }
- }
-
- public double getDoubleProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof Double)
- {
- return ((Double) value).doubleValue();
- }
- else if (value instanceof Float)
- {
- return ((Float) value).doubleValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Double.valueOf((String) value).doubleValue();
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to double.");
- }
- }
-
- public String getStringProperty(Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if ((value instanceof String) || (value == null))
- {
- return (String) value;
- }
- else if (value instanceof byte[])
- {
- throw new MessageFormatException("Property " + name + " of type byte[] " + "cannot be converted to String.");
- }
- else
- {
- return value.toString();
- }
- }
-
- public Object getObjectProperty(Object name) throws JMSException
- {
- return getProperty(name);
- }
-
- public List<Object> getListProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
- if(value instanceof List || value == null)
- {
- return (List<Object>)value;
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to List.");
- }
- }
-
- public Map<Object, Object> getMapProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
- if(value instanceof Map || value == null)
- {
- return (Map<Object,Object>)value;
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to Map.");
- }
- }
-
- public UnsignedByte getUnsignedByteProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof UnsignedByte)
- {
- return (UnsignedByte) value;
- }
- else if ((value instanceof String) || (value == null))
- {
- return UnsignedByte.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to UnsignedByte.");
- }
- }
-
- public UnsignedShort getUnsignedShortProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof UnsignedShort)
- {
- return (UnsignedShort) value;
- }
- else if (value instanceof UnsignedByte)
- {
- return UnsignedShort.valueOf(((UnsignedByte)value).shortValue());
- }
- else if ((value instanceof String) || (value == null))
- {
- return UnsignedShort.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to UnsignedShort.");
- }
- }
-
- public UnsignedInteger getUnsignedIntProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof UnsignedInteger)
- {
- return (UnsignedInteger) value;
- }
- else if (value instanceof UnsignedByte)
- {
- return UnsignedInteger.valueOf(((UnsignedByte)value).intValue());
- }
- else if (value instanceof UnsignedShort)
- {
- return UnsignedInteger.valueOf(((UnsignedShort)value).intValue());
- }
- else if ((value instanceof String) || (value == null))
- {
- return UnsignedInteger.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to UnsignedShort.");
- }
- }
-
- public UnsignedLong getUnsignedLongProperty(final Object name) throws JMSException
- {
- Object value = getProperty(name);
-
- if (value instanceof UnsignedLong)
- {
- return (UnsignedLong) value;
- }
- else if (value instanceof UnsignedByte)
- {
- return UnsignedLong.valueOf(((UnsignedByte)value).longValue());
- }
- else if (value instanceof UnsignedShort)
- {
- return UnsignedLong.valueOf(((UnsignedShort)value).longValue());
- }
- else if (value instanceof UnsignedInteger)
- {
- return UnsignedLong.valueOf(((UnsignedInteger)value).longValue());
- }
- else if ((value instanceof String) || (value == null))
- {
- return UnsignedLong.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
- + " cannot be converted to UnsignedShort.");
- }
- }
-
- public Enumeration getPropertyNames() throws JMSException
- {
- final Collection<String> names = new ArrayList<String>();
- for(Object key : _applicationProperties.getValue().keySet())
- {
- if(key instanceof String)
- {
- names.add((String)key);
- }
- }
- return Collections.enumeration(names);
- }
-
- public void setBooleanProperty(final String s, final boolean b) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
- setBooleanProperty((Object)s, b);
- }
-
- protected void checkPropertyName(CharSequence propertyName)
- {
- if (propertyName == null)
- {
- throw new IllegalArgumentException("Property name must not be null");
- }
- else if (propertyName.length() == 0)
- {
- throw new IllegalArgumentException("Property name must not be the empty string");
- }
-
- checkIdentiferFormat(propertyName);
- }
-
- protected void checkIdentiferFormat(CharSequence propertyName)
- {
-// JMS requirements 3.5.1 Property Names
-// Identifiers:
-// - An identifier is an unlimited-length character sequence that must begin
-// with a Java identifier start character; all following characters must be Java
-// identifier part characters. An identifier start character is any character for
-// which the method Character.isJavaIdentifierStart returns true. This includes
-// '_' and '$'. An identifier part character is any character for which the
-// method Character.isJavaIdentifierPart returns true.
-// - Identifiers cannot be the names NULL, TRUE, or FALSE.
-// Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or
-// ESCAPE.
-// Identifiers are either header field references or property references. The
-// type of a property value in a message selector corresponds to the type
-// used to set the property. If a property that does not exist in a message is
-// referenced, its value is NULL. The semantics of evaluating NULL values
-// in a selector are described in Section 3.8.1.2, Null Values.
-// The conversions that apply to the get methods for properties do not
-// apply when a property is used in a message selector expression. For
-// example, suppose you set a property as a string value, as in the
-// following:
-// myMessage.setStringProperty("NumberOfOrders", "2")
-// The following expression in a message selector would evaluate to false,
-// because a string cannot be used in an arithmetic expression:
-// "NumberOfOrders > 1"
-// Identifiers are case sensitive.
-// Message header field references are restricted to JMSDeliveryMode,
-// JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and
-// JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be
-// null and if so are treated as a NULL value.
-
- // JMS start character
- if (!(Character.isJavaIdentifierStart(propertyName.charAt(0))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' does not start with a valid JMS identifier start character");
- }
-
- // JMS part character
- int length = propertyName.length();
- for (int c = 1; c < length; c++)
- {
- if (!(Character.isJavaIdentifierPart(propertyName.charAt(c))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' contains an invalid JMS identifier character");
- }
- }
-
- // JMS invalid names
- if ((propertyName.equals("NULL")
- || propertyName.equals("TRUE")
- || propertyName.equals("FALSE")
- || propertyName.equals("NOT")
- || propertyName.equals("AND")
- || propertyName.equals("OR")
- || propertyName.equals("BETWEEN")
- || propertyName.equals("LIKE")
- || propertyName.equals("IN")
- || propertyName.equals("IS")
- || propertyName.equals("ESCAPE")))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' is not allowed in JMS");
- }
-
- }
-
- public void setByteProperty(final String s, final byte b) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setByteProperty((Object)s, b);
- }
-
- public void setShortProperty(final String s, final short i) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setShortProperty((Object)s, i);
- }
-
- public void setIntProperty(final String s, final int i) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setIntProperty((Object)s, i);
- }
-
- public void setLongProperty(final String s, final long l) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setLongProperty((Object)s, l);
- }
-
- public void setFloatProperty(final String s, final float v) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setFloatProperty((Object) s, v);
- }
-
- public void setDoubleProperty(final String s, final double v) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setDoubleProperty((Object)s, v);
- }
-
- public void setStringProperty(final String s, final String s1) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- setStringProperty((Object)s, s1);
- }
-
- public void setObjectProperty(final String s, final Object o) throws JMSException
- {
- checkWritable();
- checkPropertyName(s);
-
- if(o != null && (_supportedClasses.contains(o.getClass())))
- {
- setObjectProperty((Object)s, o);
- }
- else
- {
- throw new MessageFormatException("Cannot call setObjectProperty with a value of " + ((o == null) ? "null" : " class "+o.getClass().getName()) + ".");
- }
- }
-
- public void setBooleanProperty(Object name, boolean b) throws JMSException
- {
- _applicationProperties.getValue().put(name, b);
- }
-
- public void setByteProperty(Object name, byte b) throws JMSException
- {
- _applicationProperties.getValue().put(name, b);
- }
-
- public void setShortProperty(Object name, short i) throws JMSException
- {
- _applicationProperties.getValue().put(name, i);
- }
-
- public void setIntProperty(Object name, int i) throws JMSException
- {
- _applicationProperties.getValue().put(name, i);
- }
-
- public void setLongProperty(Object name, long l) throws JMSException
- {
- _applicationProperties.getValue().put(name, l);
- }
-
- public void setFloatProperty(Object name, float v) throws JMSException
- {
- _applicationProperties.getValue().put(name, v);
- }
-
- public void setDoubleProperty(Object name, double v) throws JMSException
- {
- _applicationProperties.getValue().put(name, v);
- }
-
- public void setStringProperty(Object name, String value) throws JMSException
- {
- _applicationProperties.getValue().put(name, value);
- }
-
- public void setObjectProperty(Object name, Object value) throws JMSException
- {
- _applicationProperties.getValue().put(name, value);
- }
-
- public void setListProperty(final Object name, final List<Object> list) throws JMSException
- {
- _applicationProperties.getValue().put(name, list);
- }
-
- public void setMapProperty(final Object name, final Map<Object, Object> map) throws JMSException
- {
- _applicationProperties.getValue().put(name, map);
- }
-
- public void setUnsignedByteProperty(final Object name, final UnsignedByte b) throws JMSException
- {
- _applicationProperties.getValue().put(name, b);
- }
-
- public void setUnsignedShortProperty(final Object name, final UnsignedShort s) throws JMSException
- {
- _applicationProperties.getValue().put(name, s);
- }
-
- public void setUnsignedIntProperty(final Object name, final UnsignedInteger i) throws JMSException
- {
- _applicationProperties.getValue().put(name, i);
- }
-
- public void setUnsignedLongProperty(final Object name, final UnsignedLong l) throws JMSException
- {
- _applicationProperties.getValue().put(name, l);
- }
-
- public UnsignedInteger getDeliveryFailures()
- {
- return _header.getDeliveryCount();
- }
-
- public void setDeliveryFailures(UnsignedInteger failures)
- {
- _header.setDeliveryCount(failures);
- }
-
- public MessageAttributes getHeaderMessageAttrs()
- {
- // TODO
- return null ; // _header.getMessageAttrs();
- }
-
- public void setHeaderMessageAttrs(final MessageAttributes messageAttrs)
- {
- // TODO
- }
-
- public MessageAttributes getHeaderDeliveryAttrs()
- {
- // TODO
- return null ; //_header.getDeliveryAttrs();
- }
-
- public void setHeaderDeliveryAttrs(final MessageAttributes deliveryAttrs)
- {
- //TODO
- }
-
- public Boolean getDurable()
- {
- return _header.getDurable();
- }
-
- public void setDurable(final Boolean durable)
- {
- _header.setDurable(durable);
- }
-
- public UnsignedByte getPriority()
- {
- return _header.getPriority();
- }
-
- public void setPriority(final UnsignedByte priority)
- {
- _header.setPriority(priority);
- }
-
- public Date getTransmitTime()
- {
- return _properties.getCreationTime();
- }
-
- public void setTransmitTime(final Date transmitTime)
- {
- _properties.setCreationTime(transmitTime);
- }
-
- public UnsignedInteger getTtl()
- {
- return _header.getTtl();
- }
-
- public void setTtl(final UnsignedInteger ttl)
- {
- _header.setTtl(ttl);
- }
-
- public UnsignedInteger getFormerAcquirers()
- {
- return _header.getDeliveryCount();
- }
-
- public void setFormerAcquirers(final UnsignedInteger formerAcquirers)
- {
- _header.setDeliveryCount(formerAcquirers);
- }
-
- public Object getMessageId()
- {
- return _properties.getMessageId();
- }
-
- public void setMessageId(final Object messageId)
- {
- _properties.setMessageId(messageId);
- }
-
- public Binary getUserId()
- {
- return _properties.getUserId();
- }
-
- public void setUserId(final Binary userId)
- {
- _properties.setUserId(userId);
- }
-
- public String getTo()
- {
- return _properties.getTo();
- }
-
- public void setTo(final String to)
- {
- _properties.setTo(to);
- }
-
- public String getSubject()
- {
- return _properties.getSubject();
- }
-
- public void setSubject(final String subject)
- {
- _properties.setSubject(subject);
- }
-
- public String getReplyTo()
- {
- return _properties.getReplyTo();
- }
-
- public void setReplyTo(final String replyTo)
- {
- _properties.setReplyTo(replyTo);
- }
-
- public Object getCorrelationId()
- {
- return _properties.getCorrelationId();
- }
-
- public void setCorrelationId(final Binary correlationId)
- {
- _properties.setCorrelationId(correlationId);
- }
-
- public Symbol getContentType()
- {
- return _properties.getContentType();
- }
-
- public void setContentType(final Symbol contentType)
- {
- _properties.setContentType(contentType);
- }
-
- public void acknowledge() throws JMSException
- {
- _sessionImpl.acknowledgeAll();
- }
-
- public void clearBody() throws JMSException
- {
- _readOnly = false;
- }
-
- protected boolean isReadOnly()
- {
- return _readOnly;
- }
-
- protected void checkReadable() throws MessageNotReadableException
- {
- if (!isReadOnly())
- {
- throw new MessageNotReadableException("You need to call reset() to make the message readable");
- }
- }
-
- protected void checkWritable() throws MessageNotWriteableException
- {
- if (isReadOnly())
- {
- throw new MessageNotWriteableException("You need to call clearBody() to make the message writable");
- }
- }
-
- public void setReadOnly()
- {
- _readOnly = true;
- }
-
- private static class InvalidJMSMEssageIdException extends JMSException
- {
- public InvalidJMSMEssageIdException(String messageId)
- {
- super("Invalid JMSMessageID: '" + messageId + "', JMSMessageID MUST start with 'ID:'");
- }
- }
-
- private class NonAMQPDestinationException extends JMSException
- {
- public NonAMQPDestinationException(Destination destination)
- {
- super("Destinations not a valid AMQP Destination, class of type: '"
- + destination.getClass().getName()
- + "', require '"
- + org.apache.qpid.amqp_1_0.jms.Destination.class.getName() + "'.");
- }
- }
-
- private class InvalidJMSPriorityException extends JMSException
- {
- public InvalidJMSPriorityException(int priority)
- {
- super("The provided priority: " + priority + " is not valid in AMQP, valid values are from 0 to 255");
- }
- }
-
- Header getHeader()
- {
- return _header;
- }
-
- Properties getProperties()
- {
- return _properties;
- }
-
-
- Footer getFooter()
- {
- return _footer;
- }
-
- MessageAnnotations getMessageAnnotations()
- {
- return _messageAnnotations;
- }
-
- public ApplicationProperties getApplicationProperties()
- {
- return _applicationProperties;
- }
-
- public void reset() throws JMSException
- {
- _readOnly = true;
- }
-
- void setFromQueue(final boolean fromQueue)
- {
- _isFromQueue = fromQueue;
- }
-
- void setFromTopic(final boolean fromTopic)
- {
- _isFromTopic = fromTopic;
- }
-
- abstract Collection<Section> getSections();
-
- DecodedDestination toDecodedDestination(Destination destination) throws NonAMQPDestinationException
- {
- if(destination == null)
- {
- return null;
- }
- if (destination instanceof DestinationImpl)
- {
- return _sessionImpl.getConnection().toDecodedDestination((DestinationImpl) destination);
- }
- throw new NonAMQPDestinationException(destination);
- }
-
- DestinationImpl toDestination(String address, Set<String> kind)
- {
- if( address == null )
- {
- return null;
- }
-
- // If destination prefixes are in play, we have to strip the the prefix, and we might
- // be able to infer the kind, if we don't know it yet.
- DecodedDestination decoded = _sessionImpl.getConnection().toDecodedDestination(address, kind);
- address = decoded.getAddress();
- kind = decoded.getAttributes();
-
- if( kind == null )
- {
- return DestinationImpl.valueOf(address);
- }
- if( kind.contains(QUEUE_ATTRIBUTE) )
- {
- if( kind.contains(TEMPORARY_ATTRIBUTE) )
- {
- return new TemporaryQueueImpl(address, null, _sessionImpl);
- }
- else
- {
- return QueueImpl.valueOf(address);
- }
- }
- else if ( kind.contains(TOPIC_ATTRIBUTE) )
- {
- if( kind.contains(TEMPORARY_ATTRIBUTE) )
- {
- return new TemporaryTopicImpl(address, null, _sessionImpl);
- }
- else
- {
- return TopicImpl.valueOf(address);
- }
- }
-
- return DestinationImpl.valueOf(address);
- }
-
- private Object getMessageAnnotation(Symbol key)
- {
- Map messageAttrs = _messageAnnotations == null ? null : _messageAnnotations.getValue();
- return messageAttrs == null ? null : messageAttrs.get(key);
- }
-
- private Map messageAnnotationMap()
- {
- Map messageAttrs = _messageAnnotations == null ? null : _messageAnnotations.getValue();
- if(messageAttrs == null)
- {
- messageAttrs = new HashMap();
- _messageAnnotations = new MessageAnnotations(messageAttrs);
- }
- return messageAttrs;
- }
-
- Set<String> splitCommaSeparateSet(String value)
- {
- if( value == null )
- {
- return null;
- }
- HashSet<String> rc = new HashSet<String>();
- for( String x: value.split("\\s*,\\s*") )
- {
- rc.add(x);
- }
- return rc;
- }
-
- private static Set<String> set(String ...args)
- {
- HashSet<String> s = new HashSet<String>();
- for (String arg : args)
- {
- s.add(arg);
- }
- return Collections.unmodifiableSet(s);
- }
-
- static final String join(String sep, Iterable items)
- {
- StringBuilder result = new StringBuilder();
-
- for (Object o : items)
- {
- if (result.length() > 0)
- {
- result.append(sep);
- }
- result.append(o.toString());
- }
-
- return result.toString();
- }
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.Message;
+import org.apache.qpid.amqp_1_0.messaging.MessageAttributes;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.UnsignedByte;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.UnsignedShort;
+import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
+import org.apache.qpid.amqp_1_0.type.messaging.Footer;
+import org.apache.qpid.amqp_1_0.type.messaging.Header;
+import org.apache.qpid.amqp_1_0.type.messaging.MessageAnnotations;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageFormatException;
+import javax.jms.MessageNotReadableException;
+import javax.jms.MessageNotWriteableException;
+import java.util.*;
+
+public abstract class MessageImpl implements Message
+{
+ static final Set<Class> _supportedClasses =
+ new HashSet<Class>(Arrays.asList(Boolean.class, Byte.class, Short.class, Integer.class, Long.class,
+ Float.class, Double.class, Character.class, String.class, byte[].class));
+ static final Symbol JMS_TYPE = Symbol.valueOf("x-opt-jms-type");
+ static final Symbol TO_TYPE = Symbol.valueOf("x-opt-to-type");
+ static final Symbol REPLY_TO_TYPE = Symbol.valueOf("x-opt-reply-type");
+
+ static final String QUEUE_ATTRIBUTE = "queue";
+ static final String TOPIC_ATTRIBUTE = "topic";
+ static final String TEMPORARY_ATTRIBUTE = "temporary";
+
+ static final Set<String> JMS_QUEUE_ATTRIBUTES = set(QUEUE_ATTRIBUTE);
+ static final Set<String> JMS_TOPIC_ATTRIBUTES = set(TOPIC_ATTRIBUTE);
+ static final Set<String> JMS_TEMP_QUEUE_ATTRIBUTES = set(QUEUE_ATTRIBUTE, TEMPORARY_ATTRIBUTE);
+ static final Set<String> JMS_TEMP_TOPIC_ATTRIBUTES = set(TOPIC_ATTRIBUTE, TEMPORARY_ATTRIBUTE);
+
+ private static final String JMSXGROUP_ID = "JMSXGroupID";
+
+ private Header _header;
+ private Properties _properties;
+ private ApplicationProperties _applicationProperties;
+ private Footer _footer;
+ private final SessionImpl _sessionImpl;
+ private boolean _readOnly;
+ private MessageAnnotations _messageAnnotations;
+
+ private boolean _isFromQueue;
+ private boolean _isFromTopic;
+ private long _expiration;
+
+ protected MessageImpl(Header header,
+ MessageAnnotations messageAnnotations,
+ Properties properties,
+ ApplicationProperties appProperties,
+ Footer footer,
+ SessionImpl session)
+ {
+ _header = header == null ? new Header() : header;
+ _properties = properties == null ? new Properties() : properties;
+ _messageAnnotations = messageAnnotations == null ? new MessageAnnotations(new HashMap()) : messageAnnotations;
+ _footer = footer == null ? new Footer(Collections.EMPTY_MAP) : footer;
+ _applicationProperties = appProperties == null ? new ApplicationProperties(new HashMap()) : appProperties;
+ _sessionImpl = session;
+ }
+
+ public String getJMSMessageID() throws JMSException
+ {
+ Object messageId = getMessageId();
+
+ return messageId == null ? null : "ID:"+messageId.toString();
+ }
+
+ public void setJMSMessageID(String messageId) throws InvalidJMSMEssageIdException
+ {
+ if(messageId == null)
+ {
+ setMessageId(null);
+ }
+ else if(messageId.startsWith("ID:"))
+ {
+ setMessageId(messageId.substring(3));
+ }
+ else
+ {
+ throw new InvalidJMSMEssageIdException(messageId);
+ }
+ }
+
+ public long getJMSTimestamp() throws JMSException
+ {
+ Date transmitTime = getTransmitTime();
+ return transmitTime == null ? 0 : transmitTime.getTime();
+ }
+
+ public void setJMSTimestamp(long l) throws JMSException
+ {
+ setTransmitTime(new Date(l));
+ if(_expiration != 0l)
+ {
+ setTtl(UnsignedInteger.valueOf(_expiration-getTransmitTime().getTime()));
+ }
+ }
+
+ public byte[] getJMSCorrelationIDAsBytes() throws JMSException
+ {
+
+ Object o = getCorrelationId();
+ if(o instanceof Binary)
+ {
+ Binary correlationIdBinary = (Binary) o;
+ byte[] correlationId = new byte[correlationIdBinary.getLength()];
+ correlationIdBinary.asByteBuffer().get(correlationId);
+ return correlationId;
+ }
+ else
+ {
+ return o == null ? null : o.toString().getBytes();
+ }
+
+ }
+
+ public void setJMSCorrelationIDAsBytes(byte[] correlationId) throws JMSException
+ {
+ if(correlationId == null)
+ {
+ setCorrelationId(null);
+ }
+ else
+ {
+ byte[] dup = new byte[correlationId.length];
+ System.arraycopy(correlationId,0,dup,0,correlationId.length);
+ setCorrelationId(new Binary(dup));
+ }
+ }
+
+ public void setJMSCorrelationID(String s) throws JMSException
+ {
+ getProperties().setCorrelationId(s);
+ }
+
+ public String getJMSCorrelationID() throws JMSException
+ {
+ Object o = getProperties().getCorrelationId();
+ if(o instanceof Binary)
+ {
+ Binary id = (Binary) o;
+ return new String(id.getArray(), id.getArrayOffset(), id.getLength());
+ }
+ else
+ {
+ return o == null ? null : o.toString();
+ }
+ }
+
+ public DestinationImpl getJMSReplyTo() throws JMSException
+ {
+ return toDestination(getReplyTo(), splitCommaSeparateSet((String) getMessageAnnotation(REPLY_TO_TYPE)));
+ }
+
+ public void setJMSReplyTo(Destination destination) throws NonAMQPDestinationException
+ {
+ if( destination==null )
+ {
+ setReplyTo(null);
+ messageAnnotationMap().remove(REPLY_TO_TYPE);
+ }
+ else
+ {
+ DecodedDestination dd = toDecodedDestination(destination);
+ setReplyTo(dd.getAddress());
+ messageAnnotationMap().put(REPLY_TO_TYPE, join(",", dd.getAttributes()));
+ }
+ }
+
+ public DestinationImpl getJMSDestination() throws JMSException
+ {
+ Set<String> type = splitCommaSeparateSet((String) getMessageAnnotation(TO_TYPE));
+ if( type==null )
+ {
+ if( _isFromQueue )
+ {
+ type = JMS_QUEUE_ATTRIBUTES;
+ }
+ else if( _isFromTopic )
+ {
+ type = JMS_TOPIC_ATTRIBUTES;
+ }
+ }
+ return toDestination(getTo(), type);
+ }
+
+ public void setJMSDestination(Destination destination) throws NonAMQPDestinationException
+ {
+ if( destination==null )
+ {
+ setTo(null);
+ messageAnnotationMap().remove(TO_TYPE);
+ }
+ else
+ {
+ DecodedDestination dd = toDecodedDestination(destination);
+ setTo(dd.getAddress());
+ messageAnnotationMap().put(TO_TYPE, join(",", dd.getAttributes()));
+ }
+ }
+
+ public int getJMSDeliveryMode() throws JMSException
+ {
+ if(Boolean.FALSE.equals(getDurable()))
+ {
+ return DeliveryMode.NON_PERSISTENT;
+ }
+ else
+ {
+ return DeliveryMode.PERSISTENT;
+ }
+ }
+
+ public void setJMSDeliveryMode(int deliveryMode) throws JMSException
+ {
+ switch(deliveryMode)
+ {
+ case DeliveryMode.NON_PERSISTENT:
+ setDurable(false);
+ break;
+ case DeliveryMode.PERSISTENT:
+ setDurable(true);
+ break;
+ default:
+ //TODO
+ }
+ }
+
+ public boolean getJMSRedelivered()
+ {
+ UnsignedInteger failures = getDeliveryFailures();
+ return failures != null && (failures.intValue() != 0);
+ }
+
+ public void setJMSRedelivered(boolean redelivered)
+ {
+ UnsignedInteger failures = getDeliveryFailures();
+ if(redelivered)
+ {
+ if(failures == null || UnsignedInteger.ZERO.equals(failures))
+ {
+ setDeliveryFailures(UnsignedInteger.ONE);
+ }
+ }
+ else
+ {
+ setDeliveryFailures(null);
+ }
+ }
+
+ public String getJMSType() throws JMSException
+ {
+ final Object attrValue = getMessageAnnotation(JMS_TYPE);
+ return attrValue instanceof String ? attrValue.toString() : null;
+ }
+
+ public void setJMSType(String s) throws JMSException
+ {
+ messageAnnotationMap().put(JMS_TYPE, s);
+ }
+
+ public long getJMSExpiration() throws JMSException
+ {
+ final UnsignedInteger ttl = getTtl();
+ return ttl == null || ttl.longValue() == 0 ? 0 : getJMSTimestamp() + ttl.longValue();
+ }
+
+ public void setJMSExpiration(long l) throws JMSException
+ {
+ _expiration = l;
+ if(l == 0)
+ {
+ setTtl(UnsignedInteger.ZERO);
+ }
+ else
+ {
+ if(getTransmitTime() == null)
+ {
+ setTransmitTime(new Date());
+ }
+ setTtl(UnsignedInteger.valueOf(l - getTransmitTime().getTime()));
+ }
+ }
+
+ public int getJMSPriority() throws JMSException
+ {
+ UnsignedByte priority = getPriority();
+ return priority == null ? DEFAULT_PRIORITY : priority.intValue();
+ }
+
+ public void setJMSPriority(int i) throws InvalidJMSPriorityException
+ {
+ if(i >= 0 && i <= 255)
+ {
+ setPriority(UnsignedByte.valueOf((byte)i));
+ }
+ else
+ {
+ throw new InvalidJMSPriorityException(i);
+ }
+ }
+
+ public void clearProperties() throws JMSException
+ {
+ _applicationProperties.getValue().clear();
+ }
+
+ public boolean propertyExists(final String s) throws JMSException
+ {
+ return propertyExists((Object) s);
+ }
+
+ public boolean getBooleanProperty(final String s) throws JMSException
+ {
+ return getBooleanProperty((Object) s);
+ }
+
+ public byte getByteProperty(final String s) throws JMSException
+ {
+ return getByteProperty((Object)s);
+ }
+
+ public short getShortProperty(final String s) throws JMSException
+ {
+ return getShortProperty((Object)s);
+ }
+
+ public int getIntProperty(final String s) throws JMSException
+ {
+ return getIntProperty((Object)s);
+ }
+
+ public long getLongProperty(final String s) throws JMSException
+ {
+ return getLongProperty((Object)s);
+ }
+
+ public float getFloatProperty(final String s) throws JMSException
+ {
+ return getFloatProperty((Object)s);
+ }
+
+ public double getDoubleProperty(final String s) throws JMSException
+ {
+ return getDoubleProperty((Object)s);
+ }
+
+ public String getStringProperty(final String s) throws JMSException
+ {
+ return getStringProperty((Object)s);
+ }
+
+ public Object getObjectProperty(final String s) throws JMSException
+ {
+ return getObjectProperty((Object)s);
+ }
+
+ public boolean propertyExists(Object name) throws JMSException
+ {
+ return _applicationProperties.getValue().containsKey(name);
+ }
+
+ public boolean getBooleanProperty(Object name) throws JMSException
+ {
+
+ Object value = getProperty(name);
+
+ if (value instanceof Boolean)
+ {
+ return ((Boolean) value).booleanValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Boolean.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to boolean.");
+ }
+ }
+
+ public byte getByteProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Byte)
+ {
+ return ((Byte) value).byteValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Byte.valueOf((String) value).byteValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to byte.");
+ }
+ }
+
+ public short getShortProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Short)
+ {
+ return ((Short) value).shortValue();
+ }
+ else if (value instanceof Byte)
+ {
+ return ((Byte) value).shortValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Short.valueOf((String) value).shortValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to short.");
+ }
+ }
+
+ private Object getProperty(final Object name)
+ {
+ if(JMSXGROUP_ID.equals(name))
+ {
+ return _properties.getGroupId();
+ }
+ return _applicationProperties.getValue().get(name);
+ }
+
+ public int getIntProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Integer)
+ {
+ return ((Integer) value).intValue();
+ }
+ else if (value instanceof Short)
+ {
+ return ((Short) value).intValue();
+ }
+ else if (value instanceof Byte)
+ {
+ return ((Byte) value).intValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Integer.valueOf((String) value).intValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to int.");
+ }
+ }
+
+ public long getLongProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Long)
+ {
+ return ((Long) value).longValue();
+ }
+ else if (value instanceof Integer)
+ {
+ return ((Integer) value).longValue();
+ }
+
+ if (value instanceof Short)
+ {
+ return ((Short) value).longValue();
+ }
+
+ if (value instanceof Byte)
+ {
+ return ((Byte) value).longValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Long.valueOf((String) value).longValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to long.");
+ }
+ }
+
+ public float getFloatProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Float)
+ {
+ return ((Float) value).floatValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Float.valueOf((String) value).floatValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to float.");
+ }
+ }
+
+ public double getDoubleProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof Double)
+ {
+ return ((Double) value).doubleValue();
+ }
+ else if (value instanceof Float)
+ {
+ return ((Float) value).doubleValue();
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return Double.valueOf((String) value).doubleValue();
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to double.");
+ }
+ }
+
+ public String getStringProperty(Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if ((value instanceof String) || (value == null))
+ {
+ return (String) value;
+ }
+ else if (value instanceof byte[])
+ {
+ throw new MessageFormatException("Property " + name + " of type byte[] " + "cannot be converted to String.");
+ }
+ else
+ {
+ return value.toString();
+ }
+ }
+
+ public Object getObjectProperty(Object name) throws JMSException
+ {
+ return getProperty(name);
+ }
+
+ public List<Object> getListProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+ if(value instanceof List || value == null)
+ {
+ return (List<Object>)value;
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to List.");
+ }
+ }
+
+ public Map<Object, Object> getMapProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+ if(value instanceof Map || value == null)
+ {
+ return (Map<Object,Object>)value;
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to Map.");
+ }
+ }
+
+ public UnsignedByte getUnsignedByteProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof UnsignedByte)
+ {
+ return (UnsignedByte) value;
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return UnsignedByte.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to UnsignedByte.");
+ }
+ }
+
+ public UnsignedShort getUnsignedShortProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof UnsignedShort)
+ {
+ return (UnsignedShort) value;
+ }
+ else if (value instanceof UnsignedByte)
+ {
+ return UnsignedShort.valueOf(((UnsignedByte)value).shortValue());
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return UnsignedShort.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to UnsignedShort.");
+ }
+ }
+
+ public UnsignedInteger getUnsignedIntProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof UnsignedInteger)
+ {
+ return (UnsignedInteger) value;
+ }
+ else if (value instanceof UnsignedByte)
+ {
+ return UnsignedInteger.valueOf(((UnsignedByte)value).intValue());
+ }
+ else if (value instanceof UnsignedShort)
+ {
+ return UnsignedInteger.valueOf(((UnsignedShort)value).intValue());
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return UnsignedInteger.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to UnsignedShort.");
+ }
+ }
+
+ public UnsignedLong getUnsignedLongProperty(final Object name) throws JMSException
+ {
+ Object value = getProperty(name);
+
+ if (value instanceof UnsignedLong)
+ {
+ return (UnsignedLong) value;
+ }
+ else if (value instanceof UnsignedByte)
+ {
+ return UnsignedLong.valueOf(((UnsignedByte)value).longValue());
+ }
+ else if (value instanceof UnsignedShort)
+ {
+ return UnsignedLong.valueOf(((UnsignedShort)value).longValue());
+ }
+ else if (value instanceof UnsignedInteger)
+ {
+ return UnsignedLong.valueOf(((UnsignedInteger)value).longValue());
+ }
+ else if ((value instanceof String) || (value == null))
+ {
+ return UnsignedLong.valueOf((String) value);
+ }
+ else
+ {
+ throw new MessageFormatException("Property " + name + " of type " + value.getClass().getName()
+ + " cannot be converted to UnsignedShort.");
+ }
+ }
+
+ public Enumeration getPropertyNames() throws JMSException
+ {
+ final Collection<String> names = new ArrayList<String>();
+ for(Object key : _applicationProperties.getValue().keySet())
+ {
+ if(key instanceof String)
+ {
+ names.add((String)key);
+ }
+ }
+ if(_properties.getGroupId() != null)
+ {
+ names.add(JMSXGROUP_ID);
+ }
+ return Collections.enumeration(names);
+ }
+
+ public void setBooleanProperty(final String s, final boolean b) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+ setBooleanProperty((Object)s, b);
+ }
+
+ protected void checkPropertyName(CharSequence propertyName)
+ {
+ if (propertyName == null)
+ {
+ throw new IllegalArgumentException("Property name must not be null");
+ }
+ else if (propertyName.length() == 0)
+ {
+ throw new IllegalArgumentException("Property name must not be the empty string");
+ }
+
+ checkIdentiferFormat(propertyName);
+ }
+
+ protected void checkIdentiferFormat(CharSequence propertyName)
+ {
+// JMS requirements 3.5.1 Property Names
+// Identifiers:
+// - An identifier is an unlimited-length character sequence that must begin
+// with a Java identifier start character; all following characters must be Java
+// identifier part characters. An identifier start character is any character for
+// which the method Character.isJavaIdentifierStart returns true. This includes
+// '_' and '$'. An identifier part character is any character for which the
+// method Character.isJavaIdentifierPart returns true.
+// - Identifiers cannot be the names NULL, TRUE, or FALSE.
+// Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or
+// ESCAPE.
+// Identifiers are either header field references or property references. The
+// type of a property value in a message selector corresponds to the type
+// used to set the property. If a property that does not exist in a message is
+// referenced, its value is NULL. The semantics of evaluating NULL values
+// in a selector are described in Section 3.8.1.2, Null Values.
+// The conversions that apply to the get methods for properties do not
+// apply when a property is used in a message selector expression. For
+// example, suppose you set a property as a string value, as in the
+// following:
+// myMessage.setStringProperty("NumberOfOrders", "2")
+// The following expression in a message selector would evaluate to false,
+// because a string cannot be used in an arithmetic expression:
+// "NumberOfOrders > 1"
+// Identifiers are case sensitive.
+// Message header field references are restricted to JMSDeliveryMode,
+// JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and
+// JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be
+// null and if so are treated as a NULL value.
+
+ // JMS start character
+ if (!(Character.isJavaIdentifierStart(propertyName.charAt(0))))
+ {
+ throw new IllegalArgumentException("Identifier '" + propertyName + "' does not start with a valid JMS identifier start character");
+ }
+
+ // JMS part character
+ int length = propertyName.length();
+ for (int c = 1; c < length; c++)
+ {
+ if (!(Character.isJavaIdentifierPart(propertyName.charAt(c))))
+ {
+ throw new IllegalArgumentException("Identifier '" + propertyName + "' contains an invalid JMS identifier character");
+ }
+ }
+
+ // JMS invalid names
+ if ((propertyName.equals("NULL")
+ || propertyName.equals("TRUE")
+ || propertyName.equals("FALSE")
+ || propertyName.equals("NOT")
+ || propertyName.equals("AND")
+ || propertyName.equals("OR")
+ || propertyName.equals("BETWEEN")
+ || propertyName.equals("LIKE")
+ || propertyName.equals("IN")
+ || propertyName.equals("IS")
+ || propertyName.equals("ESCAPE")))
+ {
+ throw new IllegalArgumentException("Identifier '" + propertyName + "' is not allowed in JMS");
+ }
+
+ }
+
+ public void setByteProperty(final String s, final byte b) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setByteProperty((Object)s, b);
+ }
+
+ public void setShortProperty(final String s, final short i) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setShortProperty((Object)s, i);
+ }
+
+ public void setIntProperty(final String s, final int i) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setIntProperty((Object)s, i);
+ }
+
+ public void setLongProperty(final String s, final long l) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setLongProperty((Object)s, l);
+ }
+
+ public void setFloatProperty(final String s, final float v) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setFloatProperty((Object) s, v);
+ }
+
+ public void setDoubleProperty(final String s, final double v) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setDoubleProperty((Object)s, v);
+ }
+
+ public void setStringProperty(final String s, final String s1) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ setStringProperty((Object)s, s1);
+ }
+
+ public void setObjectProperty(final String s, final Object o) throws JMSException
+ {
+ checkWritable();
+ checkPropertyName(s);
+
+ if(o != null && (_supportedClasses.contains(o.getClass())))
+ {
+ setObjectProperty((Object)s, o);
+ }
+ else
+ {
+ throw new MessageFormatException("Cannot call setObjectProperty with a value of " + ((o == null) ? "null" : " class "+o.getClass().getName()) + ".");
+ }
+ }
+
+ public void setBooleanProperty(Object name, boolean b)
+ {
+ setProperty(name, b);
+ }
+
+ public void setByteProperty(Object name, byte b)
+ {
+ setProperty(name, b);
+ }
+
+ public void setShortProperty(Object name, short i)
+ {
+ setProperty(name, i);
+ }
+
+ public void setIntProperty(Object name, int i)
+ {
+ setProperty(name, i);
+ }
+
+ public void setLongProperty(Object name, long l)
+ {
+ setProperty(name, l);
+ }
+
+ public void setFloatProperty(Object name, float v)
+ {
+ setProperty(name, v);
+ }
+
+ public void setDoubleProperty(Object name, double v)
+ {
+ setProperty(name, v);
+ }
+
+ public void setStringProperty(Object name, String value)
+ {
+ setProperty(name, value);
+ }
+
+ public void setObjectProperty(Object name, Object value)
+ {
+ setProperty(name, value);
+ }
+
+ private void setProperty(Object name, Object value)
+ {
+ if(JMSXGROUP_ID.equals(name))
+ {
+ _properties.setGroupId(value == null ? null : value.toString());
+ }
+ else
+ {
+ _applicationProperties.getValue().put(name, value);
+ }
+ }
+
+ public void setListProperty(final Object name, final List<Object> list)
+ {
+ setProperty(name, list);
+ }
+
+ public void setMapProperty(final Object name, final Map<Object, Object> map)
+ {
+ setProperty(name, map);
+ }
+
+ public void setUnsignedByteProperty(final Object name, final UnsignedByte b)
+ {
+ setProperty(name, b);
+ }
+
+ public void setUnsignedShortProperty(final Object name, final UnsignedShort s)
+ {
+ setProperty(name, s);
+ }
+
+ public void setUnsignedIntProperty(final Object name, final UnsignedInteger i)
+ {
+ setProperty(name, i);
+ }
+
+ public void setUnsignedLongProperty(final Object name, final UnsignedLong l)
+ {
+ setProperty(name, l);
+ }
+
+ public UnsignedInteger getDeliveryFailures()
+ {
+ return _header.getDeliveryCount();
+ }
+
+ public void setDeliveryFailures(UnsignedInteger failures)
+ {
+ _header.setDeliveryCount(failures);
+ }
+
+ public MessageAttributes getHeaderMessageAttrs()
+ {
+ // TODO
+ return null ; // _header.getMessageAttrs();
+ }
+
+ public void setHeaderMessageAttrs(final MessageAttributes messageAttrs)
+ {
+ // TODO
+ }
+
+ public MessageAttributes getHeaderDeliveryAttrs()
+ {
+ // TODO
+ return null ; //_header.getDeliveryAttrs();
+ }
+
+ public void setHeaderDeliveryAttrs(final MessageAttributes deliveryAttrs)
+ {
+ //TODO
+ }
+
+ public Boolean getDurable()
+ {
+ return _header.getDurable();
+ }
+
+ public void setDurable(final Boolean durable)
+ {
+ _header.setDurable(durable);
+ }
+
+ public UnsignedByte getPriority()
+ {
+ return _header.getPriority();
+ }
+
+ public void setPriority(final UnsignedByte priority)
+ {
+ _header.setPriority(priority);
+ }
+
+ public Date getTransmitTime()
+ {
+ return _properties.getCreationTime();
+ }
+
+ public void setTransmitTime(final Date transmitTime)
+ {
+ _properties.setCreationTime(transmitTime);
+ }
+
+ public UnsignedInteger getTtl()
+ {
+ return _header.getTtl();
+ }
+
+ public void setTtl(final UnsignedInteger ttl)
+ {
+ _header.setTtl(ttl);
+ }
+
+ public UnsignedInteger getFormerAcquirers()
+ {
+ return _header.getDeliveryCount();
+ }
+
+ public void setFormerAcquirers(final UnsignedInteger formerAcquirers)
+ {
+ _header.setDeliveryCount(formerAcquirers);
+ }
+
+ public Object getMessageId()
+ {
+ return _properties.getMessageId();
+ }
+
+ public void setMessageId(final Object messageId)
+ {
+ _properties.setMessageId(messageId);
+ }
+
+ public Binary getUserId()
+ {
+ return _properties.getUserId();
+ }
+
+ public void setUserId(final Binary userId)
+ {
+ _properties.setUserId(userId);
+ }
+
+ public String getTo()
+ {
+ return _properties.getTo();
+ }
+
+ public void setTo(final String to)
+ {
+ _properties.setTo(to);
+ }
+
+ public String getSubject()
+ {
+ return _properties.getSubject();
+ }
+
+ public void setSubject(final String subject)
+ {
+ _properties.setSubject(subject);
+ }
+
+ public String getReplyTo()
+ {
+ return _properties.getReplyTo();
+ }
+
+ public void setReplyTo(final String replyTo)
+ {
+ _properties.setReplyTo(replyTo);
+ }
+
+ public Object getCorrelationId()
+ {
+ return _properties.getCorrelationId();
+ }
+
+ public void setCorrelationId(final Binary correlationId)
+ {
+ _properties.setCorrelationId(correlationId);
+ }
+
+ public Symbol getContentType()
+ {
+ return _properties.getContentType();
+ }
+
+ public void setContentType(final Symbol contentType)
+ {
+ _properties.setContentType(contentType);
+ }
+
+ public void acknowledge() throws JMSException
+ {
+ _sessionImpl.acknowledgeAll();
+ }
+
+ public void clearBody() throws JMSException
+ {
+ _readOnly = false;
+ }
+
+ protected boolean isReadOnly()
+ {
+ return _readOnly;
+ }
+
+ protected void checkReadable() throws MessageNotReadableException
+ {
+ if (!isReadOnly())
+ {
+ throw new MessageNotReadableException("You need to call reset() to make the message readable");
+ }
+ }
+
+ protected void checkWritable() throws MessageNotWriteableException
+ {
+ if (isReadOnly())
+ {
+ throw new MessageNotWriteableException("You need to call clearBody() to make the message writable");
+ }
+ }
+
+ public void setReadOnly()
+ {
+ _readOnly = true;
+ }
+
+ private static class InvalidJMSMEssageIdException extends JMSException
+ {
+ public InvalidJMSMEssageIdException(String messageId)
+ {
+ super("Invalid JMSMessageID: '" + messageId + "', JMSMessageID MUST start with 'ID:'");
+ }
+ }
+
+ private class NonAMQPDestinationException extends JMSException
+ {
+ public NonAMQPDestinationException(Destination destination)
+ {
+ super("Destinations not a valid AMQP Destination, class of type: '"
+ + destination.getClass().getName()
+ + "', require '"
+ + org.apache.qpid.amqp_1_0.jms.Destination.class.getName() + "'.");
+ }
+ }
+
+ private class InvalidJMSPriorityException extends JMSException
+ {
+ public InvalidJMSPriorityException(int priority)
+ {
+ super("The provided priority: " + priority + " is not valid in AMQP, valid values are from 0 to 255");
+ }
+ }
+
+ Header getHeader()
+ {
+ return _header;
+ }
+
+ Properties getProperties()
+ {
+ return _properties;
+ }
+
+
+ Footer getFooter()
+ {
+ return _footer;
+ }
+
+ MessageAnnotations getMessageAnnotations()
+ {
+ return _messageAnnotations;
+ }
+
+ public ApplicationProperties getApplicationProperties()
+ {
+ return _applicationProperties;
+ }
+
+ public void reset() throws JMSException
+ {
+ _readOnly = true;
+ }
+
+ void setFromQueue(final boolean fromQueue)
+ {
+ _isFromQueue = fromQueue;
+ }
+
+ void setFromTopic(final boolean fromTopic)
+ {
+ _isFromTopic = fromTopic;
+ }
+
+ abstract Collection<Section> getSections();
+
+ DecodedDestination toDecodedDestination(Destination destination) throws NonAMQPDestinationException
+ {
+ if(destination == null)
+ {
+ return null;
+ }
+ if (destination instanceof DestinationImpl)
+ {
+ return _sessionImpl.getConnection().toDecodedDestination((DestinationImpl) destination);
+ }
+ throw new NonAMQPDestinationException(destination);
+ }
+
+ DestinationImpl toDestination(String address, Set<String> kind)
+ {
+ if( address == null )
+ {
+ return null;
+ }
+
+ // If destination prefixes are in play, we have to strip the the prefix, and we might
+ // be able to infer the kind, if we don't know it yet.
+ DecodedDestination decoded = _sessionImpl.getConnection().toDecodedDestination(address, kind);
+ address = decoded.getAddress();
+ kind = decoded.getAttributes();
+
+ if( kind == null )
+ {
+ return DestinationImpl.valueOf(address);
+ }
+ if( kind.contains(QUEUE_ATTRIBUTE) )
+ {
+ if( kind.contains(TEMPORARY_ATTRIBUTE) )
+ {
+ return new TemporaryQueueImpl(address, null, _sessionImpl);
+ }
+ else
+ {
+ return QueueImpl.valueOf(address);
+ }
+ }
+ else if ( kind.contains(TOPIC_ATTRIBUTE) )
+ {
+ if( kind.contains(TEMPORARY_ATTRIBUTE) )
+ {
+ return new TemporaryTopicImpl(address, null, _sessionImpl);
+ }
+ else
+ {
+ return TopicImpl.valueOf(address);
+ }
+ }
+
+ return DestinationImpl.valueOf(address);
+ }
+
+ private Object getMessageAnnotation(Symbol key)
+ {
+ Map messageAttrs = _messageAnnotations == null ? null : _messageAnnotations.getValue();
+ return messageAttrs == null ? null : messageAttrs.get(key);
+ }
+
+ private Map messageAnnotationMap()
+ {
+ Map messageAttrs = _messageAnnotations == null ? null : _messageAnnotations.getValue();
+ if(messageAttrs == null)
+ {
+ messageAttrs = new HashMap();
+ _messageAnnotations = new MessageAnnotations(messageAttrs);
+ }
+ return messageAttrs;
+ }
+
+ Set<String> splitCommaSeparateSet(String value)
+ {
+ if( value == null )
+ {
+ return null;
+ }
+ HashSet<String> rc = new HashSet<String>();
+ for( String x: value.split("\\s*,\\s*") )
+ {
+ rc.add(x);
+ }
+ return rc;
+ }
+
+ private static Set<String> set(String ...args)
+ {
+ HashSet<String> s = new HashSet<String>();
+ for (String arg : args)
+ {
+ s.add(arg);
+ }
+ return Collections.unmodifiableSet(s);
+ }
+
+ static final String join(String sep, Iterable items)
+ {
+ StringBuilder result = new StringBuilder();
+
+ for (Object o : items)
+ {
+ if (result.length() > 0)
+ {
+ result.append(sep);
+ }
+ result.append(o.toString());
+ }
+
+ return result.toString();
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
index 79c1606edb..b240359002 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
@@ -1,489 +1,521 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.client.ConnectionClosedException;
-import org.apache.qpid.amqp_1_0.client.LinkDetachedException;
-import org.apache.qpid.amqp_1_0.client.Sender;
-import org.apache.qpid.amqp_1_0.jms.MessageProducer;
-import org.apache.qpid.amqp_1_0.jms.MessageRejectedException;
-import org.apache.qpid.amqp_1_0.jms.QueueSender;
-import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
-import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Outcome;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-import java.util.UUID;
-import org.apache.qpid.amqp_1_0.type.messaging.Accepted;
-import org.apache.qpid.amqp_1_0.type.transport.*;
-
-public class MessageProducerImpl implements MessageProducer, QueueSender, TopicPublisher
-{
- private boolean _disableMessageID;
- private boolean _disableMessageTimestamp;
- private int _deliveryMode = Message.DEFAULT_DELIVERY_MODE;
- private int _priority = Message.DEFAULT_PRIORITY;
- private long _timeToLive;
-
- private DestinationImpl _destination;
- private SessionImpl _session;
- private Sender _sender;
- private boolean _closed;
- private boolean _syncPublish = Boolean.getBoolean("qpid.sync_publish");
- private long _syncPublishTimeout = Long.getLong("qpid.sync_publish_timeout", 30000l);
-
- protected MessageProducerImpl(final Destination destination,
- final SessionImpl session) throws JMSException
- {
- if(destination instanceof DestinationImpl)
- {
- _destination = (DestinationImpl) destination;
- }
- else if(destination != null)
- {
- throw new InvalidDestinationException("Invalid Destination Class" + destination.getClass().getName());
- }
-
- _session = session;
-
- if(_destination != null)
- {
- try
- {
- _sender = _session.getClientSession().createSender(_session.toAddress(_destination));
- }
- catch (Sender.SenderCreationException e)
- {
- // TODO - refine exception
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.initCause(e);
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
- catch (ConnectionClosedException e)
- {
-
- // TODO - refine exception
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.initCause(e);
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
- _sender.setRemoteErrorListener(new Runnable()
- {
- @Override
- public void run()
- {
- try
- {
- final ExceptionListener exceptionListener = _session.getConnection().getExceptionListener();
-
- if(exceptionListener != null)
- {
- final org.apache.qpid.amqp_1_0.type.transport.Error receiverError = _sender.getError();
- exceptionListener.onException(new JMSException(receiverError.getDescription(),
- receiverError.getCondition().getValue().toString()));
-
- }
- }
- catch (JMSException e)
- {
-
- }
- }
- });
- }
- }
-
- private void checkClosed() throws IllegalStateException
- {
- if(_closed)
- {
- throw new javax.jms.IllegalStateException("Producer closed");
- }
- }
-
- public boolean getDisableMessageID() throws IllegalStateException
- {
- checkClosed();
- return _disableMessageID;
- }
-
- public void setDisableMessageID(final boolean disableMessageID) throws IllegalStateException
- {
- checkClosed();
- _disableMessageID = disableMessageID;
- }
-
- public boolean getDisableMessageTimestamp() throws IllegalStateException
- {
- checkClosed();
- return _disableMessageTimestamp;
- }
-
- public void setDisableMessageTimestamp(final boolean disableMessageTimestamp) throws IllegalStateException
- {
- checkClosed();
- _disableMessageTimestamp = disableMessageTimestamp;
- }
-
- public int getDeliveryMode() throws IllegalStateException
- {
- checkClosed();
- return _deliveryMode;
- }
-
- public void setDeliveryMode(final int deliveryMode) throws IllegalStateException
- {
- checkClosed();
- _deliveryMode = deliveryMode;
- }
-
- public int getPriority() throws IllegalStateException
- {
- checkClosed();
- return _priority;
- }
-
- public void setPriority(final int priority) throws IllegalStateException
- {
- checkClosed();
- _priority = priority;
- }
-
- public long getTimeToLive() throws IllegalStateException
- {
- checkClosed();
- return _timeToLive;
- }
-
- public void setTimeToLive(final long timeToLive) throws IllegalStateException
- {
- checkClosed();
- _timeToLive = timeToLive;
- }
-
- public DestinationImpl getDestination() throws JMSException
- {
- checkClosed();
- return _destination;
- }
-
- public void close() throws JMSException
- {
- try
- {
- if(!_closed)
- {
- _closed = true;
- if(_sender != null)
- {
- _sender.close();
- }
- }
-
- }
- catch (Sender.SenderClosingException e)
- {
- final JMSException jmsException = new JMSException("error closing");
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- }
-
- public void send(final Message message) throws JMSException
- {
- send(message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(final Message message, final int deliveryMode, final int priority, final long ttl) throws JMSException
- {
- if(_sender == null)
- {
- throw new UnsupportedOperationException("No Destination provided");
- }
- if(_destination instanceof TemporaryDestination && ((TemporaryDestination)_destination).isDeleted())
- {
- throw new IllegalStateException("Destination is deleted");
- }
-
-
- //TODO
- MessageImpl msg;
- if(message instanceof org.apache.qpid.amqp_1_0.jms.Message)
- {
- msg = (MessageImpl) message;
- }
- else
- {
- msg = _session.convertMessage(message);
- }
-
-
-
- msg.setJMSDeliveryMode(deliveryMode);
- msg.setJMSPriority(priority);
-
- msg.setJMSDestination(_destination);
-
- long timestamp = 0l;
-
- if(!getDisableMessageTimestamp() || ttl != 0)
- {
- timestamp = System.currentTimeMillis();
- msg.setJMSTimestamp(timestamp);
-
- }
- if(ttl != 0)
- {
- msg.setTtl(UnsignedInteger.valueOf(ttl));
- }
- else
- {
- msg.setTtl(null);
- }
-
- if(!getDisableMessageID() && msg.getMessageId() == null)
- {
- final Object messageId = generateMessageId();
- msg.setMessageId(messageId);
-
- }
-
- if(message != msg)
- {
- message.setJMSTimestamp(msg.getJMSTimestamp());
- message.setJMSMessageID(msg.getJMSMessageID());
- message.setJMSDeliveryMode(msg.getJMSDeliveryMode());
- message.setJMSPriority(msg.getJMSPriority());
- message.setJMSExpiration(msg.getJMSExpiration());
- }
-
-
- final org.apache.qpid.amqp_1_0.client.Message clientMessage = new org.apache.qpid.amqp_1_0.client.Message(msg.getSections());
-
- DispositionAction action = null;
-
- if(_syncPublish)
- {
- action = new DispositionAction(_sender);
- }
-
- try
- {
- _sender.send(clientMessage, _session.getTxn(), action);
- }
- catch (LinkDetachedException e)
- {
- JMSException jmsException = new InvalidDestinationException("Sender has been closed");
- jmsException.setLinkedException(e);
- throw jmsException;
- }
-
- if(_syncPublish && !action.wasAccepted(_syncPublishTimeout + System.currentTimeMillis()))
- {
- throw new MessageRejectedException("Message was rejected");
- }
-
- if(getDestination() != null)
- {
- message.setJMSDestination(getDestination());
- }
- }
-
- public void send(final javax.jms.Queue queue, final Message message) throws JMSException
- {
- send((Destination)queue, message);
- }
-
- public void send(final javax.jms.Queue queue, final Message message, final int deliveryMode, final int priority, final long ttl)
- throws JMSException
- {
- send((Destination)queue, message, deliveryMode, priority, ttl);
- }
-
- private Object generateMessageId()
- {
- UUID uuid = UUID.randomUUID();
- final String messageIdString = uuid.toString();
- return _session.getConnection().useBinaryMessageId() ? new Binary(messageIdString.getBytes()) : messageIdString;
- }
-
- public void send(final Destination destination, final Message message) throws JMSException
- {
- send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(final Destination destination, final Message message, final int deliveryMode, final int priority, final long ttl)
- throws JMSException
- {
-
- checkClosed();
- if(destination == null)
- {
- send(message, deliveryMode, priority, ttl);
- }
- else
- {
- if(_destination != null)
- {
- throw new UnsupportedOperationException("Cannot use explicit destination pon non-anonymous producer");
- }
- else if(!(destination instanceof DestinationImpl))
- {
- throw new InvalidDestinationException("Invalid Destination Class" + destination.getClass().getName());
- }
- else if(destination instanceof TemporaryDestination && ((TemporaryDestination)destination).isDeleted())
- {
- throw new IllegalStateException("Destination has been deleted");
- }
- try
- {
- _destination = (DestinationImpl) destination;
- _sender = _session.getClientSession().createSender(_session.toAddress(_destination));
-
- send(message, deliveryMode, priority, ttl);
-
- _sender.close();
-
-
-
- }
- catch (Sender.SenderCreationException e)
- {
- // TODO - refine exception
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.initCause(e);
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
- catch (Sender.SenderClosingException e)
- {
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.initCause(e);
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
- catch (ConnectionClosedException e)
- {
-
- JMSException jmsEx = new JMSException(e.getMessage());
- jmsEx.initCause(e);
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
- finally
- {
- _sender = null;
- _destination = null;
- }
- }
- }
-
- public QueueImpl getQueue() throws JMSException
- {
- return (QueueImpl) getDestination();
- }
-
- public TopicImpl getTopic() throws JMSException
- {
- return (TopicImpl) getDestination();
- }
-
- public void publish(final Message message) throws JMSException
- {
- send(message);
- }
-
- public void publish(final Message message, final int deliveryMode, final int priority, final long ttl) throws JMSException
- {
- send(message, deliveryMode, priority, ttl);
- }
-
- public void publish(final Topic topic, final Message message) throws JMSException
- {
- send(topic, message);
- }
-
- public void publish(final Topic topic, final Message message, final int deliveryMode, final int priority, final long ttl)
- throws JMSException
- {
- send(topic, message, deliveryMode, priority, ttl);
- }
-
- private static class DispositionAction implements Sender.OutcomeAction
- {
- private final Sender _sender;
- private final Object _lock;
- private Outcome _outcome;
-
- public DispositionAction(Sender sender)
- {
- _sender = sender;
- _lock = sender.getEndpoint().getLock();
- }
-
- @Override
- public void onOutcome(Binary deliveryTag, Outcome outcome)
- {
- synchronized (_lock)
- {
- _outcome = outcome;
- _lock.notifyAll();
- }
- }
-
- public boolean wasAccepted(long timeout) throws JMSException
- {
- synchronized(_lock)
- {
- while(_outcome == null && !_sender.getEndpoint().isDetached())
- {
- try
- {
- _lock.wait(timeout - System.currentTimeMillis());
- }
- catch (InterruptedException e)
- {
- Thread.currentThread().interrupt();
- }
- }
- if(_outcome == null)
- {
-
- if(_sender.getEndpoint().isDetached())
- {
- throw new JMSException("Link was detached");
- }
- else
- {
- throw new JMSException("Timed out waiting for message acceptance");
- }
- }
- else
- {
- return _outcome instanceof Accepted;
- }
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.client.*;
+import org.apache.qpid.amqp_1_0.client.Session;
+import org.apache.qpid.amqp_1_0.jms.MessageProducer;
+import org.apache.qpid.amqp_1_0.jms.MessageRejectedException;
+import org.apache.qpid.amqp_1_0.jms.QueueSender;
+import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
+import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Outcome;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+
+import javax.jms.*;
+import javax.jms.IllegalStateException;
+import javax.jms.Message;
+import java.util.UUID;
+import org.apache.qpid.amqp_1_0.type.messaging.Accepted;
+import org.apache.qpid.amqp_1_0.type.messaging.Rejected;
+import org.apache.qpid.amqp_1_0.type.messaging.Source;
+import org.apache.qpid.amqp_1_0.type.messaging.codec.AcceptedConstructor;
+import org.apache.qpid.amqp_1_0.type.messaging.codec.RejectedConstructor;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class MessageProducerImpl implements MessageProducer, QueueSender, TopicPublisher
+{
+ private boolean _disableMessageID;
+ private boolean _disableMessageTimestamp;
+ private int _deliveryMode = Message.DEFAULT_DELIVERY_MODE;
+ private int _priority = Message.DEFAULT_PRIORITY;
+ private long _timeToLive;
+
+ private DestinationImpl _destination;
+ private SessionImpl _session;
+ private Sender _sender;
+ private boolean _closed;
+ private boolean _syncPublish = Boolean.getBoolean("qpid.sync_publish");
+ private long _syncPublishTimeout = Long.getLong("qpid.sync_publish_timeout", 30000l);
+
+ protected MessageProducerImpl(final Destination destination,
+ final SessionImpl session) throws JMSException
+ {
+ if(destination instanceof DestinationImpl)
+ {
+ _destination = (DestinationImpl) destination;
+ }
+ else if(destination != null)
+ {
+ throw new InvalidDestinationException("Invalid Destination Class" + destination.getClass().getName());
+ }
+
+ _session = session;
+ _syncPublish = session.getConnection().syncPublish();
+
+ if(_destination != null)
+ {
+ try
+ {
+ _sender = _session.getClientSession().createSender(_session.toAddress(_destination), new Session.SourceConfigurator()
+ {
+ public void configureSource(final Source source)
+ {
+ source.setDefaultOutcome(new Accepted());
+ source.setOutcomes(AcceptedConstructor.SYMBOL_CONSTRUCTOR, RejectedConstructor.SYMBOL_CONSTRUCTOR);
+ }
+ });
+ }
+ catch (Sender.SenderCreationException e)
+ {
+ // TODO - refine exception
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.initCause(e);
+ jmsEx.setLinkedException(e);
+ throw jmsEx;
+ }
+ catch (ConnectionClosedException e)
+ {
+
+ // TODO - refine exception
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.initCause(e);
+ jmsEx.setLinkedException(e);
+ throw jmsEx;
+ }
+ _sender.setRemoteErrorListener(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ final ExceptionListener exceptionListener = _session.getConnection().getExceptionListener();
+
+ if(exceptionListener != null)
+ {
+ final org.apache.qpid.amqp_1_0.type.transport.Error receiverError = _sender.getError();
+ exceptionListener.onException(new JMSException(receiverError.getDescription(),
+ receiverError.getCondition().getValue().toString()));
+
+ }
+ }
+ catch (JMSException e)
+ {
+
+ }
+ }
+ });
+ }
+ }
+
+ private void checkClosed() throws IllegalStateException
+ {
+ if(_closed)
+ {
+ throw new javax.jms.IllegalStateException("Producer closed");
+ }
+ }
+
+ public boolean getDisableMessageID() throws IllegalStateException
+ {
+ checkClosed();
+ return _disableMessageID;
+ }
+
+ public void setDisableMessageID(final boolean disableMessageID) throws IllegalStateException
+ {
+ checkClosed();
+ _disableMessageID = disableMessageID;
+ }
+
+ public boolean getDisableMessageTimestamp() throws IllegalStateException
+ {
+ checkClosed();
+ return _disableMessageTimestamp;
+ }
+
+ public void setDisableMessageTimestamp(final boolean disableMessageTimestamp) throws IllegalStateException
+ {
+ checkClosed();
+ _disableMessageTimestamp = disableMessageTimestamp;
+ }
+
+ public int getDeliveryMode() throws IllegalStateException
+ {
+ checkClosed();
+ return _deliveryMode;
+ }
+
+ public void setDeliveryMode(final int deliveryMode) throws IllegalStateException
+ {
+ checkClosed();
+ _deliveryMode = deliveryMode;
+ }
+
+ public int getPriority() throws IllegalStateException
+ {
+ checkClosed();
+ return _priority;
+ }
+
+ public void setPriority(final int priority) throws IllegalStateException
+ {
+ checkClosed();
+ _priority = priority;
+ }
+
+ public long getTimeToLive() throws IllegalStateException
+ {
+ checkClosed();
+ return _timeToLive;
+ }
+
+ public void setTimeToLive(final long timeToLive) throws IllegalStateException
+ {
+ checkClosed();
+ _timeToLive = timeToLive;
+ }
+
+ public DestinationImpl getDestination() throws JMSException
+ {
+ checkClosed();
+ return _destination;
+ }
+
+ public void close() throws JMSException
+ {
+ try
+ {
+ if(!_closed)
+ {
+ _closed = true;
+ if(_sender != null)
+ {
+ _sender.close();
+ }
+ }
+
+ }
+ catch (Sender.SenderClosingException e)
+ {
+ final JMSException jmsException = new JMSException("error closing");
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ }
+
+ public void send(final Message message) throws JMSException
+ {
+ send(message, getDeliveryMode(), getPriority(), getTimeToLive());
+ }
+
+ public void send(final Message message, final int deliveryMode, final int priority, final long ttl) throws JMSException
+ {
+ if(_sender == null)
+ {
+ throw new UnsupportedOperationException("No Destination provided");
+ }
+ if(_destination instanceof TemporaryDestination && ((TemporaryDestination)_destination).isDeleted())
+ {
+ throw new IllegalStateException("Destination is deleted");
+ }
+
+
+ //TODO
+ MessageImpl msg;
+ if(message instanceof org.apache.qpid.amqp_1_0.jms.Message)
+ {
+ msg = (MessageImpl) message;
+ }
+ else
+ {
+ msg = _session.convertMessage(message);
+ }
+
+
+
+ msg.setJMSDeliveryMode(deliveryMode);
+ msg.setJMSPriority(priority);
+
+ msg.setJMSDestination(_destination);
+
+ long timestamp = 0l;
+
+ if(!getDisableMessageTimestamp() || ttl != 0)
+ {
+ timestamp = System.currentTimeMillis();
+ msg.setJMSTimestamp(timestamp);
+
+ }
+ if(ttl != 0)
+ {
+ msg.setTtl(UnsignedInteger.valueOf(ttl));
+ }
+ else
+ {
+ msg.setTtl(null);
+ }
+
+ if(!getDisableMessageID() && msg.getMessageId() == null)
+ {
+ final Object messageId = generateMessageId();
+ msg.setMessageId(messageId);
+
+ }
+
+ if(message != msg)
+ {
+ message.setJMSTimestamp(msg.getJMSTimestamp());
+ message.setJMSMessageID(msg.getJMSMessageID());
+ message.setJMSDeliveryMode(msg.getJMSDeliveryMode());
+ message.setJMSPriority(msg.getJMSPriority());
+ message.setJMSExpiration(msg.getJMSExpiration());
+ }
+
+
+ final org.apache.qpid.amqp_1_0.client.Message clientMessage = new org.apache.qpid.amqp_1_0.client.Message(msg.getSections());
+
+ DispositionAction action = null;
+
+ if(_syncPublish)
+ {
+ action = new DispositionAction(_sender);
+ }
+
+ try
+ {
+ _sender.send(clientMessage, _session.getTxn(), action);
+ }
+ catch (LinkDetachedException e)
+ {
+ JMSException jmsException = new InvalidDestinationException("Sender has been closed");
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+
+ if(_syncPublish && !action.wasAccepted(_syncPublishTimeout))
+ {
+ if (action.getOutcome() instanceof Rejected)
+ {
+ Error err = ((Rejected) action.getOutcome()).getError();
+ if(err != null)
+ {
+ throw new MessageRejectedException(err.getDescription(), err.getCondition().toString());
+ }
+ else
+ {
+ throw new MessageRejectedException("Message was rejected: " + action.getOutcome());
+ }
+ }
+ else
+ {
+ throw new MessageRejectedException("Message was not accepted. Outcome was: " + action.getOutcome());
+ }
+ }
+
+ if(getDestination() != null)
+ {
+ message.setJMSDestination(getDestination());
+ }
+ }
+
+ public void send(final javax.jms.Queue queue, final Message message) throws JMSException
+ {
+ send((Destination)queue, message);
+ }
+
+ public void send(final javax.jms.Queue queue, final Message message, final int deliveryMode, final int priority, final long ttl)
+ throws JMSException
+ {
+ send((Destination)queue, message, deliveryMode, priority, ttl);
+ }
+
+ private Object generateMessageId()
+ {
+ UUID uuid = UUID.randomUUID();
+ final String messageIdString = uuid.toString();
+ return _session.getConnection().useBinaryMessageId() ? new Binary(messageIdString.getBytes()) : messageIdString;
+ }
+
+ public void send(final Destination destination, final Message message) throws JMSException
+ {
+ send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
+ }
+
+ public void send(final Destination destination, final Message message, final int deliveryMode, final int priority, final long ttl)
+ throws JMSException
+ {
+
+ checkClosed();
+ if(destination == null)
+ {
+ send(message, deliveryMode, priority, ttl);
+ }
+ else
+ {
+ if(_destination != null)
+ {
+ throw new UnsupportedOperationException("Cannot use explicit destination pon non-anonymous producer");
+ }
+ else if(!(destination instanceof DestinationImpl))
+ {
+ throw new InvalidDestinationException("Invalid Destination Class" + destination.getClass().getName());
+ }
+ else if(destination instanceof TemporaryDestination && ((TemporaryDestination)destination).isDeleted())
+ {
+ throw new IllegalStateException("Destination has been deleted");
+ }
+ try
+ {
+ _destination = (DestinationImpl) destination;
+ _sender = _session.getClientSession().createSender(_session.toAddress(_destination));
+
+ send(message, deliveryMode, priority, ttl);
+
+ _sender.close();
+
+
+
+ }
+ catch (Sender.SenderCreationException e)
+ {
+ // TODO - refine exception
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.initCause(e);
+ jmsEx.setLinkedException(e);
+ throw jmsEx;
+ }
+ catch (Sender.SenderClosingException e)
+ {
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.initCause(e);
+ jmsEx.setLinkedException(e);
+ throw jmsEx;
+ }
+ catch (ConnectionClosedException e)
+ {
+
+ JMSException jmsEx = new JMSException(e.getMessage());
+ jmsEx.initCause(e);
+ jmsEx.setLinkedException(e);
+ throw jmsEx;
+ }
+ finally
+ {
+ _sender = null;
+ _destination = null;
+ }
+ }
+ }
+
+ public QueueImpl getQueue() throws JMSException
+ {
+ return (QueueImpl) getDestination();
+ }
+
+ public TopicImpl getTopic() throws JMSException
+ {
+ return (TopicImpl) getDestination();
+ }
+
+ public void publish(final Message message) throws JMSException
+ {
+ send(message);
+ }
+
+ public void publish(final Message message, final int deliveryMode, final int priority, final long ttl) throws JMSException
+ {
+ send(message, deliveryMode, priority, ttl);
+ }
+
+ public void publish(final Topic topic, final Message message) throws JMSException
+ {
+ send(topic, message);
+ }
+
+ public void publish(final Topic topic, final Message message, final int deliveryMode, final int priority, final long ttl)
+ throws JMSException
+ {
+ send(topic, message, deliveryMode, priority, ttl);
+ }
+
+ private static class DispositionAction implements Sender.OutcomeAction
+ {
+ private final Sender _sender;
+ private final Object _lock;
+ private Outcome _outcome;
+
+ public DispositionAction(Sender sender)
+ {
+ _sender = sender;
+ _lock = sender.getEndpoint().getLock();
+ }
+
+ @Override
+ public void onOutcome(Binary deliveryTag, Outcome outcome)
+ {
+ synchronized (_lock)
+ {
+ _outcome = outcome;
+ _lock.notifyAll();
+ }
+ }
+
+ public boolean wasAccepted(long timeout) throws JMSException
+ {
+ synchronized(_lock)
+ {
+ while(_outcome == null && !_sender.getEndpoint().isDetached())
+ {
+ try
+ {
+ _lock.wait(timeout);
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ if(_outcome == null)
+ {
+
+ if(_sender.getEndpoint().isDetached())
+ {
+ throw new JMSException("Link was detached");
+ }
+ else
+ {
+ throw new JMSException("Timed out waiting for message acceptance");
+ }
+ }
+ else
+ {
+ return _outcome instanceof Accepted;
+ }
+ }
+ }
+
+ Outcome getOutcome()
+ {
+ return _outcome;
+ }
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ObjectMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ObjectMessageImpl.java
index 95c1497d07..5e180beb9e 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ObjectMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ObjectMessageImpl.java
@@ -1,161 +1,161 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.ObjectMessage;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageNotWriteableException;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.*;
-
-public class ObjectMessageImpl extends MessageImpl implements ObjectMessage
-{
- static final Symbol CONTENT_TYPE = Symbol.valueOf("application/x-java-serialized-object");
-
- static final Data NULL_OBJECT_DATA;
- static
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try
- {
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(null);
- oos.flush();
- oos.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- NULL_OBJECT_DATA = new Data(new Binary(baos.toByteArray()));
- }
-
- private Data _objectData = NULL_OBJECT_DATA;
-
- protected ObjectMessageImpl(Header header,
- MessageAnnotations messageAnnotations,
- Properties properties,
- ApplicationProperties appProperties,
- Data dataSection,
- Footer footer,
- SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- getProperties().setContentType(CONTENT_TYPE);
- Serializable serializable = null;
- _objectData = dataSection;
-
- }
-
- protected ObjectMessageImpl(final SessionImpl session)
- {
- super(new Header(), new MessageAnnotations(new HashMap()),
- new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
- session);
- getProperties().setContentType(CONTENT_TYPE);
- }
-
- public void setObject(final Serializable serializable) throws MessageNotWriteableException
- {
- checkWritable();
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try
- {
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(serializable);
- oos.flush();
- oos.close();
-
- _objectData = new Data(new Binary(baos.toByteArray()));
-
- }
- catch (IOException e)
- {
- e.printStackTrace(); //TODO
- }
- }
-
- public Serializable getObject() throws JMSException
- {
-
- if(_objectData == null)
- {
- return null;
- }
-
- Binary data = _objectData.getValue();
-
- try
- {
- ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data.getArray(), data.getArrayOffset(), data.getLength()));
- return (Serializable) ois.readObject();
- }
- catch (IOException e)
- {
- JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- catch (ClassNotFoundException e)
- {
-
- JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
-
- }
-
- @Override
- public void clearBody() throws JMSException
- {
- super.clearBody();
- _objectData = null;
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
-
- sections.add(_objectData);
-
- sections.add(getFooter());
- return sections;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.ObjectMessage;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageNotWriteableException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.*;
+
+public class ObjectMessageImpl extends MessageImpl implements ObjectMessage
+{
+ static final Symbol CONTENT_TYPE = Symbol.valueOf("application/x-java-serialized-object");
+
+ static final Data NULL_OBJECT_DATA;
+ static
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try
+ {
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(null);
+ oos.flush();
+ oos.close();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ NULL_OBJECT_DATA = new Data(new Binary(baos.toByteArray()));
+ }
+
+ private Data _objectData = NULL_OBJECT_DATA;
+
+ protected ObjectMessageImpl(Header header,
+ MessageAnnotations messageAnnotations,
+ Properties properties,
+ ApplicationProperties appProperties,
+ Data dataSection,
+ Footer footer,
+ SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ getProperties().setContentType(CONTENT_TYPE);
+ Serializable serializable = null;
+ _objectData = dataSection;
+
+ }
+
+ protected ObjectMessageImpl(final SessionImpl session)
+ {
+ super(new Header(), new MessageAnnotations(new HashMap()),
+ new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
+ session);
+ getProperties().setContentType(CONTENT_TYPE);
+ }
+
+ public void setObject(final Serializable serializable) throws MessageNotWriteableException
+ {
+ checkWritable();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try
+ {
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(serializable);
+ oos.flush();
+ oos.close();
+
+ _objectData = new Data(new Binary(baos.toByteArray()));
+
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace(); //TODO
+ }
+ }
+
+ public Serializable getObject() throws JMSException
+ {
+
+ if(_objectData == null)
+ {
+ return null;
+ }
+
+ Binary data = _objectData.getValue();
+
+ try
+ {
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data.getArray(), data.getArrayOffset(), data.getLength()));
+ return (Serializable) ois.readObject();
+ }
+ catch (IOException e)
+ {
+ JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ catch (ClassNotFoundException e)
+ {
+
+ JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+
+ }
+
+ @Override
+ public void clearBody() throws JMSException
+ {
+ super.clearBody();
+ _objectData = null;
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+
+ sections.add(_objectData);
+
+ sections.add(getFooter());
+ return sections;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueBrowserImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueBrowserImpl.java
index ec117400b5..29de87875c 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueBrowserImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueBrowserImpl.java
@@ -1,202 +1,215 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.Message;
-import org.apache.qpid.amqp_1_0.client.Receiver;
-import org.apache.qpid.amqp_1_0.jms.QueueBrowser;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.messaging.Filter;
-import org.apache.qpid.amqp_1_0.type.messaging.JMSSelectorFilter;
-import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
-import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
-
-public class QueueBrowserImpl implements QueueBrowser
-{
- private static final String JMS_SELECTOR = "jms-selector";
- private QueueImpl _queue;
- private String _selector;
- private final SessionImpl _session;
- private Map<Symbol, Filter> _filters;
- private HashSet<MessageEnumeration> _enumerations = new HashSet<MessageEnumeration>();
- private boolean _closed;
-
- QueueBrowserImpl(final QueueImpl queue, final String selector, SessionImpl session) throws JMSException
- {
- _queue = queue;
- _selector = selector;
- _session = session;
-
-
- if(selector == null || selector.trim().equals(""))
- {
- _filters = null;
- }
- else
- {
- _filters = Collections.singletonMap(Symbol.valueOf(JMS_SELECTOR),(Filter) new JMSSelectorFilter(_selector));
- // We do this just to have the server validate the filter..
- new MessageEnumeration().close();
- }
- }
-
- public QueueImpl getQueue()
- {
- return _queue;
- }
-
- public String getMessageSelector()
- {
- return _selector;
- }
-
- public Enumeration getEnumeration() throws JMSException
- {
- if(_closed)
- {
- throw new IllegalStateException("Browser has been closed");
- }
- return new MessageEnumeration();
- }
-
- public void close() throws JMSException
- {
- _closed = true;
- for(MessageEnumeration me : new ArrayList<MessageEnumeration>(_enumerations))
- {
- me.close();
- }
- }
-
- private final class MessageEnumeration implements Enumeration<MessageImpl>
- {
- private Receiver _receiver;
- private MessageImpl _nextElement;
- private boolean _needNext = true;
-
- MessageEnumeration() throws JMSException
- {
- try
- {
- _receiver = _session.getClientSession().createReceiver(_session.toAddress(_queue),
- StdDistMode.COPY,
- AcknowledgeMode.AMO, null,
- false,
- _filters, null);
- _receiver.setCredit(UnsignedInteger.valueOf(100), true);
- }
- catch(ConnectionErrorException e)
- {
- org.apache.qpid.amqp_1_0.type.transport.Error error = e.getRemoteError();
- if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
- {
- throw new InvalidSelectorException(e.getMessage());
- }
- else
- {
- throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
- }
-
- }
- _enumerations.add(this);
-
- }
-
- public void close()
- {
- _enumerations.remove(this);
- _receiver.close();
- _receiver = null;
- }
-
- @Override
- public boolean hasMoreElements()
- {
- if( _receiver == null )
- {
- return false;
- }
- if( _needNext )
- {
- _needNext = false;
- _nextElement = createJMSMessage(_receiver.receive(0L));
- if( _nextElement == null )
- {
- // Drain to verify there really are no more messages.
- _receiver.drain();
- _receiver.drainWait();
- _nextElement = createJMSMessage(_receiver.receive(0L));
- if( _nextElement == null )
- {
- close();
- }
- else
- {
- // there are still more messages, open up the credit window again..
- _receiver.clearDrain();
- }
- }
- }
- return _nextElement != null;
- }
-
- @Override
- public MessageImpl nextElement()
- {
- if( hasMoreElements() )
- {
- MessageImpl message = _nextElement;
- _nextElement = null;
- _needNext = true;
- return message;
- }
- else
- {
- throw new NoSuchElementException();
- }
- }
- }
-
- MessageImpl createJMSMessage(final Message msg)
- {
- if(msg != null)
- {
- final MessageImpl message = _session.getMessageFactory().createMessage(_queue, msg);
- message.setFromQueue(true);
- message.setFromTopic(false);
- return message;
- }
- else
- {
- return null;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import javax.jms.InvalidSelectorException;
+import javax.jms.JMSException;
+import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.Message;
+import org.apache.qpid.amqp_1_0.client.Receiver;
+import org.apache.qpid.amqp_1_0.jms.QueueBrowser;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.messaging.Filter;
+import org.apache.qpid.amqp_1_0.type.messaging.JMSSelectorFilter;
+import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
+import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
+
+public class QueueBrowserImpl implements QueueBrowser
+{
+ private static final String JMS_SELECTOR = "jms-selector";
+ private QueueImpl _queue;
+ private String _selector;
+ private final SessionImpl _session;
+ private Map<Symbol, Filter> _filters;
+ private HashSet<MessageEnumeration> _enumerations = new HashSet<MessageEnumeration>();
+ private boolean _closed;
+
+ QueueBrowserImpl(final QueueImpl queue, final String selector, SessionImpl session) throws JMSException
+ {
+ _queue = queue;
+ _selector = selector;
+ _session = session;
+
+
+ if(selector == null || selector.trim().equals(""))
+ {
+ _filters = null;
+ }
+ else
+ {
+ _filters = Collections.singletonMap(Symbol.valueOf(JMS_SELECTOR),(Filter) new JMSSelectorFilter(_selector));
+ // We do this just to have the server validate the filter..
+ new MessageEnumeration().close();
+ }
+ }
+
+ public QueueImpl getQueue()
+ {
+ return _queue;
+ }
+
+ public String getMessageSelector()
+ {
+ return _selector;
+ }
+
+ public Enumeration getEnumeration() throws JMSException
+ {
+ if(_closed)
+ {
+ throw new IllegalStateException("Browser has been closed");
+ }
+ return new MessageEnumeration();
+ }
+
+ public void close() throws JMSException
+ {
+ _closed = true;
+ for(MessageEnumeration me : new ArrayList<MessageEnumeration>(_enumerations))
+ {
+ me.close();
+ }
+ }
+
+ private final class MessageEnumeration implements Enumeration<MessageImpl>
+ {
+ private Receiver _receiver;
+ private MessageImpl _nextElement;
+ private boolean _needNext = true;
+
+ MessageEnumeration() throws JMSException
+ {
+ try
+ {
+ _receiver = _session.getClientSession().createReceiver(_session.toAddress(_queue),
+ StdDistMode.COPY,
+ AcknowledgeMode.AMO, null,
+ false,
+ _filters, null);
+ _receiver.setCredit(UnsignedInteger.valueOf(100), true);
+ }
+ catch(ConnectionErrorException e)
+ {
+ org.apache.qpid.amqp_1_0.type.transport.Error error = e.getRemoteError();
+ if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
+ {
+ throw new InvalidSelectorException(e.getMessage());
+ }
+ else
+ {
+ throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
+ }
+
+ }
+ _enumerations.add(this);
+
+ }
+
+ public void close()
+ {
+ _enumerations.remove(this);
+ _receiver.close();
+ _receiver = null;
+ }
+
+ @Override
+ public boolean hasMoreElements()
+ {
+ if( _receiver == null )
+ {
+ return false;
+ }
+ if( _needNext )
+ {
+ _needNext = false;
+ Message msg = _receiver.receive(0L);
+ if(msg != null)
+ {
+ _receiver.acknowledge(msg);
+ }
+ _nextElement = createJMSMessage(msg);
+ if( _nextElement == null )
+ {
+ _receiver.setCredit(UnsignedInteger.valueOf(100), true);
+ // Drain to verify there really are no more messages.
+ _receiver.drain();
+ _receiver.drainWait();
+ msg = _receiver.receive(0L);
+
+ if(msg != null)
+ {
+ _receiver.acknowledge(msg);
+ }
+ _nextElement = createJMSMessage(msg);
+
+ if( _nextElement == null )
+ {
+ close();
+ }
+ else
+ {
+ // there are still more messages, open up the credit window again..
+ _receiver.clearDrain();
+ }
+ }
+ }
+ return _nextElement != null;
+ }
+
+ @Override
+ public MessageImpl nextElement()
+ {
+ if( hasMoreElements() )
+ {
+ MessageImpl message = _nextElement;
+ _nextElement = null;
+ _needNext = true;
+ return message;
+ }
+ else
+ {
+ throw new NoSuchElementException();
+ }
+ }
+ }
+
+ MessageImpl createJMSMessage(final Message msg)
+ {
+ if(msg != null)
+ {
+ final MessageImpl message = _session.getMessageFactory().createMessage(_queue, msg);
+ message.setFromQueue(true);
+ message.setFromTopic(false);
+ return message;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueConnectionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueConnectionImpl.java
index 657efd80a3..3741702505 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueConnectionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueConnectionImpl.java
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.QueueConnection;
-
-import javax.jms.ConnectionConsumer;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.ServerSessionPool;
-
-public class QueueConnectionImpl extends ConnectionImpl implements QueueConnection
-{
- QueueConnectionImpl(String host, int port, String username, String password, String clientId)
- throws JMSException
- {
- super(host, port, username, password, clientId);
- }
-
- public QueueSessionImpl createQueueSession(final boolean b, final int i) throws JMSException
- {
- return null; //TODO
- }
-
- public ConnectionConsumer createConnectionConsumer(final Queue queue,
- final String s,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- return null; //TODO
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.QueueConnection;
+
+import javax.jms.ConnectionConsumer;
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.ServerSessionPool;
+
+public class QueueConnectionImpl extends ConnectionImpl implements QueueConnection
+{
+ QueueConnectionImpl(String host, int port, String username, String password, String clientId)
+ throws JMSException
+ {
+ super(host, port, username, password, clientId);
+ }
+
+ public QueueSessionImpl createQueueSession(final boolean b, final int i) throws JMSException
+ {
+ return null; //TODO
+ }
+
+ public ConnectionConsumer createConnectionConsumer(final Queue queue,
+ final String s,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ return null; //TODO
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueImpl.java
index c88bd8268c..cb56843a72 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueImpl.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.Queue;
-
-import java.util.WeakHashMap;
-
-public class QueueImpl extends DestinationImpl implements Queue
-{
- private static final WeakHashMap<String, QueueImpl> QUEUE_CACHE =
- new WeakHashMap<String, QueueImpl>();
-
- public QueueImpl(String address)
- {
- super(address);
- }
-
- public String getQueueName()
- {
- return getAddress();
- }
-
- public static synchronized QueueImpl createQueue(final String address)
- {
- QueueImpl queue = QUEUE_CACHE.get(address);
- if(queue == null)
- {
- queue = new QueueImpl(address);
- QUEUE_CACHE.put(address, queue);
- }
- return queue;
- }
-
- public static QueueImpl valueOf(String address)
- {
- return address == null ? null : createQueue(address);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.Queue;
+
+import java.util.WeakHashMap;
+
+public class QueueImpl extends DestinationImpl implements Queue
+{
+ private static final WeakHashMap<String, QueueImpl> QUEUE_CACHE =
+ new WeakHashMap<String, QueueImpl>();
+
+ public QueueImpl(String address)
+ {
+ super(address);
+ }
+
+ public String getQueueName()
+ {
+ return getAddress();
+ }
+
+ public static synchronized QueueImpl createQueue(final String address)
+ {
+ QueueImpl queue = QUEUE_CACHE.get(address);
+ if(queue == null)
+ {
+ queue = new QueueImpl(address);
+ QUEUE_CACHE.put(address, queue);
+ }
+ return queue;
+ }
+
+ public static QueueImpl valueOf(String address)
+ {
+ return address == null ? null : createQueue(address);
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueReceiverImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueReceiverImpl.java
index 52bf61b4c9..4e9e9d6a39 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueReceiverImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueReceiverImpl.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import javax.jms.JMSException;
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.Receiver;
-import org.apache.qpid.amqp_1_0.jms.Queue;
-import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
-
-public class QueueReceiverImpl extends MessageConsumerImpl implements QueueReceiver
-{
- QueueReceiverImpl(final QueueImpl destination,
- final SessionImpl session,
- final String selector,
- final boolean noLocal)
- throws JMSException
- {
- super(destination, session, selector, noLocal);
- setQueueConsumer(true);
- }
-
- protected Receiver createClientReceiver() throws JMSException
- {
- try
- {
- return getSession().getClientSession().createMovingReceiver(getSession().toAddress(getDestination()));
- }
- catch (ConnectionErrorException e)
- {
- throw new JMSException(e.getMessage(), e.getRemoteError().getCondition().toString());
- }
- }
-
- public Queue getQueue() throws JMSException
- {
- return (QueueImpl) getDestination();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import javax.jms.JMSException;
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.Receiver;
+import org.apache.qpid.amqp_1_0.jms.Queue;
+import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
+
+public class QueueReceiverImpl extends MessageConsumerImpl implements QueueReceiver
+{
+ QueueReceiverImpl(final QueueImpl destination,
+ final SessionImpl session,
+ final String selector,
+ final boolean noLocal)
+ throws JMSException
+ {
+ super(destination, session, selector, noLocal);
+ setQueueConsumer(true);
+ }
+
+ protected Receiver createClientReceiver() throws JMSException
+ {
+ try
+ {
+ return getSession().getClientSession().createMovingReceiver(getSession().toAddress(getDestination()));
+ }
+ catch (ConnectionErrorException e)
+ {
+ throw new JMSException(e.getMessage(), e.getRemoteError().getCondition().toString());
+ }
+ }
+
+ public Queue getQueue() throws JMSException
+ {
+ return (QueueImpl) getDestination();
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java
index b3db43801a..690febc100 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.QueueSender;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-public class QueueSenderImpl extends MessageProducerImpl implements QueueSender
-{
- protected QueueSenderImpl(final Destination destination, final SessionImpl session)
- throws JMSException
- {
- super(destination, session);
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.QueueSender;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+
+public class QueueSenderImpl extends MessageProducerImpl implements QueueSender
+{
+ protected QueueSenderImpl(final Destination destination, final SessionImpl session)
+ throws JMSException
+ {
+ super(destination, session);
+ }
+
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSessionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSessionImpl.java
index 7a60658041..0d89e9b495 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSessionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSessionImpl.java
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.QueueSession;
-
-import javax.jms.JMSException;
-import javax.jms.Queue;
-
-public class QueueSessionImpl extends SessionImpl implements QueueSession
-{
- protected QueueSessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode)
- throws JMSException
- {
- super(connection, acknowledgeMode);
- setQueueSession(true);
- }
-
- public QueueReceiverImpl createReceiver(final Queue queue) throws JMSException
- {
- return createReceiver(queue, null);
- }
-
- public QueueReceiverImpl createReceiver(final Queue queue, final String selector) throws JMSException
- {
- // TODO - assert queue is a queueimpl and throw relevant JMS Exception
- final QueueReceiverImpl messageConsumer;
- synchronized(getClientSession().getEndpoint().getLock())
- {
- messageConsumer = new QueueReceiverImpl((QueueImpl)queue, this, selector, false);
- addConsumer(messageConsumer);
- }
- return messageConsumer;
-
- }
-
- public QueueSenderImpl createSender(final Queue queue) throws JMSException
- {
- return null; //TODO
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.QueueSession;
+
+import javax.jms.JMSException;
+import javax.jms.Queue;
+
+public class QueueSessionImpl extends SessionImpl implements QueueSession
+{
+ protected QueueSessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode)
+ throws JMSException
+ {
+ super(connection, acknowledgeMode);
+ setQueueSession(true);
+ }
+
+ public QueueReceiverImpl createReceiver(final Queue queue) throws JMSException
+ {
+ return createReceiver(queue, null);
+ }
+
+ public QueueReceiverImpl createReceiver(final Queue queue, final String selector) throws JMSException
+ {
+ // TODO - assert queue is a queueimpl and throw relevant JMS Exception
+ final QueueReceiverImpl messageConsumer;
+ synchronized(getClientSession().getEndpoint().getLock())
+ {
+ messageConsumer = new QueueReceiverImpl((QueueImpl)queue, this, selector, false);
+ addConsumer(messageConsumer);
+ }
+ return messageConsumer;
+
+ }
+
+ public QueueSenderImpl createSender(final Queue queue) throws JMSException
+ {
+ return null; //TODO
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/SessionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/SessionImpl.java
index 2ae67913fe..7de2671357 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/SessionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/SessionImpl.java
@@ -1,990 +1,994 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageListener;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import org.apache.qpid.amqp_1_0.client.Connection;
-import org.apache.qpid.amqp_1_0.client.ConnectionClosedException;
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.ConnectionException;
-import org.apache.qpid.amqp_1_0.client.Message;
-import org.apache.qpid.amqp_1_0.client.Receiver;
-import org.apache.qpid.amqp_1_0.client.Sender;
-import org.apache.qpid.amqp_1_0.client.Transaction;
-import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
-import org.apache.qpid.amqp_1_0.jms.QueueSender;
-import org.apache.qpid.amqp_1_0.jms.QueueSession;
-import org.apache.qpid.amqp_1_0.jms.Session;
-import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
-import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
-import org.apache.qpid.amqp_1_0.jms.TopicSession;
-import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
-import org.apache.qpid.amqp_1_0.transport.SessionEventListener;
-import org.apache.qpid.amqp_1_0.type.messaging.Source;
-import org.apache.qpid.amqp_1_0.type.messaging.Target;
-import org.apache.qpid.amqp_1_0.type.transport.*;
-import org.apache.qpid.amqp_1_0.type.transport.Error;
-
-public class SessionImpl implements Session, QueueSession, TopicSession
-{
- private ConnectionImpl _connection;
- private AcknowledgeMode _acknowledgeMode;
- private org.apache.qpid.amqp_1_0.client.Session _session;
- private MessageFactory _messageFactory;
- private List<MessageConsumerImpl> _consumers = new ArrayList<MessageConsumerImpl>();
- private List<MessageProducerImpl> _producers = new ArrayList<MessageProducerImpl>();
-
- private MessageListener _messageListener;
- private Dispatcher _dispatcher = new Dispatcher();
- private Thread _dispatcherThread;
-
- private boolean _closed;
-
- private boolean _isQueueSession;
- private boolean _isTopicSession;
- private Transaction _txn;
-
- protected SessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode) throws JMSException
- {
- _connection = connection;
- _acknowledgeMode = acknowledgeMode;
- Connection clientConn = _connection.getClientConnection();
- try
- {
- _session = clientConn.createSession();
- }
- catch (ConnectionException e)
- {
- final JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- _session.getEndpoint().setSessionEventListener(new SessionEventListener.DefaultSessionEventListener()
- {
- @Override
- public void remoteEnd(End end)
- {
- if(!_closed)
- {
- try
- {
- close();
- }
- catch (JMSException e)
- {
- }
- try
- {
- final Error error = end.getError();
- final ExceptionListener exceptionListener = _connection.getExceptionListener();
- if(exceptionListener != null)
- {
- if(error != null)
- {
- exceptionListener.onException(new JMSException(error.getDescription(),
- error.getCondition().getValue().toString()));
- }
- else
- {
- exceptionListener.onException(new JMSException("Session remotely closed"));
- }
- }
- }
- catch (JMSException e)
- {
-
- }
-
- }
- }
- });
- if(_acknowledgeMode == AcknowledgeMode.SESSION_TRANSACTED)
- {
- _txn = _session.createSessionLocalTransaction();
- }
-
- _messageFactory = new MessageFactory(this);
-
- _dispatcherThread = new Thread(_dispatcher);
- _dispatcherThread.start();
- }
-
- public BytesMessageImpl createBytesMessage() throws IllegalStateException
- {
- checkClosed();
- return new BytesMessageImpl(this);
-
- }
-
- public MapMessageImpl createMapMessage() throws JMSException
- {
- checkClosed();
- return new MapMessageImpl(this);
- }
-
- public MessageImpl createMessage() throws IllegalStateException
- {
- return createAmqpMessage();
- }
-
- public ObjectMessageImpl createObjectMessage() throws JMSException
- {
- checkClosed();
- return new ObjectMessageImpl(this);
- }
-
- public ObjectMessageImpl createObjectMessage(final Serializable serializable) throws JMSException
- {
- checkClosed();
- ObjectMessageImpl msg = new ObjectMessageImpl(this);
- msg.setObject(serializable);
- return msg;
- }
-
- public StreamMessageImpl createStreamMessage() throws JMSException
- {
- checkClosed();
- return new StreamMessageImpl(this);
- }
-
- public TextMessageImpl createTextMessage() throws JMSException
- {
- return createTextMessage("");
- }
-
- public TextMessageImpl createTextMessage(final String s) throws JMSException
- {
- checkClosed();
- TextMessageImpl msg = new TextMessageImpl(this);
- msg.setText(s);
- return msg;
- }
-
- public AmqpMessageImpl createAmqpMessage() throws IllegalStateException
- {
- checkClosed();
- return new AmqpMessageImpl(this);
- }
-
- public boolean getTransacted() throws JMSException
- {
- checkClosed();
- return _acknowledgeMode == AcknowledgeMode.SESSION_TRANSACTED;
- }
-
- public int getAcknowledgeMode() throws IllegalStateException
- {
- checkClosed();
- return _acknowledgeMode.ordinal();
- }
-
- AcknowledgeMode getAckModeEnum()
- {
- return _acknowledgeMode;
- }
-
- public void commit() throws JMSException
- {
- checkClosed();
- checkTransactional();
-
- _txn.commit();
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.postCommit();
- }
-
- _txn = _session.createSessionLocalTransaction();
- //TODO
- }
-
- public void rollback() throws JMSException
- {
- checkClosed();
- checkTransactional();
-
- _txn.rollback();
-
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.postRollback();
- }
-
- _txn = _session.createSessionLocalTransaction();
-
- //TODO
- }
-
- private void checkTransactional() throws JMSException
- {
- if(!getTransacted())
- {
- throw new IllegalStateException("Session must be transacted in order to perform this operation");
- }
- }
-
- public void close() throws JMSException
- {
- if(!_closed)
- {
- _closed = true;
- _dispatcher.close();
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.close();
- }
- for(MessageProducerImpl producer : _producers)
- {
- producer.close();
- }
- _session.close();
- _connection.removeSession(this);
- }
- }
-
- private void checkClosed() throws IllegalStateException
- {
- if(_closed)
- {
- throw new IllegalStateException("Closed");
- }
- }
-
- public void recover() throws JMSException
- {
- checkClosed();
- checkNotTransactional();
-
- if(_acknowledgeMode == AcknowledgeMode.CLIENT_ACKNOWLEDGE)
- {
- synchronized(_session.getEndpoint().getLock())
- {
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.doRecover();
- }
- }
- }
- else
- {
- if(Thread.currentThread() == _dispatcherThread)
- {
- _dispatcher.doRecover();
- }
- }
-
- }
-
- private void checkNotTransactional() throws JMSException
- {
-
- if(getTransacted())
- {
- throw new IllegalStateException("This operation cannot be carried out on a transacted session");
- }
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- return _messageListener;
- }
-
- public void setMessageListener(final MessageListener messageListener) throws JMSException
- {
- if(_messageListener != null)
- {
- // TODO
- }
- else
- {
- _messageListener = messageListener;
- }
- }
-
- public void run()
- {
- //TODO
- }
-
- public MessageProducerImpl createProducer(final Destination destination) throws JMSException
- {
- checkClosed();
-
- final MessageProducerImpl messageProducer = new MessageProducerImpl(destination, this);
-
- _producers.add(messageProducer);
-
- return messageProducer;
- }
-
- public MessageConsumerImpl createConsumer(final Destination destination) throws JMSException
- {
- checkClosed();
- return createConsumer(destination, null, false);
- }
-
- public MessageConsumerImpl createConsumer(final Destination destination, final String selector) throws JMSException
- {
- checkClosed();
- return createConsumer(destination, selector, false);
- }
-
- public MessageConsumerImpl createConsumer(final Destination destination, final String selector, final boolean noLocal)
- throws JMSException
- {
- checkClosed();
- checkValidDestination(destination);
- if(destination instanceof TemporaryDestination)
- {
- TemporaryDestination temporaryDestination = (TemporaryDestination) destination;
- if(temporaryDestination.getSession() != this)
- {
- throw new JMSException("Cannot consume from a temporary destination created on another session");
- }
- if(temporaryDestination.isDeleted())
- {
- throw new IllegalStateException("Destination is deleted");
- }
- }
- final MessageConsumerImpl messageConsumer;
- synchronized(_session.getEndpoint().getLock())
- {
- messageConsumer = new MessageConsumerImpl(destination, this, selector, noLocal);
- addConsumer(messageConsumer);
- if(_connection.isStarted())
- {
- messageConsumer.start();
- }
- }
- return messageConsumer;
- }
-
- private void checkValidDestination(Destination destination) throws InvalidDestinationException
- {
- if (destination == null || !(destination instanceof DestinationImpl))
- {
- throw new InvalidDestinationException("Invalid Destination");
- }
- }
-
-
- protected void addConsumer(final MessageConsumerImpl messageConsumer)
- {
- _consumers.add(messageConsumer);
- }
-
- public QueueImpl createQueue(final String s) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- return new QueueImpl(s);
- }
-
- public QueueReceiver createReceiver(final Queue queue) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- return createConsumer(queue);
- }
-
- public QueueReceiver createReceiver(final Queue queue, final String selector) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- return createConsumer(queue, selector);
- }
-
- public QueueSender createSender(final Queue queue) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- return createProducer(queue);
- }
-
- public TopicImpl createTopic(final String s) throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- return new TopicImpl(s);
- }
-
- public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- return createConsumer(topic);
- }
-
- public TopicSubscriber createSubscriber(final Topic topic, final String selector, final boolean noLocal) throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- return createConsumer(topic, selector, noLocal);
- }
-
- public TopicSubscriberImpl createDurableSubscriber(final Topic topic, final String name) throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- return createDurableSubscriber(topic, name, null, false);
- }
-
- private void checkNotQueueSession() throws IllegalStateException
- {
- if(_isQueueSession)
- {
- throw new IllegalStateException("Cannot perform this operation on a QueueSession");
- }
- }
-
-
- private void checkNotTopicSession() throws IllegalStateException
- {
- if(_isTopicSession)
- {
- throw new IllegalStateException("Cannot perform this operation on a TopicSession");
- }
- }
-
- public TopicSubscriberImpl createDurableSubscriber(final Topic topic, final String name, final String selector, final boolean noLocal)
- throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- if(!(topic instanceof TopicImpl))
- {
- throw new InvalidDestinationException("invalid destination " + topic);
- }
- final TopicSubscriberImpl messageConsumer;
- synchronized(_session.getEndpoint().getLock())
- {
- messageConsumer = new TopicSubscriberImpl(name, true, (org.apache.qpid.amqp_1_0.jms.Topic) topic, this,
- selector,
- noLocal);
- addConsumer(messageConsumer);
- if(_connection.isStarted())
- {
- messageConsumer.start();
- }
- }
- return messageConsumer;
- }
-
- public TopicPublisher createPublisher(final Topic topic) throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- return createProducer(topic);
- }
-
- public QueueBrowserImpl createBrowser(final Queue queue) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- checkValidDestination(queue);
- return createBrowser(queue, null);
- }
-
- public QueueBrowserImpl createBrowser(final Queue queue, final String selector) throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- checkValidDestination(queue);
-
- return new QueueBrowserImpl((QueueImpl) queue, selector, this);
-
- }
-
- public TemporaryQueueImpl createTemporaryQueue() throws JMSException
- {
- checkClosed();
- checkNotTopicSession();
- try
- {
- Sender send = _session.createTemporaryQueueSender();
-
- TemporaryQueueImpl tempQ = new TemporaryQueueImpl(((Target)send.getTarget()).getAddress(), send, this);
- return tempQ;
- }
- catch (Sender.SenderCreationException e)
- {
- throw new JMSException("Unable to create temporary queue");
- }
- catch (ConnectionClosedException e)
- {
- throw new JMSException("Unable to create temporary queue");
- }
- }
-
- public TemporaryTopicImpl createTemporaryTopic() throws JMSException
- {
- checkClosed();
- checkNotQueueSession();
- try
- {
- Sender send = _session.createTemporaryQueueSender();
-
- TemporaryTopicImpl tempQ = new TemporaryTopicImpl(((Target)send.getTarget()).getAddress(), send, this);
- return tempQ;
- }
- catch (Sender.SenderCreationException e)
- {
- throw new JMSException("Unable to create temporary queue");
- }
- catch (ConnectionClosedException e)
- {
- throw new JMSException("Unable to create temporary queue");
- }
- }
-
- public void unsubscribe(final String s) throws JMSException
- {
- checkClosed();
-
- checkNotQueueSession();
-
- Target target = new Target();
- target.setAddress(UUID.randomUUID().toString());
-
- try
- {
- Receiver receiver = new Receiver(getClientSession(), s, target, null,
- org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);
-
- final org.apache.qpid.amqp_1_0.type.Source receiverSource = receiver.getSource();
- if(receiverSource instanceof Source)
- {
- Source source = (Source) receiverSource;
- receiver.close();
- receiver = new Receiver(getClientSession(), s, target, source,
- org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);
-
- }
- receiver.close();
- }
- catch(ConnectionErrorException e)
- {
- if(e.getRemoteError().getCondition() == AmqpError.NOT_FOUND)
- {
- throw new InvalidDestinationException(s);
- }
- else
- {
- JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- }
-
- //TODO
- }
-
- void stop()
- {
- //TODO
- }
-
- void start()
- {
- _dispatcher.start();
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.start();
- }
- }
-
- org.apache.qpid.amqp_1_0.client.Session getClientSession()
- {
- return _session;
- }
-
- public MessageFactory getMessageFactory()
- {
- return _messageFactory;
- }
-
- void acknowledgeAll() throws IllegalStateException
- {
- synchronized(_session.getEndpoint().getLock())
- {
- checkClosed();
- for(MessageConsumerImpl consumer : _consumers)
- {
- consumer.acknowledgeAll();
- }
- }
- }
-
- void messageListenerSet(final MessageConsumerImpl messageConsumer)
- {
- _dispatcher.updateMessageListener(messageConsumer);
- }
-
- public void messageArrived(final MessageConsumerImpl messageConsumer)
- {
- _dispatcher.messageArrivedAtConsumer(messageConsumer);
- }
-
- MessageImpl convertMessage(final javax.jms.Message message) throws JMSException
- {
- MessageImpl replacementMessage;
-
- if(message instanceof BytesMessage)
- {
- replacementMessage = convertBytesMessage((BytesMessage) message);
- }
- else
- {
- if(message instanceof MapMessage)
- {
- replacementMessage = convertMapMessage((MapMessage) message);
- }
- else
- {
- if(message instanceof ObjectMessage)
- {
- replacementMessage = convertObjectMessage((ObjectMessage) message);
- }
- else
- {
- if(message instanceof StreamMessage)
- {
- replacementMessage = convertStreamMessage((StreamMessage) message);
- }
- else
- {
- if(message instanceof TextMessage)
- {
- replacementMessage = convertTextMessage((TextMessage) message);
- }
- else
- {
- replacementMessage = createMessage();
- }
- }
- }
- }
- }
-
- convertMessageProperties(message, replacementMessage);
-
- return replacementMessage;
- }
-
-
- private void convertMessageProperties(final javax.jms.Message message, final MessageImpl replacementMessage)
- throws JMSException
- {
- Enumeration propertyNames = message.getPropertyNames();
- while (propertyNames.hasMoreElements())
- {
- String propertyName = String.valueOf(propertyNames.nextElement());
- // TODO: Shouldn't need to check for JMS properties here as don't think getPropertyNames() should return them
- if (!propertyName.startsWith("JMSX_"))
- {
- Object value = message.getObjectProperty(propertyName);
- replacementMessage.setObjectProperty(propertyName, value);
- }
- }
-
-
- replacementMessage.setJMSDeliveryMode(message.getJMSDeliveryMode());
-
- if (message.getJMSReplyTo() != null)
- {
- replacementMessage.setJMSReplyTo(message.getJMSReplyTo());
- }
-
- replacementMessage.setJMSType(message.getJMSType());
-
- replacementMessage.setJMSCorrelationID(message.getJMSCorrelationID());
- }
-
- private MessageImpl convertMapMessage(final MapMessage message) throws JMSException
- {
- MapMessageImpl mapMessage = createMapMessage();
-
- Enumeration mapNames = message.getMapNames();
- while (mapNames.hasMoreElements())
- {
- String name = (String) mapNames.nextElement();
- mapMessage.setObject(name, message.getObject(name));
- }
-
- return mapMessage;
- }
-
- private MessageImpl convertBytesMessage(final BytesMessage message) throws JMSException
- {
- BytesMessageImpl bytesMessage = createBytesMessage();
-
- message.reset();
-
- byte[] buf = new byte[1024];
-
- int len;
-
- while ((len = message.readBytes(buf)) != -1)
- {
- bytesMessage.writeBytes(buf, 0, len);
- }
-
- return bytesMessage;
- }
-
- private MessageImpl convertObjectMessage(final ObjectMessage message) throws JMSException
- {
- ObjectMessageImpl objectMessage = createObjectMessage();
- objectMessage.setObject(message.getObject());
- return objectMessage;
- }
-
- private MessageImpl convertStreamMessage(final StreamMessage message) throws JMSException
- {
- StreamMessageImpl streamMessage = createStreamMessage();
-
- try
- {
- message.reset();
- while (true)
- {
- streamMessage.writeObject(message.readObject());
- }
- }
- catch (MessageEOFException e)
- {
- // we're at the end so don't mind the exception
- }
-
- return streamMessage;
- }
-
- private MessageImpl convertTextMessage(final TextMessage message) throws JMSException
- {
- return createTextMessage(message.getText());
- }
-
- ConnectionImpl getConnection()
- {
- return _connection;
- }
-
- Transaction getTxn()
- {
- return _txn;
- }
-
- private class Dispatcher implements Runnable
- {
-
- private final List<MessageConsumerImpl> _messageConsumerList = new ArrayList<MessageConsumerImpl>();
-
- private boolean _closed;
- private boolean _started;
-
- private Message _recoveredMessage;
- private MessageConsumerImpl _recoveredConsumer;
- private MessageConsumerImpl _currentConsumer;
- private Message _currentMessage;
-
- public void run()
- {
- synchronized(getLock())
- {
- while(!_closed)
- {
- while(!_closed && (!_started || (_recoveredMessage == null && _messageConsumerList.isEmpty())))
- {
- try
- {
- getLock().wait();
- }
- catch (InterruptedException e)
- {
- return;
- }
- }
- while(!_closed && (_started && (_recoveredMessage != null || !_messageConsumerList.isEmpty())))
- {
- Message msg;
-
- MessageConsumerImpl consumer;
-
- boolean recoveredMessage = _recoveredMessage != null;
- if(recoveredMessage)
- {
- consumer = _recoveredConsumer;
- msg = _recoveredMessage;
- _recoveredMessage = null;
- _recoveredConsumer = null;
- }
- else
- {
- consumer = _messageConsumerList.remove(0);
- msg = consumer.receive0(0L);
- }
-
- MessageListener listener = consumer._messageListener;
-
- MessageImpl message = consumer.createJMSMessage(msg, recoveredMessage);
-
- if(message != null)
- {
- if(_acknowledgeMode == AcknowledgeMode.CLIENT_ACKNOWLEDGE)
- {
- consumer.setLastUnackedMessage(msg.getDeliveryTag());
- }
- _currentConsumer = consumer;
- _currentMessage = msg;
- try
- {
- listener.onMessage(message);
- }
- finally
- {
- _currentConsumer = null;
- _currentMessage = null;
- }
-
- if(_recoveredMessage == null)
- {
- consumer.preReceiveAction(msg);
- }
-
- }
-
- }
- Iterator<MessageConsumerImpl> consumers = _consumers.iterator();
- while(consumers.hasNext())
- {
- MessageConsumerImpl consumer = consumers.next();
- try
- {
- consumer.checkReceiverError();
- }
- catch (JMSException e)
- {
-
- consumers.remove();
- try
- {
- _connection.getExceptionListener().onException(e);
- consumer.close();
- }
- catch (JMSException e1)
- {
- }
- }
- }
-
- }
- }
- }
-
- private Object getLock()
- {
- return _session.getEndpoint().getLock();
- }
-
- public void messageArrivedAtConsumer(MessageConsumerImpl impl)
- {
- synchronized (getLock())
- {
- _messageConsumerList.add(impl);
- getLock().notifyAll();
- }
- }
-
- public void close()
- {
- synchronized (getLock())
- {
- _closed = true;
- getLock().notifyAll();
- }
- }
-
- public void updateMessageListener(final MessageConsumerImpl messageConsumer)
- {
- synchronized (getLock())
- {
- getLock().notifyAll();
- }
- }
-
- public void start()
- {
- synchronized (getLock())
- {
- _started = true;
- getLock().notifyAll();
- }
- }
-
- public void stop()
- {
- synchronized (getLock())
- {
- _started = false;
- getLock().notifyAll();
- }
- }
-
- public void doRecover()
- {
- _recoveredConsumer = _currentConsumer;
- _recoveredMessage = _currentMessage;
- }
- }
-
- void setQueueSession(final boolean queueSession)
- {
- _isQueueSession = queueSession;
- }
-
- void setTopicSession(final boolean topicSession)
- {
- _isTopicSession = topicSession;
- }
-
- String toAddress(DestinationImpl dest)
- {
- return _connection.toDecodedDestination(dest).getAddress();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+import javax.jms.BytesMessage;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.MessageEOFException;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.StreamMessage;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import org.apache.qpid.amqp_1_0.client.Connection;
+import org.apache.qpid.amqp_1_0.client.ConnectionClosedException;
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.ConnectionException;
+import org.apache.qpid.amqp_1_0.client.Message;
+import org.apache.qpid.amqp_1_0.client.Receiver;
+import org.apache.qpid.amqp_1_0.client.Sender;
+import org.apache.qpid.amqp_1_0.client.Transaction;
+import org.apache.qpid.amqp_1_0.jms.QueueReceiver;
+import org.apache.qpid.amqp_1_0.jms.QueueSender;
+import org.apache.qpid.amqp_1_0.jms.QueueSession;
+import org.apache.qpid.amqp_1_0.jms.Session;
+import org.apache.qpid.amqp_1_0.jms.TemporaryDestination;
+import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
+import org.apache.qpid.amqp_1_0.jms.TopicSession;
+import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
+import org.apache.qpid.amqp_1_0.transport.SessionEventListener;
+import org.apache.qpid.amqp_1_0.type.messaging.Source;
+import org.apache.qpid.amqp_1_0.type.messaging.Target;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class SessionImpl implements Session, QueueSession, TopicSession
+{
+ private ConnectionImpl _connection;
+ private AcknowledgeMode _acknowledgeMode;
+ private org.apache.qpid.amqp_1_0.client.Session _session;
+ private MessageFactory _messageFactory;
+ private List<MessageConsumerImpl> _consumers = new ArrayList<MessageConsumerImpl>();
+ private List<MessageProducerImpl> _producers = new ArrayList<MessageProducerImpl>();
+
+ private MessageListener _messageListener;
+ private Dispatcher _dispatcher = new Dispatcher();
+ private Thread _dispatcherThread;
+
+ private boolean _closed;
+
+ private boolean _isQueueSession;
+ private boolean _isTopicSession;
+ private Transaction _txn;
+
+ protected SessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode) throws JMSException
+ {
+ _connection = connection;
+ _acknowledgeMode = acknowledgeMode;
+ Connection clientConn = _connection.getClientConnection();
+ try
+ {
+ _session = clientConn.createSession();
+ }
+ catch (ConnectionException e)
+ {
+ final JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ _session.getEndpoint().setSessionEventListener(new SessionEventListener.DefaultSessionEventListener()
+ {
+ @Override
+ public void remoteEnd(End end)
+ {
+ if(!_closed)
+ {
+ try
+ {
+ close();
+ }
+ catch (JMSException e)
+ {
+ }
+ try
+ {
+ final Error error = end == null ? null : end.getError();
+ final ExceptionListener exceptionListener = _connection.getExceptionListener();
+ if(exceptionListener != null)
+ {
+ if(error != null)
+ {
+ exceptionListener.onException(new JMSException(error.getDescription(),
+ error.getCondition().getValue().toString()));
+ }
+ else
+ {
+ exceptionListener.onException(new JMSException("Session remotely closed"));
+ }
+ }
+ }
+ catch (JMSException e)
+ {
+
+ }
+
+ }
+ }
+ });
+ if(_acknowledgeMode == AcknowledgeMode.SESSION_TRANSACTED)
+ {
+ _txn = _session.createSessionLocalTransaction();
+ }
+
+ _messageFactory = new MessageFactory(this);
+
+ }
+
+ public BytesMessageImpl createBytesMessage() throws IllegalStateException
+ {
+ checkClosed();
+ return new BytesMessageImpl(this);
+
+ }
+
+ public MapMessageImpl createMapMessage() throws JMSException
+ {
+ checkClosed();
+ return new MapMessageImpl(this);
+ }
+
+ public MessageImpl createMessage() throws IllegalStateException
+ {
+ return createAmqpMessage();
+ }
+
+ public ObjectMessageImpl createObjectMessage() throws JMSException
+ {
+ checkClosed();
+ return new ObjectMessageImpl(this);
+ }
+
+ public ObjectMessageImpl createObjectMessage(final Serializable serializable) throws JMSException
+ {
+ checkClosed();
+ ObjectMessageImpl msg = new ObjectMessageImpl(this);
+ msg.setObject(serializable);
+ return msg;
+ }
+
+ public StreamMessageImpl createStreamMessage() throws JMSException
+ {
+ checkClosed();
+ return new StreamMessageImpl(this);
+ }
+
+ public TextMessageImpl createTextMessage() throws JMSException
+ {
+ return createTextMessage("");
+ }
+
+ public TextMessageImpl createTextMessage(final String s) throws JMSException
+ {
+ checkClosed();
+ TextMessageImpl msg = new TextMessageImpl(this);
+ msg.setText(s);
+ return msg;
+ }
+
+ public AmqpMessageImpl createAmqpMessage() throws IllegalStateException
+ {
+ checkClosed();
+ return new AmqpMessageImpl(this);
+ }
+
+ public boolean getTransacted() throws JMSException
+ {
+ checkClosed();
+ return _acknowledgeMode == AcknowledgeMode.SESSION_TRANSACTED;
+ }
+
+ public int getAcknowledgeMode() throws IllegalStateException
+ {
+ checkClosed();
+ return _acknowledgeMode.ordinal();
+ }
+
+ AcknowledgeMode getAckModeEnum()
+ {
+ return _acknowledgeMode;
+ }
+
+ public void commit() throws JMSException
+ {
+ checkClosed();
+ checkTransactional();
+
+ _txn.commit();
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.postCommit();
+ }
+
+ _txn = _session.createSessionLocalTransaction();
+ //TODO
+ }
+
+ public void rollback() throws JMSException
+ {
+ checkClosed();
+ checkTransactional();
+
+ _txn.rollback();
+
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.postRollback();
+ }
+
+ _txn = _session.createSessionLocalTransaction();
+
+ //TODO
+ }
+
+ private void checkTransactional() throws JMSException
+ {
+ if(!getTransacted())
+ {
+ throw new IllegalStateException("Session must be transacted in order to perform this operation");
+ }
+ }
+
+ public void close() throws JMSException
+ {
+ if(!_closed)
+ {
+ _closed = true;
+ _dispatcher.close();
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.close();
+ }
+ for(MessageProducerImpl producer : _producers)
+ {
+ producer.close();
+ }
+ _session.close();
+ _connection.removeSession(this);
+ }
+ }
+
+ private void checkClosed() throws IllegalStateException
+ {
+ if(_closed)
+ {
+ throw new IllegalStateException("Closed");
+ }
+ }
+
+ public void recover() throws JMSException
+ {
+ checkClosed();
+ checkNotTransactional();
+
+ if(_acknowledgeMode == AcknowledgeMode.CLIENT_ACKNOWLEDGE)
+ {
+ synchronized(_session.getEndpoint().getLock())
+ {
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.doRecover();
+ }
+ }
+ }
+ else
+ {
+ if(Thread.currentThread() == _dispatcherThread)
+ {
+ _dispatcher.doRecover();
+ }
+ }
+
+ }
+
+ private void checkNotTransactional() throws JMSException
+ {
+
+ if(getTransacted())
+ {
+ throw new IllegalStateException("This operation cannot be carried out on a transacted session");
+ }
+ }
+
+ public MessageListener getMessageListener() throws JMSException
+ {
+ return _messageListener;
+ }
+
+ public void setMessageListener(final MessageListener messageListener) throws JMSException
+ {
+ if(_messageListener != null)
+ {
+ // TODO
+ }
+ else
+ {
+ _messageListener = messageListener;
+ }
+ }
+
+ public void run()
+ {
+ //TODO
+ }
+
+ public MessageProducerImpl createProducer(final Destination destination) throws JMSException
+ {
+ checkClosed();
+
+ final MessageProducerImpl messageProducer = new MessageProducerImpl(destination, this);
+
+ _producers.add(messageProducer);
+
+ return messageProducer;
+ }
+
+ public MessageConsumerImpl createConsumer(final Destination destination) throws JMSException
+ {
+ checkClosed();
+ return createConsumer(destination, null, false);
+ }
+
+ public MessageConsumerImpl createConsumer(final Destination destination, final String selector) throws JMSException
+ {
+ checkClosed();
+ return createConsumer(destination, selector, false);
+ }
+
+ public MessageConsumerImpl createConsumer(final Destination destination, final String selector, final boolean noLocal)
+ throws JMSException
+ {
+ checkClosed();
+ checkValidDestination(destination);
+ if(destination instanceof TemporaryDestination)
+ {
+ TemporaryDestination temporaryDestination = (TemporaryDestination) destination;
+ if(temporaryDestination.getSession() != this)
+ {
+ throw new JMSException("Cannot consume from a temporary destination created on another session");
+ }
+ if(temporaryDestination.isDeleted())
+ {
+ throw new IllegalStateException("Destination is deleted");
+ }
+ }
+ final MessageConsumerImpl messageConsumer;
+ synchronized(_session.getEndpoint().getLock())
+ {
+ if(_dispatcherThread == null)
+ {
+ _dispatcherThread = new Thread(_dispatcher);
+ _dispatcherThread.start();
+ }
+
+ messageConsumer = new MessageConsumerImpl(destination, this, selector, noLocal);
+ addConsumer(messageConsumer);
+ if(_connection.isStarted())
+ {
+ messageConsumer.start();
+ }
+ }
+ return messageConsumer;
+ }
+
+ private void checkValidDestination(Destination destination) throws InvalidDestinationException
+ {
+ if (destination == null || !(destination instanceof DestinationImpl))
+ {
+ throw new InvalidDestinationException("Invalid Destination");
+ }
+ }
+
+
+ protected void addConsumer(final MessageConsumerImpl messageConsumer)
+ {
+ _consumers.add(messageConsumer);
+ }
+
+ public QueueImpl createQueue(final String s) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ return new QueueImpl(s);
+ }
+
+ public QueueReceiver createReceiver(final Queue queue) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ return createConsumer(queue);
+ }
+
+ public QueueReceiver createReceiver(final Queue queue, final String selector) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ return createConsumer(queue, selector);
+ }
+
+ public QueueSender createSender(final Queue queue) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ return createProducer(queue);
+ }
+
+ public TopicImpl createTopic(final String s) throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ return new TopicImpl(s);
+ }
+
+ public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ return createConsumer(topic);
+ }
+
+ public TopicSubscriber createSubscriber(final Topic topic, final String selector, final boolean noLocal) throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ return createConsumer(topic, selector, noLocal);
+ }
+
+ public TopicSubscriberImpl createDurableSubscriber(final Topic topic, final String name) throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ return createDurableSubscriber(topic, name, null, false);
+ }
+
+ private void checkNotQueueSession() throws IllegalStateException
+ {
+ if(_isQueueSession)
+ {
+ throw new IllegalStateException("Cannot perform this operation on a QueueSession");
+ }
+ }
+
+
+ private void checkNotTopicSession() throws IllegalStateException
+ {
+ if(_isTopicSession)
+ {
+ throw new IllegalStateException("Cannot perform this operation on a TopicSession");
+ }
+ }
+
+ public TopicSubscriberImpl createDurableSubscriber(final Topic topic, final String name, final String selector, final boolean noLocal)
+ throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ if(!(topic instanceof TopicImpl))
+ {
+ throw new InvalidDestinationException("invalid destination " + topic);
+ }
+ final TopicSubscriberImpl messageConsumer;
+ synchronized(_session.getEndpoint().getLock())
+ {
+ messageConsumer = new TopicSubscriberImpl(name, true, (org.apache.qpid.amqp_1_0.jms.Topic) topic, this,
+ selector,
+ noLocal);
+ addConsumer(messageConsumer);
+ if(_connection.isStarted())
+ {
+ messageConsumer.start();
+ }
+ }
+ return messageConsumer;
+ }
+
+ public TopicPublisher createPublisher(final Topic topic) throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ return createProducer(topic);
+ }
+
+ public QueueBrowserImpl createBrowser(final Queue queue) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ checkValidDestination(queue);
+ return createBrowser(queue, null);
+ }
+
+ public QueueBrowserImpl createBrowser(final Queue queue, final String selector) throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ checkValidDestination(queue);
+
+ return new QueueBrowserImpl((QueueImpl) queue, selector, this);
+
+ }
+
+ public TemporaryQueueImpl createTemporaryQueue() throws JMSException
+ {
+ checkClosed();
+ checkNotTopicSession();
+ try
+ {
+ Sender send = _session.createTemporaryQueueSender();
+
+ TemporaryQueueImpl tempQ = new TemporaryQueueImpl(((Target)send.getTarget()).getAddress(), send, this);
+ return tempQ;
+ }
+ catch (Sender.SenderCreationException e)
+ {
+ throw new JMSException("Unable to create temporary queue");
+ }
+ catch (ConnectionClosedException e)
+ {
+ throw new JMSException("Unable to create temporary queue");
+ }
+ }
+
+ public TemporaryTopicImpl createTemporaryTopic() throws JMSException
+ {
+ checkClosed();
+ checkNotQueueSession();
+ try
+ {
+ Sender send = _session.createTemporaryQueueSender();
+
+ TemporaryTopicImpl tempQ = new TemporaryTopicImpl(((Target)send.getTarget()).getAddress(), send, this);
+ return tempQ;
+ }
+ catch (Sender.SenderCreationException e)
+ {
+ throw new JMSException("Unable to create temporary queue");
+ }
+ catch (ConnectionClosedException e)
+ {
+ throw new JMSException("Unable to create temporary queue");
+ }
+ }
+
+ public void unsubscribe(final String s) throws JMSException
+ {
+ checkClosed();
+
+ checkNotQueueSession();
+
+ Target target = new Target();
+ target.setAddress(UUID.randomUUID().toString());
+
+ try
+ {
+ Receiver receiver = new Receiver(getClientSession(), s, target, null,
+ org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);
+
+ final org.apache.qpid.amqp_1_0.type.Source receiverSource = receiver.getSource();
+ if(receiverSource instanceof Source)
+ {
+ Source source = (Source) receiverSource;
+ receiver.close();
+ receiver = new Receiver(getClientSession(), s, target, source,
+ org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);
+
+ }
+ receiver.close();
+ }
+ catch(ConnectionErrorException e)
+ {
+ if(e.getRemoteError().getCondition() == AmqpError.NOT_FOUND)
+ {
+ throw new InvalidDestinationException(s);
+ }
+ else
+ {
+ JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ }
+
+ //TODO
+ }
+
+ void stop()
+ {
+ //TODO
+ }
+
+ void start()
+ {
+ _dispatcher.start();
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.start();
+ }
+ }
+
+ org.apache.qpid.amqp_1_0.client.Session getClientSession()
+ {
+ return _session;
+ }
+
+ public MessageFactory getMessageFactory()
+ {
+ return _messageFactory;
+ }
+
+ void acknowledgeAll() throws IllegalStateException
+ {
+ synchronized(_session.getEndpoint().getLock())
+ {
+ checkClosed();
+ for(MessageConsumerImpl consumer : _consumers)
+ {
+ consumer.acknowledgeAll();
+ }
+ }
+ }
+
+ void messageListenerSet(final MessageConsumerImpl messageConsumer)
+ {
+ _dispatcher.updateMessageListener(messageConsumer);
+ }
+
+ public void messageArrived(final MessageConsumerImpl messageConsumer)
+ {
+ _dispatcher.messageArrivedAtConsumer(messageConsumer);
+ }
+
+ MessageImpl convertMessage(final javax.jms.Message message) throws JMSException
+ {
+ MessageImpl replacementMessage;
+
+ if(message instanceof BytesMessage)
+ {
+ replacementMessage = convertBytesMessage((BytesMessage) message);
+ }
+ else
+ {
+ if(message instanceof MapMessage)
+ {
+ replacementMessage = convertMapMessage((MapMessage) message);
+ }
+ else
+ {
+ if(message instanceof ObjectMessage)
+ {
+ replacementMessage = convertObjectMessage((ObjectMessage) message);
+ }
+ else
+ {
+ if(message instanceof StreamMessage)
+ {
+ replacementMessage = convertStreamMessage((StreamMessage) message);
+ }
+ else
+ {
+ if(message instanceof TextMessage)
+ {
+ replacementMessage = convertTextMessage((TextMessage) message);
+ }
+ else
+ {
+ replacementMessage = createMessage();
+ }
+ }
+ }
+ }
+ }
+
+ convertMessageProperties(message, replacementMessage);
+
+ return replacementMessage;
+ }
+
+
+ private void convertMessageProperties(final javax.jms.Message message, final MessageImpl replacementMessage)
+ throws JMSException
+ {
+ Enumeration propertyNames = message.getPropertyNames();
+ while (propertyNames.hasMoreElements())
+ {
+ String propertyName = String.valueOf(propertyNames.nextElement());
+ // TODO: Shouldn't need to check for JMS properties here as don't think getPropertyNames() should return them
+ if (!propertyName.startsWith("JMSX_"))
+ {
+ Object value = message.getObjectProperty(propertyName);
+ replacementMessage.setObjectProperty(propertyName, value);
+ }
+ }
+
+
+ replacementMessage.setJMSDeliveryMode(message.getJMSDeliveryMode());
+
+ if (message.getJMSReplyTo() != null)
+ {
+ replacementMessage.setJMSReplyTo(message.getJMSReplyTo());
+ }
+
+ replacementMessage.setJMSType(message.getJMSType());
+
+ replacementMessage.setJMSCorrelationID(message.getJMSCorrelationID());
+ }
+
+ private MessageImpl convertMapMessage(final MapMessage message) throws JMSException
+ {
+ MapMessageImpl mapMessage = createMapMessage();
+
+ Enumeration mapNames = message.getMapNames();
+ while (mapNames.hasMoreElements())
+ {
+ String name = (String) mapNames.nextElement();
+ mapMessage.setObject(name, message.getObject(name));
+ }
+
+ return mapMessage;
+ }
+
+ private MessageImpl convertBytesMessage(final BytesMessage message) throws JMSException
+ {
+ BytesMessageImpl bytesMessage = createBytesMessage();
+
+ message.reset();
+
+ byte[] buf = new byte[1024];
+
+ int len;
+
+ while ((len = message.readBytes(buf)) != -1)
+ {
+ bytesMessage.writeBytes(buf, 0, len);
+ }
+
+ return bytesMessage;
+ }
+
+ private MessageImpl convertObjectMessage(final ObjectMessage message) throws JMSException
+ {
+ ObjectMessageImpl objectMessage = createObjectMessage();
+ objectMessage.setObject(message.getObject());
+ return objectMessage;
+ }
+
+ private MessageImpl convertStreamMessage(final StreamMessage message) throws JMSException
+ {
+ StreamMessageImpl streamMessage = createStreamMessage();
+
+ try
+ {
+ message.reset();
+ while (true)
+ {
+ streamMessage.writeObject(message.readObject());
+ }
+ }
+ catch (MessageEOFException e)
+ {
+ // we're at the end so don't mind the exception
+ }
+
+ return streamMessage;
+ }
+
+ private MessageImpl convertTextMessage(final TextMessage message) throws JMSException
+ {
+ return createTextMessage(message.getText());
+ }
+
+ ConnectionImpl getConnection()
+ {
+ return _connection;
+ }
+
+ Transaction getTxn()
+ {
+ return _txn;
+ }
+
+ private class Dispatcher implements Runnable
+ {
+
+ private final List<MessageConsumerImpl> _messageConsumerList = new ArrayList<MessageConsumerImpl>();
+
+ private boolean _closed;
+ private boolean _started;
+
+ private Message _recoveredMessage;
+ private MessageConsumerImpl _recoveredConsumer;
+ private MessageConsumerImpl _currentConsumer;
+ private Message _currentMessage;
+
+ public void run()
+ {
+ synchronized(getLock())
+ {
+ while(!_closed)
+ {
+ while(!_closed && (!_started || (_recoveredMessage == null && _messageConsumerList.isEmpty())))
+ {
+ try
+ {
+ getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ return;
+ }
+ }
+ while(!_closed && (_started && (_recoveredMessage != null || !_messageConsumerList.isEmpty())))
+ {
+ Message msg;
+
+ MessageConsumerImpl consumer;
+
+ boolean recoveredMessage = _recoveredMessage != null;
+ if(recoveredMessage)
+ {
+ consumer = _recoveredConsumer;
+ msg = _recoveredMessage;
+ _recoveredMessage = null;
+ _recoveredConsumer = null;
+ }
+ else
+ {
+ consumer = _messageConsumerList.remove(0);
+ msg = consumer.receive0(0L);
+ }
+
+ MessageListener listener = consumer._messageListener;
+
+ MessageImpl message = consumer.createJMSMessage(msg, recoveredMessage);
+
+ if(message != null)
+ {
+ if(_acknowledgeMode == AcknowledgeMode.CLIENT_ACKNOWLEDGE)
+ {
+ consumer.setLastUnackedMessage(msg.getDeliveryTag());
+ }
+ _currentConsumer = consumer;
+ _currentMessage = msg;
+ try
+ {
+ listener.onMessage(message);
+ }
+ finally
+ {
+ _currentConsumer = null;
+ _currentMessage = null;
+ }
+
+ if(_recoveredMessage == null)
+ {
+ consumer.preReceiveAction(msg);
+ }
+
+ }
+
+ }
+ Iterator<MessageConsumerImpl> consumers = _consumers.iterator();
+ while(consumers.hasNext())
+ {
+ MessageConsumerImpl consumer = consumers.next();
+ try
+ {
+ consumer.checkReceiverError();
+ }
+ catch (JMSException e)
+ {
+
+ consumers.remove();
+ try
+ {
+ _connection.getExceptionListener().onException(e);
+ consumer.close();
+ }
+ catch (JMSException e1)
+ {
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ private Object getLock()
+ {
+ return _session.getEndpoint().getLock();
+ }
+
+ public void messageArrivedAtConsumer(MessageConsumerImpl impl)
+ {
+ synchronized (getLock())
+ {
+ _messageConsumerList.add(impl);
+ getLock().notifyAll();
+ }
+ }
+
+ public void close()
+ {
+ synchronized (getLock())
+ {
+ _closed = true;
+ getLock().notifyAll();
+ }
+ }
+
+ public void updateMessageListener(final MessageConsumerImpl messageConsumer)
+ {
+ synchronized (getLock())
+ {
+ getLock().notifyAll();
+ }
+ }
+
+ public void start()
+ {
+ synchronized (getLock())
+ {
+ _started = true;
+ getLock().notifyAll();
+ }
+ }
+
+ public void stop()
+ {
+ synchronized (getLock())
+ {
+ _started = false;
+ getLock().notifyAll();
+ }
+ }
+
+ public void doRecover()
+ {
+ _recoveredConsumer = _currentConsumer;
+ _recoveredMessage = _currentMessage;
+ }
+ }
+
+ void setQueueSession(final boolean queueSession)
+ {
+ _isQueueSession = queueSession;
+ }
+
+ void setTopicSession(final boolean topicSession)
+ {
+ _isTopicSession = topicSession;
+ }
+
+ String toAddress(DestinationImpl dest)
+ {
+ return _connection.toDecodedDestination(dest).getAddress();
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/StreamMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/StreamMessageImpl.java
index 8275de884e..9aededca5e 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/StreamMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/StreamMessageImpl.java
@@ -1,466 +1,466 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.StreamMessage;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import java.io.EOFException;
-import java.util.*;
-
-public class StreamMessageImpl extends MessageImpl implements StreamMessage
-{
- private List _list;
- private boolean _readOnly;
- private int _position = -1;
- private int _offset = -1;
-
-
-
- protected StreamMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, List list,
- Footer footer, SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- _list = list;
- }
-
- StreamMessageImpl(final SessionImpl session)
- {
- super(new Header(), new MessageAnnotations(new HashMap()), new Properties(),
- new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
- session);
- _list = new ArrayList();
- }
-
- public StreamMessageImpl(final Header header,
- final MessageAnnotations messageAnnotations,
- final Properties properties,
- final ApplicationProperties appProperties,
- final List amqpListSection, final Footer footer)
- {
- super(header, messageAnnotations, properties, appProperties, footer, null);
- _list = amqpListSection;
- }
-
- public boolean readBoolean() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Boolean)
- {
- return (Boolean) obj;
- }
- if(obj instanceof String || obj == null)
- {
- return Boolean.valueOf((String)obj);
- }
- else
- {
- throw new MessageFormatException("Cannot read " + obj.getClass().getName() + " as boolean");
- }
- }
-
- @Override
- public void clearBody() throws JMSException
- {
- super.clearBody();
- _list.clear();
- _position = -1;
- _offset = -1;
- }
-
- public byte readByte() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Byte)
- {
- return (Byte) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Byte.valueOf((String)obj);
- }
- catch(RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- }
-
- private void backup()
- {
- _position--;
- }
-
- public short readShort() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Short)
- {
- return (Short) obj;
- }
- else if(obj instanceof Byte)
- {
- return (Byte) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Short.valueOf((String)obj);
- }
- catch(RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
-
- }
-
- public char readChar() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Character)
- {
- return (Character) obj;
- }
- if(obj == null)
- {
- backup();
- throw new NullPointerException();
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot read " + obj.getClass().getName() + " as boolean");
- }
-
- }
-
- public int readInt() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Integer)
- {
- return (Integer) obj;
- }
- else if(obj instanceof Short)
- {
- return (Short) obj;
- }
- else if(obj instanceof Byte)
- {
- return (Byte) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Integer.valueOf((String)obj);
- }
- catch (RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- }
-
- public long readLong() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Long)
- {
- return (Long) obj;
- }
- else if(obj instanceof Integer)
- {
- return (Integer) obj;
- }
- else if(obj instanceof Short)
- {
- return (Short) obj;
- }
- else if(obj instanceof Byte)
- {
- return (Byte) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Long.valueOf((String)obj);
- }
- catch (RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- }
-
- public float readFloat() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Float)
- {
- return (Float) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Float.valueOf((String)obj);
- }
- catch (RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- }
-
- public double readDouble() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Double)
- {
- return (Double) obj;
- }
- else if(obj instanceof Float)
- {
- return (Float) obj;
- }
- else if(obj instanceof String || obj == null)
- {
- try
- {
- return Double.valueOf((String)obj);
- }
- catch (RuntimeException e)
- {
- backup();
- throw e;
- }
- }
- else
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- }
-
- public String readString() throws JMSException
- {
- Object obj = readObject();
- if(obj instanceof Binary)
- {
- backup();
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- return String.valueOf(obj);
- }
-
- public int readBytes(final byte[] bytes) throws JMSException
- {
- Object obj = readObject();
- if(!(obj instanceof Binary))
- {
- backup();
- if(_position > -1 && _list.get(_position) instanceof Binary)
- {
- return -1;
- }
- throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
- }
- Binary binary = (Binary) obj;
- if(bytes.length >= binary.getLength())
- {
- System.arraycopy(binary.getArray(),binary.getArrayOffset(),bytes,0,binary.getLength());
- return binary.getLength();
- }
- return -1;
- }
-
- public Object readObject() throws JMSException
- {
- checkReadable();
- if(_offset == -1)
- {
- try
- {
- return _list.get(++_position);
- }
- catch (IndexOutOfBoundsException e)
- {
- throw new MessageEOFException("No more data in message stream");
- }
- }
- else
- {
- return null; //TODO
- }
- }
-
- public void writeBoolean(final boolean b) throws JMSException
- {
- checkWritable();
- _list.add(b);
- }
-
- public void writeByte(final byte b) throws JMSException
- {
- checkWritable();
- _list.add(b);
- }
-
- public void writeShort(final short i) throws JMSException
- {
- checkWritable();
- _list.add(i);
- }
-
- public void writeChar(final char c) throws JMSException
- {
- checkWritable();
- _list.add(c);
- }
-
- public void writeInt(final int i) throws JMSException
- {
- checkWritable();
- _list.add(i);
- }
-
- public void writeLong(final long l) throws JMSException
- {
- checkWritable();
- _list.add(l);
- }
-
- public void writeFloat(final float v) throws JMSException
- {
- checkWritable();
- _list.add(v);
- }
-
- public void writeDouble(final double v) throws JMSException
- {
- checkWritable();
- _list.add(v);
- }
-
- public void writeString(final String s) throws JMSException
- {
- checkWritable();
- _list.add(s);
- }
-
- public void writeBytes(final byte[] bytes) throws JMSException
- {
- checkWritable();
- writeBytes(bytes, 0, bytes.length);
- }
-
- public void writeBytes(final byte[] bytes, final int offset, final int size) throws JMSException
- {
- checkWritable();
-
- if(!_list.isEmpty() && _list.get(_list.size()-1) instanceof byte[])
- {
- Binary oldVal = (Binary) _list.get(_list.size()-1);
- byte[] allBytes = new byte[oldVal.getLength() + size];
- System.arraycopy(oldVal.getArray(),oldVal.getArrayOffset(),allBytes,0,oldVal.getLength());
- System.arraycopy(bytes, offset, allBytes, oldVal.getLength(), size);
- _list.set(_list.size()-1, allBytes);
- }
- else
- {
- byte[] dup = new byte[size];
- System.arraycopy(bytes,offset,dup,0,size);
- _list.add(new Binary(dup));
- }
- }
-
- public void writeObject(final Object o) throws JMSException
- {
- checkWritable();
- if(o == null || _supportedClasses.contains(o.getClass()))
- {
- _list.add(o);
- }
- }
-
- public void reset() throws JMSException
- {
- super.reset();
- _position = -1;
- _offset = -1;
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
- sections.add(new AmqpValue(_list));
- sections.add(getFooter());
- return sections;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.StreamMessage;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageEOFException;
+import javax.jms.MessageFormatException;
+import java.io.EOFException;
+import java.util.*;
+
+public class StreamMessageImpl extends MessageImpl implements StreamMessage
+{
+ private List _list;
+ private boolean _readOnly;
+ private int _position = -1;
+ private int _offset = -1;
+
+
+
+ protected StreamMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, List list,
+ Footer footer, SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ _list = list;
+ }
+
+ StreamMessageImpl(final SessionImpl session)
+ {
+ super(new Header(), new MessageAnnotations(new HashMap()), new Properties(),
+ new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
+ session);
+ _list = new ArrayList();
+ }
+
+ public StreamMessageImpl(final Header header,
+ final MessageAnnotations messageAnnotations,
+ final Properties properties,
+ final ApplicationProperties appProperties,
+ final List amqpListSection, final Footer footer)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, null);
+ _list = amqpListSection;
+ }
+
+ public boolean readBoolean() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Boolean)
+ {
+ return (Boolean) obj;
+ }
+ if(obj instanceof String || obj == null)
+ {
+ return Boolean.valueOf((String)obj);
+ }
+ else
+ {
+ throw new MessageFormatException("Cannot read " + obj.getClass().getName() + " as boolean");
+ }
+ }
+
+ @Override
+ public void clearBody() throws JMSException
+ {
+ super.clearBody();
+ _list.clear();
+ _position = -1;
+ _offset = -1;
+ }
+
+ public byte readByte() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Byte)
+ {
+ return (Byte) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Byte.valueOf((String)obj);
+ }
+ catch(RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ }
+
+ private void backup()
+ {
+ _position--;
+ }
+
+ public short readShort() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Short)
+ {
+ return (Short) obj;
+ }
+ else if(obj instanceof Byte)
+ {
+ return (Byte) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Short.valueOf((String)obj);
+ }
+ catch(RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+
+ }
+
+ public char readChar() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Character)
+ {
+ return (Character) obj;
+ }
+ if(obj == null)
+ {
+ backup();
+ throw new NullPointerException();
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot read " + obj.getClass().getName() + " as boolean");
+ }
+
+ }
+
+ public int readInt() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Integer)
+ {
+ return (Integer) obj;
+ }
+ else if(obj instanceof Short)
+ {
+ return (Short) obj;
+ }
+ else if(obj instanceof Byte)
+ {
+ return (Byte) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Integer.valueOf((String)obj);
+ }
+ catch (RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ }
+
+ public long readLong() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Long)
+ {
+ return (Long) obj;
+ }
+ else if(obj instanceof Integer)
+ {
+ return (Integer) obj;
+ }
+ else if(obj instanceof Short)
+ {
+ return (Short) obj;
+ }
+ else if(obj instanceof Byte)
+ {
+ return (Byte) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Long.valueOf((String)obj);
+ }
+ catch (RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ }
+
+ public float readFloat() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Float)
+ {
+ return (Float) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Float.valueOf((String)obj);
+ }
+ catch (RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ }
+
+ public double readDouble() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Double)
+ {
+ return (Double) obj;
+ }
+ else if(obj instanceof Float)
+ {
+ return (Float) obj;
+ }
+ else if(obj instanceof String || obj == null)
+ {
+ try
+ {
+ return Double.valueOf((String)obj);
+ }
+ catch (RuntimeException e)
+ {
+ backup();
+ throw e;
+ }
+ }
+ else
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ }
+
+ public String readString() throws JMSException
+ {
+ Object obj = readObject();
+ if(obj instanceof Binary)
+ {
+ backup();
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ return String.valueOf(obj);
+ }
+
+ public int readBytes(final byte[] bytes) throws JMSException
+ {
+ Object obj = readObject();
+ if(!(obj instanceof Binary))
+ {
+ backup();
+ if(_position > -1 && _list.get(_position) instanceof Binary)
+ {
+ return -1;
+ }
+ throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
+ }
+ Binary binary = (Binary) obj;
+ if(bytes.length >= binary.getLength())
+ {
+ System.arraycopy(binary.getArray(),binary.getArrayOffset(),bytes,0,binary.getLength());
+ return binary.getLength();
+ }
+ return -1;
+ }
+
+ public Object readObject() throws JMSException
+ {
+ checkReadable();
+ if(_offset == -1)
+ {
+ try
+ {
+ return _list.get(++_position);
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ throw new MessageEOFException("No more data in message stream");
+ }
+ }
+ else
+ {
+ return null; //TODO
+ }
+ }
+
+ public void writeBoolean(final boolean b) throws JMSException
+ {
+ checkWritable();
+ _list.add(b);
+ }
+
+ public void writeByte(final byte b) throws JMSException
+ {
+ checkWritable();
+ _list.add(b);
+ }
+
+ public void writeShort(final short i) throws JMSException
+ {
+ checkWritable();
+ _list.add(i);
+ }
+
+ public void writeChar(final char c) throws JMSException
+ {
+ checkWritable();
+ _list.add(c);
+ }
+
+ public void writeInt(final int i) throws JMSException
+ {
+ checkWritable();
+ _list.add(i);
+ }
+
+ public void writeLong(final long l) throws JMSException
+ {
+ checkWritable();
+ _list.add(l);
+ }
+
+ public void writeFloat(final float v) throws JMSException
+ {
+ checkWritable();
+ _list.add(v);
+ }
+
+ public void writeDouble(final double v) throws JMSException
+ {
+ checkWritable();
+ _list.add(v);
+ }
+
+ public void writeString(final String s) throws JMSException
+ {
+ checkWritable();
+ _list.add(s);
+ }
+
+ public void writeBytes(final byte[] bytes) throws JMSException
+ {
+ checkWritable();
+ writeBytes(bytes, 0, bytes.length);
+ }
+
+ public void writeBytes(final byte[] bytes, final int offset, final int size) throws JMSException
+ {
+ checkWritable();
+
+ if(!_list.isEmpty() && _list.get(_list.size()-1) instanceof byte[])
+ {
+ Binary oldVal = (Binary) _list.get(_list.size()-1);
+ byte[] allBytes = new byte[oldVal.getLength() + size];
+ System.arraycopy(oldVal.getArray(),oldVal.getArrayOffset(),allBytes,0,oldVal.getLength());
+ System.arraycopy(bytes, offset, allBytes, oldVal.getLength(), size);
+ _list.set(_list.size()-1, allBytes);
+ }
+ else
+ {
+ byte[] dup = new byte[size];
+ System.arraycopy(bytes,offset,dup,0,size);
+ _list.add(new Binary(dup));
+ }
+ }
+
+ public void writeObject(final Object o) throws JMSException
+ {
+ checkWritable();
+ if(o == null || _supportedClasses.contains(o.getClass()))
+ {
+ _list.add(o);
+ }
+ }
+
+ public void reset() throws JMSException
+ {
+ super.reset();
+ _position = -1;
+ _offset = -1;
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+ sections.add(new AmqpValue(_list));
+ sections.add(getFooter());
+ return sections;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryQueueImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryQueueImpl.java
index 2c48a6b20f..45cd7525c0 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryQueueImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryQueueImpl.java
@@ -1,107 +1,107 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.client.Sender;
-import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
-import org.apache.qpid.amqp_1_0.jms.TemporaryQueue;
-
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-public class TemporaryQueueImpl extends QueueImpl implements TemporaryQueue
-{
- private Sender _sender;
- private SessionImpl _session;
- private final Set<MessageConsumer> _consumers =
- Collections.synchronizedSet(new HashSet<MessageConsumer>());
- private boolean _deleted;
-
- protected TemporaryQueueImpl(String address, Sender sender, SessionImpl session)
- {
- super(address);
- _sender = sender;
- _session = session;
- _session.getConnection().addOnCloseTask(new ConnectionImpl.CloseTask()
- {
- public void onClose() throws JMSException
- {
- synchronized (TemporaryQueueImpl.this)
- {
- close();
- }
- }
- });
- }
-
- public synchronized void delete() throws JMSException
- {
- if(_consumers.isEmpty())
- {
- close();
- _deleted = true;
- }
- else
- {
- throw new IllegalStateException("Cannot delete destination as it has consumers");
- }
- }
-
- private void close() throws JMSException
- {
- if(_sender != null)
- {
- try
- {
- _sender.close();
- _sender = null;
- }
- catch (Sender.SenderClosingException e)
- {
- final JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- }
-
- }
-
- public SessionImpl getSession()
- {
- return _session;
- }
-
- public void addConsumer(MessageConsumer consumer)
- {
- _consumers.add(consumer);
- }
-
- public void removeConsumer(MessageConsumer consumer)
- {
- _consumers.remove(consumer);
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.client.Sender;
+import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
+import org.apache.qpid.amqp_1_0.jms.TemporaryQueue;
+
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class TemporaryQueueImpl extends QueueImpl implements TemporaryQueue
+{
+ private Sender _sender;
+ private SessionImpl _session;
+ private final Set<MessageConsumer> _consumers =
+ Collections.synchronizedSet(new HashSet<MessageConsumer>());
+ private boolean _deleted;
+
+ protected TemporaryQueueImpl(String address, Sender sender, SessionImpl session)
+ {
+ super(address);
+ _sender = sender;
+ _session = session;
+ _session.getConnection().addOnCloseTask(new ConnectionImpl.CloseTask()
+ {
+ public void onClose() throws JMSException
+ {
+ synchronized (TemporaryQueueImpl.this)
+ {
+ close();
+ }
+ }
+ });
+ }
+
+ public synchronized void delete() throws JMSException
+ {
+ if(_consumers.isEmpty())
+ {
+ close();
+ _deleted = true;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot delete destination as it has consumers");
+ }
+ }
+
+ private void close() throws JMSException
+ {
+ if(_sender != null)
+ {
+ try
+ {
+ _sender.close();
+ _sender = null;
+ }
+ catch (Sender.SenderClosingException e)
+ {
+ final JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ }
+
+ }
+
+ public SessionImpl getSession()
+ {
+ return _session;
+ }
+
+ public void addConsumer(MessageConsumer consumer)
+ {
+ _consumers.add(consumer);
+ }
+
+ public void removeConsumer(MessageConsumer consumer)
+ {
+ _consumers.remove(consumer);
+ }
+
+ public boolean isDeleted()
+ {
+ return _deleted;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryTopicImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryTopicImpl.java
index 3ac70a29f2..b2587e41d4 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryTopicImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TemporaryTopicImpl.java
@@ -1,112 +1,112 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.client.Sender;
-import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
-import org.apache.qpid.amqp_1_0.jms.TemporaryTopic;
-
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-public class TemporaryTopicImpl extends TopicImpl implements TemporaryTopic
-{
- private Sender _sender;
- private SessionImpl _session;
- private final Set<MessageConsumer> _consumers =
- Collections.synchronizedSet(new HashSet<MessageConsumer>());
- private boolean _deleted;
-
- protected TemporaryTopicImpl(String address, Sender sender, SessionImpl session)
- {
- super(address);
- _sender = sender;
- _session = session;
-
- _session.getConnection().addOnCloseTask(new ConnectionImpl.CloseTask()
- {
- public void onClose() throws JMSException
- {
- synchronized (TemporaryTopicImpl.this)
- {
- close();
- }
- }
- });
- }
-
- public void delete() throws JMSException
- {
- if(_consumers.isEmpty())
- {
- _deleted = true;
- close();
- }
- else
- {
- throw new IllegalStateException("Cannot delete destination as it has consumers");
- }
-
- }
-
-
- private void close() throws JMSException
- {
- if(_sender != null)
- {
- try
- {
-
- _sender.close();
- _sender = null;
- }
- catch (Sender.SenderClosingException e)
- {
- final JMSException jmsException = new JMSException(e.getMessage());
- jmsException.setLinkedException(e);
- throw jmsException;
- }
- }
-
- }
-
- public SessionImpl getSession()
- {
- return _session;
- }
-
-
- public void addConsumer(MessageConsumer consumer)
- {
- _consumers.add(consumer);
- }
-
- public void removeConsumer(MessageConsumer consumer)
- {
- _consumers.remove(consumer);
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.client.Sender;
+import org.apache.qpid.amqp_1_0.jms.MessageConsumer;
+import org.apache.qpid.amqp_1_0.jms.TemporaryTopic;
+
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class TemporaryTopicImpl extends TopicImpl implements TemporaryTopic
+{
+ private Sender _sender;
+ private SessionImpl _session;
+ private final Set<MessageConsumer> _consumers =
+ Collections.synchronizedSet(new HashSet<MessageConsumer>());
+ private boolean _deleted;
+
+ protected TemporaryTopicImpl(String address, Sender sender, SessionImpl session)
+ {
+ super(address);
+ _sender = sender;
+ _session = session;
+
+ _session.getConnection().addOnCloseTask(new ConnectionImpl.CloseTask()
+ {
+ public void onClose() throws JMSException
+ {
+ synchronized (TemporaryTopicImpl.this)
+ {
+ close();
+ }
+ }
+ });
+ }
+
+ public void delete() throws JMSException
+ {
+ if(_consumers.isEmpty())
+ {
+ _deleted = true;
+ close();
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot delete destination as it has consumers");
+ }
+
+ }
+
+
+ private void close() throws JMSException
+ {
+ if(_sender != null)
+ {
+ try
+ {
+
+ _sender.close();
+ _sender = null;
+ }
+ catch (Sender.SenderClosingException e)
+ {
+ final JMSException jmsException = new JMSException(e.getMessage());
+ jmsException.setLinkedException(e);
+ throw jmsException;
+ }
+ }
+
+ }
+
+ public SessionImpl getSession()
+ {
+ return _session;
+ }
+
+
+ public void addConsumer(MessageConsumer consumer)
+ {
+ _consumers.add(consumer);
+ }
+
+ public void removeConsumer(MessageConsumer consumer)
+ {
+ _consumers.remove(consumer);
+ }
+
+ public boolean isDeleted()
+ {
+ return _deleted;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TextMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TextMessageImpl.java
index 5d9172229c..de79defddb 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TextMessageImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TextMessageImpl.java
@@ -1,93 +1,93 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.TextMessage;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageNotWriteableException;
-import java.util.*;
-
-public class TextMessageImpl extends MessageImpl implements TextMessage
-{
- private String _text;
-
- protected TextMessageImpl(Header header,
- MessageAnnotations messageAnnotations,
- Properties properties,
- ApplicationProperties appProperties,
- String text,
- Footer footer,
- SessionImpl session)
- {
- super(header, messageAnnotations, properties, appProperties, footer, session);
- _text = text;
- }
-
- protected TextMessageImpl(final SessionImpl session)
- {
- super(new Header(), new MessageAnnotations(new HashMap()),
- new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
- session);
- }
-
- public void setText(final String text) throws MessageNotWriteableException
- {
- if(isReadOnly())
- {
- throw new MessageNotWriteableException("Cannot set object, message is in read only mode");
- }
-
- _text = text;
- }
-
- public String getText() throws JMSException
- {
- return _text;
- }
-
- @Override
- public void clearBody() throws JMSException
- {
- super.clearBody();
- _text = null;
- }
-
- @Override Collection<Section> getSections()
- {
- List<Section> sections = new ArrayList<Section>();
- sections.add(getHeader());
- if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
- {
- sections.add(getMessageAnnotations());
- }
- sections.add(getProperties());
- sections.add(getApplicationProperties());
- AmqpValue section = new AmqpValue(_text);
- sections.add(section);
- sections.add(getFooter());
- return sections;
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.TextMessage;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageNotWriteableException;
+import java.util.*;
+
+public class TextMessageImpl extends MessageImpl implements TextMessage
+{
+ private String _text;
+
+ protected TextMessageImpl(Header header,
+ MessageAnnotations messageAnnotations,
+ Properties properties,
+ ApplicationProperties appProperties,
+ String text,
+ Footer footer,
+ SessionImpl session)
+ {
+ super(header, messageAnnotations, properties, appProperties, footer, session);
+ _text = text;
+ }
+
+ protected TextMessageImpl(final SessionImpl session)
+ {
+ super(new Header(), new MessageAnnotations(new HashMap()),
+ new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP),
+ session);
+ }
+
+ public void setText(final String text) throws MessageNotWriteableException
+ {
+ if(isReadOnly())
+ {
+ throw new MessageNotWriteableException("Cannot set object, message is in read only mode");
+ }
+
+ _text = text;
+ }
+
+ public String getText() throws JMSException
+ {
+ return _text;
+ }
+
+ @Override
+ public void clearBody() throws JMSException
+ {
+ super.clearBody();
+ _text = null;
+ }
+
+ @Override Collection<Section> getSections()
+ {
+ List<Section> sections = new ArrayList<Section>();
+ sections.add(getHeader());
+ if(getMessageAnnotations() != null && getMessageAnnotations().getValue() != null && !getMessageAnnotations().getValue().isEmpty())
+ {
+ sections.add(getMessageAnnotations());
+ }
+ sections.add(getProperties());
+ sections.add(getApplicationProperties());
+ AmqpValue section = new AmqpValue(_text);
+ sections.add(section);
+ sections.add(getFooter());
+ return sections;
+ }
+
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicConnectionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicConnectionImpl.java
index de456532cb..8fe92dd801 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicConnectionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicConnectionImpl.java
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.TopicConnection;
-
-import javax.jms.ConnectionConsumer;
-import javax.jms.JMSException;
-import javax.jms.ServerSessionPool;
-import javax.jms.Topic;
-
-public class TopicConnectionImpl extends ConnectionImpl implements TopicConnection
-{
- TopicConnectionImpl(String host, int port, String username, String password, String clientId)
- throws JMSException
- {
- super(host, port, username, password, clientId);
- }
-
- public TopicSessionImpl createTopicSession(final boolean b, final int i) throws JMSException
- {
- return null; //TODO
- }
-
- public ConnectionConsumer createConnectionConsumer(final Topic topic,
- final String s,
- final ServerSessionPool serverSessionPool,
- final int i) throws JMSException
- {
- return null; //TODO
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.TopicConnection;
+
+import javax.jms.ConnectionConsumer;
+import javax.jms.JMSException;
+import javax.jms.ServerSessionPool;
+import javax.jms.Topic;
+
+public class TopicConnectionImpl extends ConnectionImpl implements TopicConnection
+{
+ TopicConnectionImpl(String host, int port, String username, String password, String clientId)
+ throws JMSException
+ {
+ super(host, port, username, password, clientId);
+ }
+
+ public TopicSessionImpl createTopicSession(final boolean b, final int i) throws JMSException
+ {
+ return null; //TODO
+ }
+
+ public ConnectionConsumer createConnectionConsumer(final Topic topic,
+ final String s,
+ final ServerSessionPool serverSessionPool,
+ final int i) throws JMSException
+ {
+ return null; //TODO
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicImpl.java
index e54a660963..5292944075 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicImpl.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.Topic;
-
-import java.util.WeakHashMap;
-
-public class TopicImpl extends DestinationImpl implements Topic
-{
- private static final WeakHashMap<String, TopicImpl> TOPIC_CACHE =
- new WeakHashMap<String, TopicImpl>();
-
-
- public TopicImpl(String address)
- {
- super(address);
- }
-
- public String getTopicName()
- {
- return getAddress();
- }
-
- public static synchronized TopicImpl createTopic(final String address)
- {
- TopicImpl topic = TOPIC_CACHE.get(address);
- if(topic == null)
- {
- topic = new TopicImpl(address);
- TOPIC_CACHE.put(address, topic);
- }
- return topic;
- }
-
- public static TopicImpl valueOf(String address)
- {
- return address == null ? null : createTopic(address);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.Topic;
+
+import java.util.WeakHashMap;
+
+public class TopicImpl extends DestinationImpl implements Topic
+{
+ private static final WeakHashMap<String, TopicImpl> TOPIC_CACHE =
+ new WeakHashMap<String, TopicImpl>();
+
+
+ public TopicImpl(String address)
+ {
+ super(address);
+ }
+
+ public String getTopicName()
+ {
+ return getAddress();
+ }
+
+ public static synchronized TopicImpl createTopic(final String address)
+ {
+ TopicImpl topic = TOPIC_CACHE.get(address);
+ if(topic == null)
+ {
+ topic = new TopicImpl(address);
+ TOPIC_CACHE.put(address, topic);
+ }
+ return topic;
+ }
+
+ public static TopicImpl valueOf(String address)
+ {
+ return address == null ? null : createTopic(address);
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java
index a2d2f34043..62c3783682 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Topic;
-
-public class TopicPublisherImpl extends MessageProducerImpl implements TopicPublisher
-{
- protected TopicPublisherImpl(final Destination destination, final SessionImpl session)
- throws JMSException
- {
- super(destination, session);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.TopicPublisher;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Topic;
+
+public class TopicPublisherImpl extends MessageProducerImpl implements TopicPublisher
+{
+ protected TopicPublisherImpl(final Destination destination, final SessionImpl session)
+ throws JMSException
+ {
+ super(destination, session);
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSessionImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSessionImpl.java
index 4bae1efaf1..44d0c7f78f 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSessionImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSessionImpl.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import org.apache.qpid.amqp_1_0.jms.TopicSession;
-
-import javax.jms.JMSException;
-import javax.jms.Topic;
-
-public class TopicSessionImpl extends SessionImpl implements TopicSession
-{
- protected TopicSessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode)
- throws JMSException
- {
- super(connection, acknowledgeMode);
- setTopicSession(true);
- }
-
- public TopicSubscriberImpl createSubscriber(final Topic topic) throws JMSException
- {
- return createSubscriber(topic,null, false);
- }
-
- public TopicSubscriberImpl createSubscriber(final Topic topic, final String selector, final boolean noLocal) throws JMSException
- {
-
- final TopicSubscriberImpl messageConsumer;
- synchronized(getClientSession().getEndpoint().getLock())
- {
- messageConsumer = new TopicSubscriberImpl((TopicImpl) topic, this, selector, noLocal);
- addConsumer(messageConsumer);
- }
- return messageConsumer;
- }
-
- public TopicPublisherImpl createPublisher(final Topic topic) throws JMSException
- {
- return null; //TODO
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import org.apache.qpid.amqp_1_0.jms.TopicSession;
+
+import javax.jms.JMSException;
+import javax.jms.Topic;
+
+public class TopicSessionImpl extends SessionImpl implements TopicSession
+{
+ protected TopicSessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode)
+ throws JMSException
+ {
+ super(connection, acknowledgeMode);
+ setTopicSession(true);
+ }
+
+ public TopicSubscriberImpl createSubscriber(final Topic topic) throws JMSException
+ {
+ return createSubscriber(topic,null, false);
+ }
+
+ public TopicSubscriberImpl createSubscriber(final Topic topic, final String selector, final boolean noLocal) throws JMSException
+ {
+
+ final TopicSubscriberImpl messageConsumer;
+ synchronized(getClientSession().getEndpoint().getLock())
+ {
+ messageConsumer = new TopicSubscriberImpl((TopicImpl) topic, this, selector, noLocal);
+ addConsumer(messageConsumer);
+ }
+ return messageConsumer;
+ }
+
+ public TopicPublisherImpl createPublisher(final Topic topic) throws JMSException
+ {
+ return null; //TODO
+ }
+}
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSubscriberImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSubscriberImpl.java
index 6dc8fc12b5..69e07f30a1 100644
--- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSubscriberImpl.java
+++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicSubscriberImpl.java
@@ -1,133 +1,133 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.amqp_1_0.jms.impl;
-
-import java.util.Map;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
-import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
-import org.apache.qpid.amqp_1_0.client.Receiver;
-import org.apache.qpid.amqp_1_0.jms.Topic;
-import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
-import org.apache.qpid.amqp_1_0.type.Symbol;
-import org.apache.qpid.amqp_1_0.type.messaging.Filter;
-import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
-import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
-
-public class TopicSubscriberImpl extends MessageConsumerImpl implements TopicSubscriber
-{
-
- TopicSubscriberImpl(String name,
- boolean durable,
- final Topic destination,
- final SessionImpl session,
- final String selector,
- final boolean noLocal)
- throws JMSException
- {
- super(destination, session, selector, noLocal, name, durable);
- setTopicSubscriber(true);
- }
-
- TopicSubscriberImpl(final Topic destination,
- final SessionImpl session,
- final String selector,
- final boolean noLocal)
- throws JMSException
- {
- super(destination, session, selector, noLocal);
- setTopicSubscriber(true);
- }
-
- public TopicImpl getTopic() throws JMSException
- {
- return (TopicImpl) getDestination();
- }
-
-
- protected Receiver createClientReceiver() throws JMSException
- {
- try
- {
- String address = getSession().toAddress(getDestination());
- Receiver receiver = getSession().getClientSession().createReceiver(address,
- StdDistMode.COPY, AcknowledgeMode.ALO,
- getLinkName(), isDurable(), getFilters(),
- null);
- String actualAddress = receiver.getAddress();
-
- @SuppressWarnings("unchecked")
- Map<Symbol, Filter> actualFilters = (Map<Symbol, Filter>) receiver.getFilter();
-
- if(!address.equals(actualAddress) || !filtersEqual(getFilters(), actualFilters))
- {
- receiver.close();
- if(isDurable())
- {
- receiver = getSession().getClientSession().createReceiver(address,
- StdDistMode.COPY, AcknowledgeMode.ALO,
- getLinkName(), false, getFilters(),
- null);
- receiver.close();
- }
- receiver = getSession().getClientSession().createReceiver(address,
- StdDistMode.COPY, AcknowledgeMode.ALO,
- getLinkName(), isDurable(), getFilters(),
- null);
- }
-
-
- return receiver;
- }
- catch (ConnectionErrorException e)
- {
- org.apache.qpid.amqp_1_0.type.transport.Error error = e.getRemoteError();
- if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
- {
- throw new InvalidSelectorException(e.getMessage());
- }
- else
- {
- throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
-
- }
-
- }
- }
-
- private boolean filtersEqual(Map<Symbol, Filter> filters, Map<Symbol, Filter> actualFilters)
- {
- if(filters == null || filters.isEmpty())
- {
- return actualFilters == null || actualFilters.isEmpty();
- }
- else
- {
- return actualFilters != null && filters.equals(actualFilters);
- }
-
- }
-
-
- protected void closeUnderlyingReceiver(Receiver receiver)
- {
- receiver.close();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.amqp_1_0.jms.impl;
+
+import java.util.Map;
+import javax.jms.InvalidSelectorException;
+import javax.jms.JMSException;
+import org.apache.qpid.amqp_1_0.client.AcknowledgeMode;
+import org.apache.qpid.amqp_1_0.client.ConnectionErrorException;
+import org.apache.qpid.amqp_1_0.client.Receiver;
+import org.apache.qpid.amqp_1_0.jms.Topic;
+import org.apache.qpid.amqp_1_0.jms.TopicSubscriber;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.messaging.Filter;
+import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
+import org.apache.qpid.amqp_1_0.type.transport.AmqpError;
+
+public class TopicSubscriberImpl extends MessageConsumerImpl implements TopicSubscriber
+{
+
+ TopicSubscriberImpl(String name,
+ boolean durable,
+ final Topic destination,
+ final SessionImpl session,
+ final String selector,
+ final boolean noLocal)
+ throws JMSException
+ {
+ super(destination, session, selector, noLocal, name, durable);
+ setTopicSubscriber(true);
+ }
+
+ TopicSubscriberImpl(final Topic destination,
+ final SessionImpl session,
+ final String selector,
+ final boolean noLocal)
+ throws JMSException
+ {
+ super(destination, session, selector, noLocal);
+ setTopicSubscriber(true);
+ }
+
+ public TopicImpl getTopic() throws JMSException
+ {
+ return (TopicImpl) getDestination();
+ }
+
+
+ protected Receiver createClientReceiver() throws JMSException
+ {
+ try
+ {
+ String address = getSession().toAddress(getDestination());
+ Receiver receiver = getSession().getClientSession().createReceiver(address,
+ StdDistMode.COPY, AcknowledgeMode.ALO,
+ getLinkName(), isDurable(), getFilters(),
+ null);
+ String actualAddress = receiver.getAddress();
+
+ @SuppressWarnings("unchecked")
+ Map<Symbol, Filter> actualFilters = (Map<Symbol, Filter>) receiver.getFilter();
+
+ if(!address.equals(actualAddress) || !filtersEqual(getFilters(), actualFilters))
+ {
+ receiver.close();
+ if(isDurable())
+ {
+ receiver = getSession().getClientSession().createReceiver(address,
+ StdDistMode.COPY, AcknowledgeMode.ALO,
+ getLinkName(), false, getFilters(),
+ null);
+ receiver.close();
+ }
+ receiver = getSession().getClientSession().createReceiver(address,
+ StdDistMode.COPY, AcknowledgeMode.ALO,
+ getLinkName(), isDurable(), getFilters(),
+ null);
+ }
+
+
+ return receiver;
+ }
+ catch (ConnectionErrorException e)
+ {
+ org.apache.qpid.amqp_1_0.type.transport.Error error = e.getRemoteError();
+ if(AmqpError.INVALID_FIELD.equals(error.getCondition()))
+ {
+ throw new InvalidSelectorException(e.getMessage());
+ }
+ else
+ {
+ throw new JMSException(e.getMessage(), error.getCondition().getValue().toString());
+
+ }
+
+ }
+ }
+
+ private boolean filtersEqual(Map<Symbol, Filter> filters, Map<Symbol, Filter> actualFilters)
+ {
+ if(filters == null || filters.isEmpty())
+ {
+ return actualFilters == null || actualFilters.isEmpty();
+ }
+ else
+ {
+ return actualFilters != null && filters.equals(actualFilters);
+ }
+
+ }
+
+
+ protected void closeUnderlyingReceiver(Receiver receiver)
+ {
+ receiver.close();
+ }
+}
diff --git a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Demo.java b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Demo.java
index 5e77b7097c..09d19f4394 100644
--- a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Demo.java
+++ b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Demo.java
@@ -1,431 +1,430 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.client;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Options;
-import org.apache.qpid.amqp_1_0.type.AmqpErrorException;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
-import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-public class Demo extends Util
-{
- private static final String USAGE_STRING = "demo [options] <vendor> [<content> ...]\n\nOptions:";
- private static final String OPCODE = "opcode";
- private static final String ACTION = "action";
- private static final String MESSAGE_ID = "message-id";
- private static final String VENDOR = "vendor";
- private static final String LOG = "log";
- private static final String RECEIVED = "received";
- private static final String TEST = "test";
- private static final String APACHE = "apache";
- private static final String SENT = "sent";
- private static final String LINK_REF = "link-ref";
- private static final String HOST = "host";
- private static final String PORT = "port";
- private static final String SASL_USER = "sasl-user";
- private static final String SASL_PASSWORD = "sasl-password";
- private static final String ROLE = "role";
- private static final String ADDRESS = "address";
- private static final String SENDER = "sender";
- private static final String SEND_MESSAGE = "send-message";
- private static final String ANNOUNCE = "announce";
- private static final String MESSAGE_VENDOR = "message-vendor";
- private static final String CREATE_LINK = "create-link";
-
- public static void main(String[] args)
- {
- new Demo(args).run();
- }
-
- public Demo(String[] args)
- {
- super(args);
- }
-
- @Override
- protected boolean hasLinkDurableOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasLinkNameOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasResponseQueueOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasSizeOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasBlockOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasStdInOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasTxnOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasModeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasCountOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasWindowSizeOption()
- {
- return false;
- }
-
- public void run()
- {
-
- try
- {
-
- final String vendor = getArgs()[0];
- final String queue = "control";
-
- String message = "";
-
- Connection conn = newConnection();
- Session session = conn.createSession();
-
-
- Receiver responseReceiver;
-
- responseReceiver = session.createTemporaryQueueReceiver();
-
-
-
-
- responseReceiver.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
-
-
-
- Sender s = session.createSender(queue, getWindowSize(), getMode());
-
-
- Properties properties = new Properties();
- properties.setMessageId(java.util.UUID.randomUUID());
- properties.setReplyTo(responseReceiver.getAddress());
-
- HashMap appPropMap = new HashMap();
- ApplicationProperties appProperties = new ApplicationProperties(appPropMap);
-
- appPropMap.put(OPCODE, ANNOUNCE);
- appPropMap.put(VENDOR, vendor);
- appPropMap.put(ADDRESS,responseReceiver.getAddress());
-
- AmqpValue amqpValue = new AmqpValue(message);
- Section[] sections = { properties, appProperties, amqpValue};
- final Message message1 = new Message(Arrays.asList(sections));
-
- try
- {
- s.send(message1);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- Map<Object, Sender> sendingLinks = new HashMap<Object, Sender>();
- Map<Object, Receiver> receivingLinks = new HashMap<Object, Receiver>();
-
-
- boolean done = false;
-
- while(!done)
- {
- boolean wait = true;
- Message m = responseReceiver.receive(false);
- if(m != null)
- {
- List<Section> payload = m.getPayload();
- wait = false;
- ApplicationProperties props = m.getApplicationProperties();
- Map map = props.getValue();
- String op = (String) map.get(OPCODE);
- if("reset".equals(op))
- {
- for(Sender sender : sendingLinks.values())
- {
- try
- {
- sender.close();
- Session session1 = sender.getSession();
- session1.close();
- session1.getConnection().close();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- for(Receiver receiver : receivingLinks.values())
- {
- try
- {
- receiver.close();
- receiver.getSession().close();
- receiver.getSession().getConnection().close();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- sendingLinks.clear();
- receivingLinks.clear();
- }
- else if(CREATE_LINK.equals(op))
- {
- Object linkRef = map.get(LINK_REF);
- String host = (String) map.get(HOST);
- Object o = map.get(PORT);
- int port = Integer.parseInt(String.valueOf(o));
- String user = (String) map.get(SASL_USER);
- String password = (String) map.get(SASL_PASSWORD);
- String role = (String) map.get(ROLE);
- String address = (String) map.get(ADDRESS);
- System.err.println("Host: " + host + "\tPort: " + port + "\t user: " + user +"\t password: " + password);
- try{
-
-
- Connection conn2 = new Connection(host, port, user, password, host);
- Session session2 = conn2.createSession();
- if(sendingLinks.containsKey(linkRef))
- {
- try
- {
- sendingLinks.remove(linkRef).close();
- }
- catch (Exception e)
- {
-
- }
- }
- if(receivingLinks.containsKey(linkRef))
- {
- try
- {
- receivingLinks.remove(linkRef).close();
- }
- catch (Exception e)
- {
-
- }
- }
- if(SENDER.equals(role))
- {
-
- System.err.println("%%% Creating sender (" + linkRef + ")");
- Sender sender = session2.createSender(address);
- sendingLinks.put(linkRef, sender);
- }
- else
- {
-
- System.err.println("%%% Creating receiver (" + linkRef + ")");
- Receiver receiver2 = session2.createReceiver(address);
- receiver2.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
-
- receivingLinks.put(linkRef, receiver2);
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- else if(SEND_MESSAGE.equals(op))
- {
- Sender sender = sendingLinks.get(map.get(LINK_REF));
- Properties m2props = new Properties();
- Object messageId = map.get(MESSAGE_ID);
- m2props.setMessageId(messageId);
- Map m2propmap = new HashMap();
- m2propmap.put(OPCODE, TEST);
- m2propmap.put(VENDOR, vendor);
- ApplicationProperties m2appProps = new ApplicationProperties(m2propmap);
- Message m2 = new Message(Arrays.asList(m2props, m2appProps, new AmqpValue("AMQP-"+messageId)));
- try
- {
- sender.send(m2);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- Map m3propmap = new HashMap();
- m3propmap.put(OPCODE, LOG);
- m3propmap.put(ACTION, SENT);
- m3propmap.put(MESSAGE_ID, messageId);
- m3propmap.put(VENDOR, vendor);
- m3propmap.put(MESSAGE_VENDOR, vendor);
-
-
- Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
- new AmqpValue("AMQP-"+messageId)));
- try
- {
- s.send(m3);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- responseReceiver.acknowledge(m);
- }
- else
- {
- for(Map.Entry<Object, Receiver> entry : receivingLinks.entrySet())
- {
- m = entry.getValue().receive(false);
- if(m != null)
- {
- wait = false;
-
- System.err.println("%%% Received message from " + entry.getKey());
-
- Properties mp = m.getProperties();
- ApplicationProperties ap = m.getApplicationProperties();
-
- Map m3propmap = new HashMap();
- m3propmap.put(OPCODE, LOG);
- m3propmap.put(ACTION, RECEIVED);
- m3propmap.put(MESSAGE_ID, mp.getMessageId());
- m3propmap.put(VENDOR, vendor);
- m3propmap.put(MESSAGE_VENDOR, ap.getValue().get(VENDOR));
-
- Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
- new AmqpValue("AMQP-"+mp.getMessageId())));
- try
- {
- s.send(m3);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- entry.getValue().acknowledge(m);
- }
-
- }
- }
-
- if(wait)
- {
- try
- {
- Thread.sleep(500l);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //TODO.
- }
- }
-
- }
-
-
-
-
-
-
-
-
-
- s.close();
- session.close();
- conn.close();
-
- }
- catch (ConnectionException e)
- {
- e.printStackTrace(); //TODO.
- }
- catch (Sender.SenderClosingException e)
- {
- e.printStackTrace(); //TODO.
- }
- catch (Sender.SenderCreationException e)
- {
- e.printStackTrace(); //TODO.
- }
- catch (AmqpErrorException e)
- {
- e.printStackTrace(); //TODO.
- }
-
- }
-
- protected boolean hasSingleLinkPerConnectionMode()
- {
- return false;
- }
-
- protected void printUsage(Options options)
- {
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp(USAGE_STRING, options );
- }
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.client;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Options;
+import org.apache.qpid.amqp_1_0.type.AmqpErrorException;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
+import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+public class Demo extends Util
+{
+ private static final String USAGE_STRING = "demo [options] <vendor> [<content> ...]\n\nOptions:";
+ private static final String OPCODE = "opcode";
+ private static final String ACTION = "action";
+ private static final String MESSAGE_ID = "message-id";
+ private static final String VENDOR = "vendor";
+ private static final String LOG = "log";
+ private static final String RECEIVED = "received";
+ private static final String TEST = "test";
+ private static final String APACHE = "apache";
+ private static final String SENT = "sent";
+ private static final String LINK_REF = "link-ref";
+ private static final String HOST = "host";
+ private static final String PORT = "port";
+ private static final String SASL_USER = "sasl-user";
+ private static final String SASL_PASSWORD = "sasl-password";
+ private static final String ROLE = "role";
+ private static final String ADDRESS = "address";
+ private static final String SENDER = "sender";
+ private static final String SEND_MESSAGE = "send-message";
+ private static final String ANNOUNCE = "announce";
+ private static final String MESSAGE_VENDOR = "message-vendor";
+ private static final String CREATE_LINK = "create-link";
+
+ public static void main(String[] args)
+ {
+ new Demo(args).run();
+ }
+
+ public Demo(String[] args)
+ {
+ super(args);
+ }
+
+ @Override
+ protected boolean hasLinkDurableOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasLinkNameOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasResponseQueueOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasSizeOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasBlockOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasStdInOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasTxnOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasModeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasCountOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasWindowSizeOption()
+ {
+ return false;
+ }
+
+ public void run()
+ {
+
+ try
+ {
+
+ final String vendor = getArgs()[0];
+ final String queue = "control";
+
+ String message = "";
+
+ Connection conn = newConnection();
+ Session session = conn.createSession();
+
+
+ Receiver responseReceiver;
+
+ responseReceiver = session.createTemporaryQueueReceiver();
+
+
+
+
+ responseReceiver.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
+
+
+ Sender s = session.createSender(queue, getWindowSize(), getMode(), null);
+
+
+ Properties properties = new Properties();
+ properties.setMessageId(java.util.UUID.randomUUID());
+ properties.setReplyTo(responseReceiver.getAddress());
+
+ HashMap appPropMap = new HashMap();
+ ApplicationProperties appProperties = new ApplicationProperties(appPropMap);
+
+ appPropMap.put(OPCODE, ANNOUNCE);
+ appPropMap.put(VENDOR, vendor);
+ appPropMap.put(ADDRESS,responseReceiver.getAddress());
+
+ AmqpValue amqpValue = new AmqpValue(message);
+ Section[] sections = { properties, appProperties, amqpValue};
+ final Message message1 = new Message(Arrays.asList(sections));
+
+ try
+ {
+ s.send(message1);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ Map<Object, Sender> sendingLinks = new HashMap<Object, Sender>();
+ Map<Object, Receiver> receivingLinks = new HashMap<Object, Receiver>();
+
+
+ boolean done = false;
+
+ while(!done)
+ {
+ boolean wait = true;
+ Message m = responseReceiver.receive(false);
+ if(m != null)
+ {
+ List<Section> payload = m.getPayload();
+ wait = false;
+ ApplicationProperties props = m.getApplicationProperties();
+ Map map = props.getValue();
+ String op = (String) map.get(OPCODE);
+ if("reset".equals(op))
+ {
+ for(Sender sender : sendingLinks.values())
+ {
+ try
+ {
+ sender.close();
+ Session session1 = sender.getSession();
+ session1.close();
+ session1.getConnection().close();
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ for(Receiver receiver : receivingLinks.values())
+ {
+ try
+ {
+ receiver.close();
+ receiver.getSession().close();
+ receiver.getSession().getConnection().close();
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ sendingLinks.clear();
+ receivingLinks.clear();
+ }
+ else if(CREATE_LINK.equals(op))
+ {
+ Object linkRef = map.get(LINK_REF);
+ String host = (String) map.get(HOST);
+ Object o = map.get(PORT);
+ int port = Integer.parseInt(String.valueOf(o));
+ String user = (String) map.get(SASL_USER);
+ String password = (String) map.get(SASL_PASSWORD);
+ String role = (String) map.get(ROLE);
+ String address = (String) map.get(ADDRESS);
+ System.err.println("Host: " + host + "\tPort: " + port + "\t user: " + user +"\t password: " + password);
+ try{
+
+
+ Connection conn2 = new Connection(host, port, user, password, host);
+ Session session2 = conn2.createSession();
+ if(sendingLinks.containsKey(linkRef))
+ {
+ try
+ {
+ sendingLinks.remove(linkRef).close();
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+ if(receivingLinks.containsKey(linkRef))
+ {
+ try
+ {
+ receivingLinks.remove(linkRef).close();
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+ if(SENDER.equals(role))
+ {
+
+ System.err.println("%%% Creating sender (" + linkRef + ")");
+ Sender sender = session2.createSender(address);
+ sendingLinks.put(linkRef, sender);
+ }
+ else
+ {
+
+ System.err.println("%%% Creating receiver (" + linkRef + ")");
+ Receiver receiver2 = session2.createReceiver(address);
+ receiver2.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
+
+ receivingLinks.put(linkRef, receiver2);
+ }
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else if(SEND_MESSAGE.equals(op))
+ {
+ Sender sender = sendingLinks.get(map.get(LINK_REF));
+ Properties m2props = new Properties();
+ Object messageId = map.get(MESSAGE_ID);
+ m2props.setMessageId(messageId);
+ Map m2propmap = new HashMap();
+ m2propmap.put(OPCODE, TEST);
+ m2propmap.put(VENDOR, vendor);
+ ApplicationProperties m2appProps = new ApplicationProperties(m2propmap);
+ Message m2 = new Message(Arrays.asList(m2props, m2appProps, new AmqpValue("AMQP-"+messageId)));
+ try
+ {
+ sender.send(m2);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ Map m3propmap = new HashMap();
+ m3propmap.put(OPCODE, LOG);
+ m3propmap.put(ACTION, SENT);
+ m3propmap.put(MESSAGE_ID, messageId);
+ m3propmap.put(VENDOR, vendor);
+ m3propmap.put(MESSAGE_VENDOR, vendor);
+
+
+ Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
+ new AmqpValue("AMQP-"+messageId)));
+ try
+ {
+ s.send(m3);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ responseReceiver.acknowledge(m);
+ }
+ else
+ {
+ for(Map.Entry<Object, Receiver> entry : receivingLinks.entrySet())
+ {
+ m = entry.getValue().receive(false);
+ if(m != null)
+ {
+ wait = false;
+
+ System.err.println("%%% Received message from " + entry.getKey());
+
+ Properties mp = m.getProperties();
+ ApplicationProperties ap = m.getApplicationProperties();
+
+ Map m3propmap = new HashMap();
+ m3propmap.put(OPCODE, LOG);
+ m3propmap.put(ACTION, RECEIVED);
+ m3propmap.put(MESSAGE_ID, mp.getMessageId());
+ m3propmap.put(VENDOR, vendor);
+ m3propmap.put(MESSAGE_VENDOR, ap.getValue().get(VENDOR));
+
+ Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
+ new AmqpValue("AMQP-"+mp.getMessageId())));
+ try
+ {
+ s.send(m3);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ entry.getValue().acknowledge(m);
+ }
+
+ }
+ }
+
+ if(wait)
+ {
+ try
+ {
+ Thread.sleep(500l);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+ }
+
+ }
+
+
+
+
+
+
+
+
+
+ s.close();
+ session.close();
+ conn.close();
+
+ }
+ catch (ConnectionException e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+ catch (Sender.SenderClosingException e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+ catch (Sender.SenderCreationException e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+ catch (AmqpErrorException e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+
+ }
+
+ protected boolean hasSingleLinkPerConnectionMode()
+ {
+ return false;
+ }
+
+ protected void printUsage(Options options)
+ {
+ HelpFormatter formatter = new HelpFormatter();
+ formatter.printHelp(USAGE_STRING, options );
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Request.java b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Request.java
index dbe273182f..bce7bfcd9a 100644
--- a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Request.java
+++ b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Request.java
@@ -1,236 +1,234 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.client;
-
-import org.apache.qpid.amqp_1_0.type.AmqpErrorException;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.qpid.amqp_1_0.type.UnsignedLong;
-import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
-import org.apache.qpid.amqp_1_0.type.messaging.Header;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-import org.apache.commons.cli.*;
-
-import java.util.Arrays;
-
-public class Request extends Util
-{
- private static final String USAGE_STRING = "request [options] <address> [<content> ...]\n\nOptions:";
-
- public static void main(String[] args)
- {
- new Request(args).run();
- }
-
- public Request(String[] args)
- {
- super(args);
- }
-
- @Override
- protected boolean hasLinkDurableOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasLinkNameOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasResponseQueueOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasSizeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasBlockOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasStdInOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasTxnOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasModeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasCountOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasWindowSizeOption()
- {
- return true;
- }
-
- public void run()
- {
-
- try
- {
-
-
- final String queue = getArgs()[0];
-
- String message = "";
-
- Connection conn = newConnection();
- Session session = conn.createSession();
-
- Connection conn2;
- Session session2;
- Receiver responseReceiver;
-
- if(isUseMultipleConnections())
- {
- conn2 = newConnection();
- session2 = conn2.createSession();
- responseReceiver = session2.createTemporaryQueueReceiver();
- }
- else
- {
- conn2 = null;
- session2 = null;
- responseReceiver = session.createTemporaryQueueReceiver();
- }
-
-
-
-
- responseReceiver.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
-
-
-
- Sender s = session.createSender(queue, getWindowSize(), getMode());
-
- Transaction txn = null;
-
- if(useTran())
- {
- txn = session.createSessionLocalTransaction();
- }
-
- int received = 0;
-
- if(getArgs().length >= 2)
- {
- message = getArgs()[1];
- if(message.length() < getMessageSize())
- {
- StringBuilder builder = new StringBuilder(getMessageSize());
- builder.append(message);
- for(int x = message.length(); x < getMessageSize(); x++)
- {
- builder.append('.');
- }
- message = builder.toString();
- }
-
- for(int i = 0; i < getCount(); i++)
- {
- Properties properties = new Properties();
- properties.setMessageId(UnsignedLong.valueOf(i));
- properties.setReplyTo(responseReceiver.getAddress());
-
- AmqpValue amqpValue = new AmqpValue(message);
- Section[] sections = { new Header() , properties, amqpValue};
- final Message message1 = new Message(Arrays.asList(sections));
-
- s.send(message1, txn);
-
- Message responseMessage = responseReceiver.receive(false);
- if(responseMessage != null)
- {
- responseReceiver.acknowledge(responseMessage.getDeliveryTag(),txn);
- received++;
- }
- }
- }
-
- if(txn != null)
- {
- txn.commit();
- }
-
-
- while(received < getCount())
- {
- Message responseMessage = responseReceiver.receive();
- responseReceiver.acknowledge(responseMessage.getDeliveryTag());
- received++;
- }
-
-
-
-
- s.close();
- session.close();
- conn.close();
-
- if(session2 != null)
- {
- session2.close();
- conn2.close();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace(); //TODO.
- }
- }
-
- protected boolean hasSingleLinkPerConnectionMode()
- {
- return true;
- }
-
- protected void printUsage(Options options)
- {
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp(USAGE_STRING, options );
- }
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.client;
+
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
+import org.apache.qpid.amqp_1_0.type.messaging.Header;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+import org.apache.commons.cli.*;
+
+import java.util.Arrays;
+
+public class Request extends Util
+{
+ private static final String USAGE_STRING = "request [options] <address> [<content> ...]\n\nOptions:";
+
+ public static void main(String[] args)
+ {
+ new Request(args).run();
+ }
+
+ public Request(String[] args)
+ {
+ super(args);
+ }
+
+ @Override
+ protected boolean hasLinkDurableOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasLinkNameOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasResponseQueueOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasSizeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasBlockOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasStdInOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasTxnOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasModeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasCountOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasWindowSizeOption()
+ {
+ return true;
+ }
+
+ public void run()
+ {
+
+ try
+ {
+
+
+ final String queue = getArgs()[0];
+
+ String message = "";
+
+ Connection conn = newConnection();
+ Session session = conn.createSession();
+
+ Connection conn2;
+ Session session2;
+ Receiver responseReceiver;
+
+ if(isUseMultipleConnections())
+ {
+ conn2 = newConnection();
+ session2 = conn2.createSession();
+ responseReceiver = session2.createTemporaryQueueReceiver();
+ }
+ else
+ {
+ conn2 = null;
+ session2 = null;
+ responseReceiver = session.createTemporaryQueueReceiver();
+ }
+
+
+
+
+ responseReceiver.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);
+
+
+ Sender s = session.createSender(queue, getWindowSize(), getMode(), null);
+
+ Transaction txn = null;
+
+ if(useTran())
+ {
+ txn = session.createSessionLocalTransaction();
+ }
+
+ int received = 0;
+
+ if(getArgs().length >= 2)
+ {
+ message = getArgs()[1];
+ if(message.length() < getMessageSize())
+ {
+ StringBuilder builder = new StringBuilder(getMessageSize());
+ builder.append(message);
+ for(int x = message.length(); x < getMessageSize(); x++)
+ {
+ builder.append('.');
+ }
+ message = builder.toString();
+ }
+
+ for(int i = 0; i < getCount(); i++)
+ {
+ Properties properties = new Properties();
+ properties.setMessageId(UnsignedLong.valueOf(i));
+ properties.setReplyTo(responseReceiver.getAddress());
+
+ AmqpValue amqpValue = new AmqpValue(message);
+ Section[] sections = { new Header() , properties, amqpValue};
+ final Message message1 = new Message(Arrays.asList(sections));
+
+ s.send(message1, txn);
+
+ Message responseMessage = responseReceiver.receive(false);
+ if(responseMessage != null)
+ {
+ responseReceiver.acknowledge(responseMessage.getDeliveryTag(),txn);
+ received++;
+ }
+ }
+ }
+
+ if(txn != null)
+ {
+ txn.commit();
+ }
+
+
+ while(received < getCount())
+ {
+ Message responseMessage = responseReceiver.receive();
+ responseReceiver.acknowledge(responseMessage.getDeliveryTag());
+ received++;
+ }
+
+
+
+
+ s.close();
+ session.close();
+ conn.close();
+
+ if(session2 != null)
+ {
+ session2.close();
+ conn2.close();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+ }
+
+ protected boolean hasSingleLinkPerConnectionMode()
+ {
+ return true;
+ }
+
+ protected void printUsage(Options options)
+ {
+ HelpFormatter formatter = new HelpFormatter();
+ formatter.printHelp(USAGE_STRING, options );
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Send.java b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Send.java
index b4ae16ab3f..36aadc7851 100644
--- a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Send.java
+++ b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Send.java
@@ -1,235 +1,235 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.amqp_1_0.client;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.util.Arrays;
-
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.UnsignedLong;
-import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
-import org.apache.qpid.amqp_1_0.type.messaging.Data;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-import org.apache.commons.cli.*;
-
-public class Send extends Util
-{
- private static final String USAGE_STRING = "send [options] <address> [<content> ...]\n\nOptions:";
- private static final char[] HEX = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
-
-
- public static void main(String[] args) throws Sender.SenderCreationException, Sender.SenderClosingException, ConnectionException
- {
- new Send(args).run();
- }
-
-
- public Send(final String[] args)
- {
- super(args);
- }
-
- @Override
- protected boolean hasLinkDurableOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasLinkNameOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasResponseQueueOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasSizeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasBlockOption()
- {
- return false;
- }
-
- @Override
- protected boolean hasStdInOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasTxnOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasModeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasCountOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasWindowSizeOption()
- {
- return true;
- }
-
- @Override
- protected boolean hasSubjectOption()
- {
- return true;
- }
-
- public void run()
- {
-
- final String queue = getArgs()[0];
-
- String message = "";
-
- try
- {
- Connection conn = newConnection();
-
- Session session = conn.createSession();
-
-
- Sender s = session.createSender(queue, getWindowSize(), getMode(), getLinkName());
-
- Transaction txn = null;
-
- if(useTran())
- {
- txn = session.createSessionLocalTransaction();
- }
-
- if(!useStdIn())
- {
- if(getArgs().length <= 2)
- {
- if(getArgs().length == 2)
- {
- message = getArgs()[1];
- }
- for(int i = 0; i < getCount(); i++)
- {
-
- Properties properties = new Properties();
- properties.setMessageId(UnsignedLong.valueOf(i));
- if(getSubject() != null)
- {
- properties.setSubject(getSubject());
- }
- Section bodySection;
- byte[] bytes = (message + " " + i).getBytes();
- if(bytes.length < getMessageSize())
- {
- byte[] origBytes = bytes;
- bytes = new byte[getMessageSize()];
- System.arraycopy(origBytes,0,bytes,0,origBytes.length);
- for(int x = origBytes.length; x < bytes.length; x++)
- {
- bytes[x] = (byte) '.';
- }
- bodySection = new Data(new Binary(bytes));
- }
- else
- {
- bodySection = new AmqpValue(message + " " + i);
- }
-
- Section[] sections = {properties, bodySection};
- final Message message1 = new Message(Arrays.asList(sections));
-
- s.send(message1, txn);
- }
- }
- else
- {
- for(int i = 1; i < getArgs().length; i++)
- {
- s.send(new Message(getArgs()[i]), txn);
- }
-
- }
- }
- else
- {
- LineNumberReader buf = new LineNumberReader(new InputStreamReader(System.in));
-
-
- try
- {
- while((message = buf.readLine()) != null)
- {
- s.send(new Message(message), txn);
- }
- }
- catch (IOException e)
- {
- // TODO
- e.printStackTrace();
- }
- }
-
- if(txn != null)
- {
- txn.commit();
- }
-
- s.close();
-
- session.close();
- conn.close();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //TODO.
- }
-
- }
-
- protected void printUsage(Options options)
- {
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp(USAGE_STRING, options );
- }
-
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.amqp_1_0.client;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.util.Arrays;
+
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
+import org.apache.qpid.amqp_1_0.type.messaging.Data;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+import org.apache.commons.cli.*;
+
+public class Send extends Util
+{
+ private static final String USAGE_STRING = "send [options] <address> [<content> ...]\n\nOptions:";
+ private static final char[] HEX = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
+
+
+ public static void main(String[] args) throws Sender.SenderCreationException, Sender.SenderClosingException, ConnectionException
+ {
+ new Send(args).run();
+ }
+
+
+ public Send(final String[] args)
+ {
+ super(args);
+ }
+
+ @Override
+ protected boolean hasLinkDurableOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasLinkNameOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasResponseQueueOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasSizeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasBlockOption()
+ {
+ return false;
+ }
+
+ @Override
+ protected boolean hasStdInOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasTxnOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasModeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasCountOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasWindowSizeOption()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean hasSubjectOption()
+ {
+ return true;
+ }
+
+ public void run()
+ {
+
+ final String queue = getArgs()[0];
+
+ String message = "";
+
+ try
+ {
+ Connection conn = newConnection();
+
+ Session session = conn.createSession();
+
+
+ Sender s = session.createSender(queue, getWindowSize(), getMode(), getLinkName());
+
+ Transaction txn = null;
+
+ if(useTran())
+ {
+ txn = session.createSessionLocalTransaction();
+ }
+
+ if(!useStdIn())
+ {
+ if(getArgs().length <= 2)
+ {
+ if(getArgs().length == 2)
+ {
+ message = getArgs()[1];
+ }
+ for(int i = 0; i < getCount(); i++)
+ {
+
+ Properties properties = new Properties();
+ properties.setMessageId(UnsignedLong.valueOf(i));
+ if(getSubject() != null)
+ {
+ properties.setSubject(getSubject());
+ }
+ Section bodySection;
+ byte[] bytes = (message + " " + i).getBytes();
+ if(bytes.length < getMessageSize())
+ {
+ byte[] origBytes = bytes;
+ bytes = new byte[getMessageSize()];
+ System.arraycopy(origBytes,0,bytes,0,origBytes.length);
+ for(int x = origBytes.length; x < bytes.length; x++)
+ {
+ bytes[x] = (byte) '.';
+ }
+ bodySection = new Data(new Binary(bytes));
+ }
+ else
+ {
+ bodySection = new AmqpValue(message + " " + i);
+ }
+
+ Section[] sections = {properties, bodySection};
+ final Message message1 = new Message(Arrays.asList(sections));
+
+ s.send(message1, txn);
+ }
+ }
+ else
+ {
+ for(int i = 1; i < getArgs().length; i++)
+ {
+ s.send(new Message(getArgs()[i]), txn);
+ }
+
+ }
+ }
+ else
+ {
+ LineNumberReader buf = new LineNumberReader(new InputStreamReader(System.in));
+
+
+ try
+ {
+ while((message = buf.readLine()) != null)
+ {
+ s.send(new Message(message), txn);
+ }
+ }
+ catch (IOException e)
+ {
+ // TODO
+ e.printStackTrace();
+ }
+ }
+
+ if(txn != null)
+ {
+ txn.commit();
+ }
+
+ s.close();
+
+ session.close();
+ conn.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //TODO.
+ }
+
+ }
+
+ protected void printUsage(Options options)
+ {
+ HelpFormatter formatter = new HelpFormatter();
+ formatter.printHelp(USAGE_STRING, options );
+ }
+
+}
diff --git a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java
index 33af4729d9..4421c44a61 100644
--- a/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java
+++ b/qpid/java/amqp-1-0-client/example/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java
@@ -502,9 +502,11 @@ public abstract class Util
{
Container container = getContainerName() == null ? new Container() : new Container(getContainerName());
return getUsername() == null ? new Connection(getHost(), getPort(), null, null, _frameSize, container,
- _remoteHost == null ? getHost() : _remoteHost, _useSSL)
+ _remoteHost == null ? getHost() : _remoteHost, _useSSL,
+ 0)
: new Connection(getHost(), getPort(), getUsername(), getPassword(), _frameSize,
- container, _remoteHost == null ? getHost() : _remoteHost, _useSSL);
+ container, _remoteHost == null ? getHost() : _remoteHost, _useSSL,
+ 0);
}
public String getContainerName()
diff --git a/qpid/java/amqp-1-0-client/pom.xml b/qpid/java/amqp-1-0-client/pom.xml
new file mode 100644
index 0000000000..13430c0c22
--- /dev/null
+++ b/qpid/java/amqp-1-0-client/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-amqp-1-0-client</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java
index 4c5ffeb177..0d634c0f1a 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java
@@ -1,412 +1,470 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.amqp_1_0.client;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.security.Principal;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.net.ssl.SSLSocketFactory;
-import org.apache.qpid.amqp_1_0.framing.ConnectionHandler;
-import org.apache.qpid.amqp_1_0.transport.AMQPTransport;
-import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
-import org.apache.qpid.amqp_1_0.transport.Container;
-import org.apache.qpid.amqp_1_0.transport.StateChangeListener;
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.FrameBody;
-import org.apache.qpid.amqp_1_0.type.SaslFrameBody;
-import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-
-public class Connection
-{
- private static final Logger RAW_LOGGER = Logger.getLogger("RAW");
- private static final int MAX_FRAME_SIZE = 65536;
-
- private String _address;
- private ConnectionEndpoint _conn;
- private int _sessionCount;
-
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password) throws ConnectionException
- {
- this(address, port, username, password, MAX_FRAME_SIZE);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password, String remoteHostname) throws ConnectionException
- {
- this(address, port, username, password, MAX_FRAME_SIZE,new Container(),remoteHostname);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final int maxFrameSize) throws ConnectionException
- {
- this(address,port,username,password,maxFrameSize,new Container());
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final Container container) throws ConnectionException
- {
- this(address,port,username,password,MAX_FRAME_SIZE,container);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final int maxFrameSize,
- final Container container) throws ConnectionException
- {
- this(address,port,username,password,maxFrameSize,container, null);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final int maxFrameSize,
- final Container container,
- final String remoteHostname) throws ConnectionException
- {
- this(address,port,username,password,maxFrameSize,container,remoteHostname,false);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final Container container,
- final boolean ssl) throws ConnectionException
- {
- this(address, port, username, password, MAX_FRAME_SIZE,container,null,ssl);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final String remoteHost,
- final boolean ssl) throws ConnectionException
- {
- this(address, port, username, password, MAX_FRAME_SIZE,new Container(),remoteHost,ssl);
- }
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final Container container,
- final String remoteHost,
- final boolean ssl) throws ConnectionException
- {
- this(address, port, username, password, MAX_FRAME_SIZE,container,remoteHost,ssl);
- }
-
-
- public Connection(final String address,
- final int port,
- final String username,
- final String password,
- final int maxFrameSize,
- final Container container,
- final String remoteHostname, boolean ssl) throws ConnectionException
- {
-
- _address = address;
-
- try
- {
- final Socket s;
- if(ssl)
- {
- s = SSLSocketFactory.getDefault().createSocket(address, port);
- }
- else
- {
- s = new Socket(address, port);
- }
-
-
- Principal principal = username == null ? null : new Principal()
- {
-
- public String getName()
- {
- return username;
- }
- };
- _conn = new ConnectionEndpoint(container, principal, password);
- _conn.setDesiredMaxFrameSize(UnsignedInteger.valueOf(maxFrameSize));
- _conn.setRemoteAddress(s.getRemoteSocketAddress());
- _conn.setRemoteHostname(remoteHostname);
-
-
-
- ConnectionHandler.FrameOutput<FrameBody> out = new ConnectionHandler.FrameOutput<FrameBody>(_conn);
-
-
- final OutputStream outputStream = s.getOutputStream();
-
- ConnectionHandler.BytesSource src;
-
- if(_conn.requiresSASL())
- {
- ConnectionHandler.FrameOutput<SaslFrameBody> saslOut = new ConnectionHandler.FrameOutput<SaslFrameBody>(_conn);
-
- src = new ConnectionHandler.SequentialBytesSource(new ConnectionHandler.HeaderBytesSource(_conn, (byte)'A',
- (byte)'M',
- (byte)'Q',
- (byte)'P',
- (byte)3,
- (byte)1,
- (byte)0,
- (byte)0),
- new ConnectionHandler.FrameToBytesSourceAdapter(saslOut,_conn.getDescribedTypeRegistry()),
- new ConnectionHandler.HeaderBytesSource(_conn, (byte)'A',
- (byte)'M',
- (byte)'Q',
- (byte)'P',
- (byte)0,
- (byte)1,
- (byte)0,
- (byte)0),
- new ConnectionHandler.FrameToBytesSourceAdapter(out,_conn.getDescribedTypeRegistry())
- );
-
- _conn.setSaslFrameOutput(saslOut);
- }
- else
- {
- src = new ConnectionHandler.SequentialBytesSource(new ConnectionHandler.HeaderBytesSource(_conn,(byte)'A',
- (byte)'M',
- (byte)'Q',
- (byte)'P',
- (byte)0,
- (byte)1,
- (byte)0,
- (byte)0),
- new ConnectionHandler.FrameToBytesSourceAdapter(out,_conn.getDescribedTypeRegistry())
- );
- }
-
-
- ConnectionHandler.BytesOutputHandler outputHandler = new ConnectionHandler.BytesOutputHandler(outputStream, src, _conn);
- Thread outputThread = new Thread(outputHandler);
- outputThread.setDaemon(true);
- outputThread.start();
- _conn.setFrameOutputHandler(out);
-
-
-
- final ConnectionHandler handler = new ConnectionHandler(_conn);
- final InputStream inputStream = s.getInputStream();
-
- Thread inputThread = new Thread(new Runnable()
- {
-
- public void run()
- {
- try
- {
- doRead(handler, inputStream);
- }
- finally
- {
- if(_conn.closedForInput() && _conn.closedForOutput())
- {
- try
- {
- s.close();
- }
- catch (IOException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
- }
- });
-
- inputThread.setDaemon(true);
- inputThread.start();
-
- _conn.open();
-
- }
- catch (IOException e)
- {
- throw new ConnectionException(e);
- }
-
-
- }
-
- private Connection(ConnectionEndpoint endpoint)
- {
- _conn = endpoint;
- }
-
-
- private void doRead(final AMQPTransport transport, final InputStream inputStream)
- {
- byte[] buf = new byte[2<<15];
- ByteBuffer bbuf = ByteBuffer.wrap(buf);
- final Object lock = new Object();
- transport.setInputStateChangeListener(new StateChangeListener(){
-
- public void onStateChange(final boolean active)
- {
- synchronized(lock)
- {
- lock.notifyAll();
- }
- }
- });
-
- try
- {
- int read;
- while((read = inputStream.read(buf)) != -1)
- {
- bbuf.position(0);
- bbuf.limit(read);
-
- while(bbuf.hasRemaining() && transport.isOpenForInput())
- {
- transport.processBytes(bbuf);
- }
-
-
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
-
- }
-
- public Session createSession() throws ConnectionException
- {
- checkNotClosed();
- Session session = new Session(this,String.valueOf(_sessionCount++));
- return session;
- }
-
- void checkNotClosed() throws ConnectionClosedException
- {
- if(getEndpoint().isClosed())
- {
- throw new ConnectionClosedException(getEndpoint().getRemoteError());
- }
- }
-
- public ConnectionEndpoint getEndpoint()
- {
- return _conn;
- }
-
- public void awaitOpen()
- {
- synchronized(getEndpoint().getLock())
- {
- while(!getEndpoint().isOpen() && !getEndpoint().isClosed())
- {
- try
- {
- getEndpoint().getLock().wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
-
- }
-
- private void doRead(final ConnectionHandler handler, final InputStream inputStream)
- {
- byte[] buf = new byte[2<<15];
-
-
- try
- {
- int read;
- boolean done = false;
- while(!handler.isDone() && (read = inputStream.read(buf)) != -1)
- {
- ByteBuffer bbuf = ByteBuffer.wrap(buf, 0, read);
- Binary b = new Binary(buf,0,read);
-
- if(RAW_LOGGER.isLoggable(Level.FINE))
- {
- RAW_LOGGER.fine("RECV [" + _conn.getRemoteAddress() + "] : " + b.toString());
- }
- while(bbuf.hasRemaining() && !handler.isDone())
- {
- handler.parse(bbuf);
- }
-
-
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- public void close()
- {
- _conn.close();
-
- synchronized (_conn.getLock())
- {
- while(!_conn.closedForInput())
- {
- try
- {
- _conn.getLock().wait();
- }
- catch (InterruptedException e)
- {
-
- }
- }
- }
- }
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.nio.ByteBuffer;
+import java.security.Principal;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.net.ssl.SSLSocketFactory;
+
+import org.apache.qpid.amqp_1_0.framing.SocketExceptionHandler;
+import org.apache.qpid.amqp_1_0.framing.ConnectionHandler;
+import org.apache.qpid.amqp_1_0.transport.AMQPTransport;
+import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
+import org.apache.qpid.amqp_1_0.transport.Container;
+import org.apache.qpid.amqp_1_0.transport.StateChangeListener;
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.FrameBody;
+import org.apache.qpid.amqp_1_0.type.SaslFrameBody;
+import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
+import org.apache.qpid.amqp_1_0.type.transport.ConnectionError;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class Connection implements SocketExceptionHandler
+{
+ private static final Logger RAW_LOGGER = Logger.getLogger("RAW");
+ private static final int MAX_FRAME_SIZE = 65536;
+
+ private String _address;
+ private ConnectionEndpoint _conn;
+ private int _sessionCount;
+ private Runnable _connectionErrorTask;
+ private Error _socketError;
+
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password) throws ConnectionException
+ {
+ this(address, port, username, password, MAX_FRAME_SIZE);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password, String remoteHostname) throws ConnectionException
+ {
+ this(address, port, username, password, MAX_FRAME_SIZE,new Container(),remoteHostname);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final int maxFrameSize) throws ConnectionException
+ {
+ this(address,port,username,password,maxFrameSize,new Container());
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final Container container) throws ConnectionException
+ {
+ this(address,port,username,password,MAX_FRAME_SIZE,container);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final int maxFrameSize,
+ final Container container) throws ConnectionException
+ {
+ this(address,port,username,password,maxFrameSize,container, null);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final int maxFrameSize,
+ final Container container,
+ final String remoteHostname) throws ConnectionException
+ {
+ this(address,port,username,password,maxFrameSize,container,remoteHostname,false,-1);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final Container container,
+ final boolean ssl) throws ConnectionException
+ {
+ this(address, port, username, password, MAX_FRAME_SIZE,container,null,ssl,-1);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final String remoteHost,
+ final boolean ssl) throws ConnectionException
+ {
+ this(address, port, username, password, MAX_FRAME_SIZE,new Container(),remoteHost,ssl,-1);
+ }
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final Container container,
+ final String remoteHost,
+ final boolean ssl,
+ final int channelMax) throws ConnectionException
+ {
+ this(address, port, username, password, MAX_FRAME_SIZE,container,remoteHost,ssl,
+ channelMax);
+ }
+
+
+ public Connection(final String address,
+ final int port,
+ final String username,
+ final String password,
+ final int maxFrameSize,
+ final Container container,
+ final String remoteHostname,
+ boolean ssl,
+ int channelMax) throws ConnectionException
+ {
+
+ _address = address;
+
+ try
+ {
+ final Socket s;
+ if(ssl)
+ {
+ s = SSLSocketFactory.getDefault().createSocket(address, port);
+ }
+ else
+ {
+ s = new Socket(address, port);
+ }
+
+
+ Principal principal = username == null ? null : new Principal()
+ {
+
+ public String getName()
+ {
+ return username;
+ }
+ };
+ _conn = new ConnectionEndpoint(container, principal, password);
+ if(channelMax >= 0)
+ {
+ _conn.setChannelMax((short)channelMax);
+ }
+ _conn.setDesiredMaxFrameSize(UnsignedInteger.valueOf(maxFrameSize));
+ _conn.setRemoteAddress(s.getRemoteSocketAddress());
+ _conn.setRemoteHostname(remoteHostname);
+
+
+
+ ConnectionHandler.FrameOutput<FrameBody> out = new ConnectionHandler.FrameOutput<FrameBody>(_conn);
+
+
+ final OutputStream outputStream = s.getOutputStream();
+
+ ConnectionHandler.BytesSource src;
+
+ if(_conn.requiresSASL())
+ {
+ ConnectionHandler.FrameOutput<SaslFrameBody> saslOut = new ConnectionHandler.FrameOutput<SaslFrameBody>(_conn);
+
+ src = new ConnectionHandler.SequentialBytesSource(new ConnectionHandler.HeaderBytesSource(_conn, (byte)'A',
+ (byte)'M',
+ (byte)'Q',
+ (byte)'P',
+ (byte)3,
+ (byte)1,
+ (byte)0,
+ (byte)0),
+ new ConnectionHandler.FrameToBytesSourceAdapter(saslOut,_conn.getDescribedTypeRegistry()),
+ new ConnectionHandler.HeaderBytesSource(_conn, (byte)'A',
+ (byte)'M',
+ (byte)'Q',
+ (byte)'P',
+ (byte)0,
+ (byte)1,
+ (byte)0,
+ (byte)0),
+ new ConnectionHandler.FrameToBytesSourceAdapter(out,_conn.getDescribedTypeRegistry())
+ );
+
+ _conn.setSaslFrameOutput(saslOut);
+ }
+ else
+ {
+ src = new ConnectionHandler.SequentialBytesSource(new ConnectionHandler.HeaderBytesSource(_conn,(byte)'A',
+ (byte)'M',
+ (byte)'Q',
+ (byte)'P',
+ (byte)0,
+ (byte)1,
+ (byte)0,
+ (byte)0),
+ new ConnectionHandler.FrameToBytesSourceAdapter(out,_conn.getDescribedTypeRegistry())
+ );
+ }
+
+
+ ConnectionHandler.BytesOutputHandler outputHandler = new ConnectionHandler.BytesOutputHandler(outputStream, src, _conn, this);
+ Thread outputThread = new Thread(outputHandler);
+ outputThread.setDaemon(true);
+ outputThread.start();
+ _conn.setFrameOutputHandler(out);
+
+
+
+ final ConnectionHandler handler = new ConnectionHandler(_conn);
+ final InputStream inputStream = s.getInputStream();
+
+ Thread inputThread = new Thread(new Runnable()
+ {
+
+ public void run()
+ {
+ try
+ {
+ doRead(handler, inputStream);
+ }
+ finally
+ {
+ if(_conn.closedForInput() && _conn.closedForOutput())
+ {
+ try
+ {
+ s.close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+ }
+ });
+
+ inputThread.setDaemon(true);
+ inputThread.start();
+
+ _conn.open();
+
+ }
+ catch (IOException e)
+ {
+ throw new ConnectionException(e);
+ }
+
+
+ }
+
+ private Connection(ConnectionEndpoint endpoint)
+ {
+ _conn = endpoint;
+ }
+
+
+ private void doRead(final AMQPTransport transport, final InputStream inputStream)
+ {
+ byte[] buf = new byte[2<<15];
+ ByteBuffer bbuf = ByteBuffer.wrap(buf);
+ final Object lock = new Object();
+ transport.setInputStateChangeListener(new StateChangeListener(){
+
+ public void onStateChange(final boolean active)
+ {
+ synchronized(lock)
+ {
+ lock.notifyAll();
+ }
+ }
+ });
+
+ try
+ {
+ int read;
+ while((read = inputStream.read(buf)) != -1)
+ {
+ bbuf.position(0);
+ bbuf.limit(read);
+
+ while(bbuf.hasRemaining() && transport.isOpenForInput())
+ {
+ transport.processBytes(bbuf);
+ }
+
+
+ }
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+
+ public Session createSession() throws ConnectionException
+ {
+ checkNotClosed();
+ Session session = new Session(this,String.valueOf(_sessionCount++));
+ return session;
+ }
+
+ void checkNotClosed() throws ConnectionClosedException
+ {
+ if(getEndpoint().isClosed())
+ {
+ throw new ConnectionClosedException(getEndpoint().getRemoteError());
+ }
+ }
+
+ public ConnectionEndpoint getEndpoint()
+ {
+ return _conn;
+ }
+
+ public void awaitOpen()
+ {
+ synchronized(getEndpoint().getLock())
+ {
+ while(!getEndpoint().isOpen() && !getEndpoint().isClosed())
+ {
+ try
+ {
+ getEndpoint().getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+
+ }
+
+ private void doRead(final ConnectionHandler handler, final InputStream inputStream)
+ {
+ byte[] buf = new byte[2<<15];
+
+
+ try
+ {
+ int read;
+ boolean done = false;
+ while(!handler.isDone() && (read = inputStream.read(buf)) != -1)
+ {
+ ByteBuffer bbuf = ByteBuffer.wrap(buf, 0, read);
+ Binary b = new Binary(buf,0,read);
+
+ if(RAW_LOGGER.isLoggable(Level.FINE))
+ {
+ RAW_LOGGER.fine("RECV [" + _conn.getRemoteAddress() + "] : " + b.toString());
+ }
+ while(bbuf.hasRemaining() && !handler.isDone())
+ {
+ handler.parse(bbuf);
+ }
+
+
+ }
+ if(!handler.isDone())
+ {
+ _conn.inputClosed();
+ if(_conn.getConnectionEventListener() != null)
+ {
+ _conn.getConnectionEventListener().closeReceived();
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ _conn.inputClosed();
+ e.printStackTrace();
+ }
+ }
+
+ public void close()
+ {
+ _conn.close();
+
+ synchronized (_conn.getLock())
+ {
+ while(!_conn.closedForInput())
+ {
+ try
+ {
+ _conn.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+ }
+ }
+ }
+
+ /**
+ * Set the connection error task that will be used as a callback for any socket read/write errors.
+ *
+ * @param connectionErrorTask connection error task
+ */
+ public void setConnectionErrorTask(Runnable connectionErrorTask)
+ {
+ _connectionErrorTask = connectionErrorTask;
+ }
+
+ /**
+ * Return the connection error for any socket read/write error that has occurred
+ *
+ * @return connection error
+ */
+ public Error getConnectionError()
+ {
+ return _socketError;
+ }
+
+ @Override
+ public void processSocketException(Exception exception)
+ {
+ Error socketError = new Error();
+ socketError.setDescription(exception.getClass() + ": " + exception.getMessage());
+ socketError.setCondition(ConnectionError.SOCKET_ERROR);
+ _socketError = socketError;
+ if(_connectionErrorTask != null)
+ {
+ Thread thread = new Thread(_connectionErrorTask);
+ thread.run();
+ }
+ }
+}
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ConnectionException.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ConnectionException.java
index 4271ed3e76..569c1f129d 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ConnectionException.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ConnectionException.java
@@ -22,6 +22,11 @@ package org.apache.qpid.amqp_1_0.client;
public class ConnectionException extends Exception
{
+ protected ConnectionException(final String message)
+ {
+ super(message);
+ }
+
public ConnectionException(Throwable cause)
{
super(cause);
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Message.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Message.java
index 7c1172898b..e8ac1de6c1 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Message.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Message.java
@@ -1,148 +1,148 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.amqp_1_0.client;
-
-import org.apache.qpid.amqp_1_0.type.Binary;
-import org.apache.qpid.amqp_1_0.type.DeliveryState;
-import org.apache.qpid.amqp_1_0.type.Section;
-import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
-import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
-import org.apache.qpid.amqp_1_0.type.messaging.Header;
-import org.apache.qpid.amqp_1_0.type.messaging.Properties;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-public class Message
-{
- private Binary _deliveryTag;
- private List<Section> _payload = new ArrayList<Section>();
- private Boolean _resume;
- private boolean _settled;
- private DeliveryState _deliveryState;
- private Receiver _receiver;
-
-
- public Message()
- {
- }
-
- public Message(Collection<Section> sections)
- {
- _payload.addAll(sections);
- }
-
- public Message(Section section)
- {
- this(Collections.singletonList(section));
- }
-
- public Message(String message)
- {
- this(new AmqpValue(message));
- }
-
-
- public Binary getDeliveryTag()
- {
- return _deliveryTag;
- }
-
- public void setDeliveryTag(Binary deliveryTag)
- {
- _deliveryTag = deliveryTag;
- }
-
- public List<Section> getPayload()
- {
- return Collections.unmodifiableList(_payload);
- }
-
- private <T extends Section> T getSection(Class<T> clazz)
- {
- for(Section s : _payload)
- {
- if(clazz.isAssignableFrom(s.getClass()))
- {
- return (T) s;
- }
- }
- return null;
- }
-
- public ApplicationProperties getApplicationProperties()
- {
- return getSection(ApplicationProperties.class);
- }
-
- public Properties getProperties()
- {
- return getSection(Properties.class);
- }
-
- public Header getHeader()
- {
- return getSection(Header.class);
- }
-
-
- public void setResume(final Boolean resume)
- {
- _resume = resume;
- }
-
- public boolean isResume()
- {
- return Boolean.TRUE.equals(_resume);
- }
-
- public void setDeliveryState(DeliveryState state)
- {
- _deliveryState = state;
- }
-
- public DeliveryState getDeliveryState()
- {
- return _deliveryState;
- }
-
- public void setSettled(boolean settled)
- {
- _settled = settled;
- }
-
- public boolean getSettled()
- {
- return _settled;
- }
-
- public void setReceiver(final Receiver receiver)
- {
- _receiver = receiver;
- }
-
- public Receiver getReceiver()
- {
- return _receiver;
- }
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.client;
+
+import org.apache.qpid.amqp_1_0.type.Binary;
+import org.apache.qpid.amqp_1_0.type.DeliveryState;
+import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
+import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties;
+import org.apache.qpid.amqp_1_0.type.messaging.Header;
+import org.apache.qpid.amqp_1_0.type.messaging.Properties;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+public class Message
+{
+ private Binary _deliveryTag;
+ private List<Section> _payload = new ArrayList<Section>();
+ private Boolean _resume;
+ private boolean _settled;
+ private DeliveryState _deliveryState;
+ private Receiver _receiver;
+
+
+ public Message()
+ {
+ }
+
+ public Message(Collection<Section> sections)
+ {
+ _payload.addAll(sections);
+ }
+
+ public Message(Section section)
+ {
+ this(Collections.singletonList(section));
+ }
+
+ public Message(String message)
+ {
+ this(new AmqpValue(message));
+ }
+
+
+ public Binary getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+
+ public void setDeliveryTag(Binary deliveryTag)
+ {
+ _deliveryTag = deliveryTag;
+ }
+
+ public List<Section> getPayload()
+ {
+ return Collections.unmodifiableList(_payload);
+ }
+
+ private <T extends Section> T getSection(Class<T> clazz)
+ {
+ for(Section s : _payload)
+ {
+ if(clazz.isAssignableFrom(s.getClass()))
+ {
+ return (T) s;
+ }
+ }
+ return null;
+ }
+
+ public ApplicationProperties getApplicationProperties()
+ {
+ return getSection(ApplicationProperties.class);
+ }
+
+ public Properties getProperties()
+ {
+ return getSection(Properties.class);
+ }
+
+ public Header getHeader()
+ {
+ return getSection(Header.class);
+ }
+
+
+ public void setResume(final Boolean resume)
+ {
+ _resume = resume;
+ }
+
+ public boolean isResume()
+ {
+ return Boolean.TRUE.equals(_resume);
+ }
+
+ public void setDeliveryState(DeliveryState state)
+ {
+ _deliveryState = state;
+ }
+
+ public DeliveryState getDeliveryState()
+ {
+ return _deliveryState;
+ }
+
+ public void setSettled(boolean settled)
+ {
+ _settled = settled;
+ }
+
+ public boolean getSettled()
+ {
+ return _settled;
+ }
+
+ public void setReceiver(final Receiver receiver)
+ {
+ _receiver = receiver;
+ }
+
+ public Receiver getReceiver()
+ {
+ return _receiver;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java
index 596931088f..5175d1d847 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java
@@ -1,615 +1,615 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.amqp_1_0.client;
-
-import org.apache.qpid.amqp_1_0.messaging.SectionDecoder;
-import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
-import org.apache.qpid.amqp_1_0.transport.LinkEndpoint;
-import org.apache.qpid.amqp_1_0.transport.ReceivingLinkEndpoint;
-import org.apache.qpid.amqp_1_0.transport.ReceivingLinkListener;
-
-import org.apache.qpid.amqp_1_0.type.*;
-import org.apache.qpid.amqp_1_0.type.DeliveryState;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Source;
-import org.apache.qpid.amqp_1_0.type.messaging.Target;
-import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
-import org.apache.qpid.amqp_1_0.type.transport.*;
-import org.apache.qpid.amqp_1_0.type.transport.Error;
-
-import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-public class Receiver implements DeliveryStateHandler
-{
- private ReceivingLinkEndpoint _endpoint;
- private int _id;
- private static final UnsignedInteger DEFAULT_INITIAL_CREDIT = UnsignedInteger.valueOf(100);
- private Session _session;
-
- private Queue<Transfer> _prefetchQueue = new ConcurrentLinkedQueue<Transfer>();
- private Map<Binary, SettledAction> _unsettledMap = new HashMap<Binary, SettledAction>();
- private MessageArrivalListener _messageArrivalListener;
- private org.apache.qpid.amqp_1_0.type.transport.Error _error;
- private Runnable _remoteErrorTask;
-
- public Receiver(final Session session,
- final String linkName,
- final Target target,
- final Source source,
- final AcknowledgeMode ackMode) throws ConnectionErrorException
- {
- this(session, linkName, target, source, ackMode, false);
- }
-
- public Receiver(final Session session,
- final String linkName,
- final Target target,
- final Source source,
- final AcknowledgeMode ackMode,
- boolean isDurable) throws ConnectionErrorException
- {
- this(session,linkName,target,source,ackMode,isDurable,null);
- }
-
- public Receiver(final Session session,
- final String linkName,
- final Target target,
- final Source source,
- final AcknowledgeMode ackMode,
- final boolean isDurable,
- final Map<Binary,Outcome> unsettled) throws ConnectionErrorException
- {
-
- session.getConnection().checkNotClosed();
- _session = session;
- if(isDurable)
- {
- source.setDurable(TerminusDurability.UNSETTLED_STATE);
- source.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
- }
- else if(source != null)
- {
- source.setDurable(TerminusDurability.NONE);
- source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
- }
- _endpoint = session.getEndpoint().createReceivingLinkEndpoint(linkName, target, source,
- UnsignedInteger.ZERO);
-
- _endpoint.setDeliveryStateHandler(this);
-
- switch(ackMode)
- {
- case ALO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
- _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
- break;
- case AMO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.SETTLED);
- _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
- break;
- case EO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
- _endpoint.setReceivingSettlementMode(ReceiverSettleMode.SECOND);
- break;
-
- }
-
- _endpoint.setLinkEventListener(new ReceivingLinkListener.DefaultLinkEventListener()
- {
- @Override public void messageTransfer(final Transfer xfr)
- {
- _prefetchQueue.add(xfr);
- postPrefetchAction();
- }
-
- @Override
- public void remoteDetached(final LinkEndpoint endpoint, final Detach detach)
- {
- _error = detach.getError();
- if(detach.getError()!=null)
- {
- remoteError();
- }
- super.remoteDetached(endpoint, detach);
- }
- });
-
- _endpoint.setLocalUnsettled(unsettled);
- _endpoint.attach();
-
- synchronized(_endpoint.getLock())
- {
- while(!_endpoint.isAttached() && !_endpoint.isDetached())
- {
- try
- {
- _endpoint.getLock().wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
-
- if(_endpoint.getSource() == null)
- {
- synchronized(_endpoint.getLock())
- {
- while(!_endpoint.isDetached())
- {
- try
- {
- _endpoint.getLock().wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
- throw new ConnectionErrorException(getError());
- }
- else
- {
-
- }
- }
-
- private void remoteError()
- {
- if(_remoteErrorTask != null)
- {
- _remoteErrorTask.run();
- }
- }
-
- private void postPrefetchAction()
- {
- if(_messageArrivalListener != null)
- {
- _messageArrivalListener.messageArrived(this);
- }
- }
-
- public void setCredit(UnsignedInteger credit, boolean window)
- {
- _endpoint.setLinkCredit(credit);
- _endpoint.setCreditWindow(window);
-
- }
-
-
- public String getAddress()
- {
- return ((Source)_endpoint.getSource()).getAddress();
- }
-
- public Map getFilter()
- {
- return ((Source)_endpoint.getSource()).getFilter();
- }
-
- public Message receive()
- {
- return receive(-1L);
- }
-
- public Message receive(boolean wait)
- {
- return receive(wait ? -1L : 0L);
- }
-
- // 0 means no wait, -1 wait forever
- public Message receive(long wait)
- {
- Message m = null;
- Transfer xfr;
- long endTime = wait > 0L ? System.currentTimeMillis() + wait : 0L;
-
- while((xfr = receiveFromPrefetch(wait)) != null )
- {
-
- if(!Boolean.TRUE.equals(xfr.getAborted()))
- {
- Binary deliveryTag = xfr.getDeliveryTag();
- Boolean resume = xfr.getResume();
-
- List<Section> sections = new ArrayList<Section>();
- List<ByteBuffer> payloads = new ArrayList<ByteBuffer>();
- int totalSize = 0;
-
- boolean hasMore;
- do
- {
- hasMore = Boolean.TRUE.equals(xfr.getMore());
-
- ByteBuffer buf = xfr.getPayload();
-
- if(buf != null)
- {
-
- totalSize += buf.remaining();
-
- payloads.add(buf);
- }
- if(hasMore)
- {
- xfr = receiveFromPrefetch(-1l);
- if(xfr== null)
- {
- // TODO - this is wrong!!!!
- System.out.println("eeek");
- }
- }
- }
- while(hasMore && !Boolean.TRUE.equals(xfr.getAborted()));
-
- if(!Boolean.TRUE.equals(xfr.getAborted()))
- {
- ByteBuffer allPayload = ByteBuffer.allocate(totalSize);
- for(ByteBuffer payload : payloads)
- {
- allPayload.put(payload);
- }
- allPayload.flip();
- SectionDecoder decoder = _session.getSectionDecoder();
-
- try
- {
- sections = decoder.parseAll(allPayload);
- }
- catch (AmqpErrorException e)
- {
- // todo - throw a sensible error
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- m = new Message(sections);
- m.setDeliveryTag(deliveryTag);
- m.setResume(resume);
- m.setReceiver(this);
- break;
- }
- }
-
- if(wait > 0L)
- {
- wait = endTime - System.currentTimeMillis();
- if(wait <=0L)
- {
- break;
- }
- }
- }
-
-
- return m;
-
- }
-
- private Transfer receiveFromPrefetch(long wait)
- {
- long endTime = ((wait >0L) ? (System.currentTimeMillis() + wait) : 0L);
- final Object lock = _endpoint.getLock();
- synchronized(lock)
- {
- Transfer xfr;
- while(((xfr = _prefetchQueue.peek()) == null) && !_endpoint.isDrained() && !_endpoint.isDetached()
- && wait != 0)
- {
- try
- {
- if(wait>0L)
- {
- lock.wait(wait);
- }
- else if(wait<0L)
- {
- lock.wait();
- }
- }
- catch (InterruptedException e)
- {
- return null;
- }
- if(wait > 0L)
- {
- wait = endTime - System.currentTimeMillis();
- if(wait <= 0L)
- {
- break;
- }
- }
-
- }
- if(xfr != null)
- {
- _prefetchQueue.poll();
-
- }
-
- return xfr;
- }
-
- }
-
-
- public void release(final Message m)
- {
- release(m.getDeliveryTag());
- }
-
- public void release(Binary deliveryTag)
- {
- update(new Released(), deliveryTag, null, null);
- }
-
-
- public void modified(Binary tag)
- {
- final Modified outcome = new Modified();
- outcome.setDeliveryFailed(true);
-
- update(outcome, tag, null, null);
- }
-
- public void acknowledge(final Message m)
- {
- acknowledge(m.getDeliveryTag());
- }
-
- public void acknowledge(final Message m, SettledAction a)
- {
- acknowledge(m.getDeliveryTag(), a);
- }
-
-
- public void acknowledge(final Message m, Transaction txn)
- {
- acknowledge(m.getDeliveryTag(), txn);
- }
-
-
- public void acknowledge(final Binary deliveryTag)
- {
- acknowledge(deliveryTag, null, null);
- }
-
-
- public void acknowledge(final Binary deliveryTag, SettledAction a)
- {
- acknowledge(deliveryTag, null, a);
- }
-
- public void acknowledge(final Binary deliveryTag, final Transaction txn)
- {
- acknowledge(deliveryTag, txn, null);
- }
-
- public void acknowledge(final Binary deliveryTag, final Transaction txn, SettledAction action)
- {
- update(new Accepted(), deliveryTag, txn, action);
- }
-
- public void update(Outcome outcome, final Binary deliveryTag, final Transaction txn, SettledAction action)
- {
-
- DeliveryState state;
- if(txn != null)
- {
- TransactionalState txnState = new TransactionalState();
- txnState.setOutcome(outcome);
- txnState.setTxnId(txn.getTxnId());
- state = txnState;
- }
- else
- {
- state = (DeliveryState) outcome;
- }
- boolean settled = txn == null && !ReceiverSettleMode.SECOND.equals(_endpoint.getReceivingSettlementMode());
-
- if(!(settled || action == null))
- {
- _unsettledMap.put(deliveryTag, action);
- }
-
- _endpoint.updateDisposition(deliveryTag,state, settled);
- }
-
- public Error getError()
- {
- return _error;
- }
-
- public void acknowledgeAll(Message m)
- {
- acknowledgeAll(m.getDeliveryTag());
- }
-
- public void acknowledgeAll(Binary deliveryTag)
- {
- acknowledgeAll(deliveryTag, null, null);
- }
-
- public void acknowledgeAll(Binary deliveryTag, final Transaction txn, SettledAction action)
- {
- updateAll(new Accepted(), deliveryTag, txn, action);
- }
-
- public void updateAll(Outcome outcome, Binary deliveryTag)
- {
- updateAll(outcome, deliveryTag, null, null);
- }
-
- public void updateAll(Outcome outcome, Binary deliveryTag, final Transaction txn, SettledAction action)
- {
- DeliveryState state;
-
- if(txn != null)
- {
- TransactionalState txnState = new TransactionalState();
- txnState.setOutcome(outcome);
- txnState.setTxnId(txn.getTxnId());
- state = txnState;
- }
- else
- {
- state = (DeliveryState) outcome;
- }
- boolean settled = txn == null && !ReceiverSettleMode.SECOND.equals(_endpoint.getReceivingSettlementMode());
-
- if(!(settled || action == null))
- {
- _unsettledMap.put(deliveryTag, action);
- }
- _endpoint.updateAllDisposition(deliveryTag, state, settled);
- }
-
-
-
- public void close()
- {
- _endpoint.setTarget(null);
- _endpoint.close();
- Message msg;
- while((msg = receive(-1l)) != null)
- {
- release(msg);
- }
-
- }
-
-
- public void detach()
- {
- _endpoint.setTarget(null);
- _endpoint.detach();
- Message msg;
- while((msg = receive(-1l)) != null)
- {
- release(msg);
- }
-
- }
-
- public void drain()
- {
- _endpoint.drain();
- }
-
- /**
- * Waits for the receiver to drain or a message to be available to be received.
- * @return true if the receiver has been drained.
- */
- public boolean drainWait()
- {
- final Object lock = _endpoint.getLock();
- synchronized(lock)
- {
- try
- {
- while( _prefetchQueue.peek()==null && !_endpoint.isDrained() && !_endpoint.isDetached() )
- {
- lock.wait();
- }
- }
- catch (InterruptedException e)
- {
- }
- }
- return _prefetchQueue.peek()==null && _endpoint.isDrained();
- }
-
- /**
- * Clears the receiver drain so that message delivery can resume.
- */
- public void clearDrain()
- {
- _endpoint.clearDrain();
- }
-
- public void setCreditWithTransaction(final UnsignedInteger credit, final Transaction txn)
- {
- _endpoint.setLinkCredit(credit);
- _endpoint.setTransactionId(txn == null ? null : txn.getTxnId());
- _endpoint.setCreditWindow(false);
-
- }
-
- public void handle(final Binary deliveryTag, final DeliveryState state, final Boolean settled)
- {
- if(Boolean.TRUE.equals(settled))
- {
- SettledAction action = _unsettledMap.remove(deliveryTag);
- if(action != null)
- {
- action.onSettled(deliveryTag);
- }
- }
- }
-
- public Map<Binary, Outcome> getRemoteUnsettled()
- {
- return _endpoint.getInitialUnsettledMap();
- }
-
-
- public void setMessageArrivalListener(final MessageArrivalListener messageArrivalListener)
- {
- synchronized(_endpoint.getLock())
- {
- _messageArrivalListener = messageArrivalListener;
- int prefetchSize = _prefetchQueue.size();
- for(int i = 0; i < prefetchSize; i++)
- {
- postPrefetchAction();
- }
- }
- }
-
- public Session getSession()
- {
- return _session;
- }
-
- public org.apache.qpid.amqp_1_0.type.Source getSource()
- {
- return _endpoint.getSource();
- }
-
- public static interface SettledAction
- {
- public void onSettled(Binary deliveryTag);
- }
-
-
- public interface MessageArrivalListener
- {
- void messageArrived(Receiver receiver);
- }
-
- public void setRemoteErrorListener(Runnable listener)
- {
- _remoteErrorTask = listener;
- }
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.client;
+
+import org.apache.qpid.amqp_1_0.messaging.SectionDecoder;
+import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
+import org.apache.qpid.amqp_1_0.transport.LinkEndpoint;
+import org.apache.qpid.amqp_1_0.transport.ReceivingLinkEndpoint;
+import org.apache.qpid.amqp_1_0.transport.ReceivingLinkListener;
+
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.DeliveryState;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Source;
+import org.apache.qpid.amqp_1_0.type.messaging.Target;
+import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+import java.nio.ByteBuffer;
+import java.util.*;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+public class Receiver implements DeliveryStateHandler
+{
+ private ReceivingLinkEndpoint _endpoint;
+ private int _id;
+ private static final UnsignedInteger DEFAULT_INITIAL_CREDIT = UnsignedInteger.valueOf(100);
+ private Session _session;
+
+ private Queue<Transfer> _prefetchQueue = new ConcurrentLinkedQueue<Transfer>();
+ private Map<Binary, SettledAction> _unsettledMap = new HashMap<Binary, SettledAction>();
+ private MessageArrivalListener _messageArrivalListener;
+ private org.apache.qpid.amqp_1_0.type.transport.Error _error;
+ private Runnable _remoteErrorTask;
+
+ public Receiver(final Session session,
+ final String linkName,
+ final Target target,
+ final Source source,
+ final AcknowledgeMode ackMode) throws ConnectionErrorException
+ {
+ this(session, linkName, target, source, ackMode, false);
+ }
+
+ public Receiver(final Session session,
+ final String linkName,
+ final Target target,
+ final Source source,
+ final AcknowledgeMode ackMode,
+ boolean isDurable) throws ConnectionErrorException
+ {
+ this(session,linkName,target,source,ackMode,isDurable,null);
+ }
+
+ public Receiver(final Session session,
+ final String linkName,
+ final Target target,
+ final Source source,
+ final AcknowledgeMode ackMode,
+ final boolean isDurable,
+ final Map<Binary,Outcome> unsettled) throws ConnectionErrorException
+ {
+
+ session.getConnection().checkNotClosed();
+ _session = session;
+ if(isDurable)
+ {
+ source.setDurable(TerminusDurability.UNSETTLED_STATE);
+ source.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
+ }
+ else if(source != null)
+ {
+ source.setDurable(TerminusDurability.NONE);
+ source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
+ }
+ _endpoint = session.getEndpoint().createReceivingLinkEndpoint(linkName, target, source,
+ UnsignedInteger.ZERO);
+
+ _endpoint.setDeliveryStateHandler(this);
+
+ switch(ackMode)
+ {
+ case ALO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
+ _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
+ break;
+ case AMO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.SETTLED);
+ _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
+ break;
+ case EO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
+ _endpoint.setReceivingSettlementMode(ReceiverSettleMode.SECOND);
+ break;
+
+ }
+
+ _endpoint.setLinkEventListener(new ReceivingLinkListener.DefaultLinkEventListener()
+ {
+ @Override public void messageTransfer(final Transfer xfr)
+ {
+ _prefetchQueue.add(xfr);
+ postPrefetchAction();
+ }
+
+ @Override
+ public void remoteDetached(final LinkEndpoint endpoint, final Detach detach)
+ {
+ _error = detach.getError();
+ if(detach.getError()!=null)
+ {
+ remoteError();
+ }
+ super.remoteDetached(endpoint, detach);
+ }
+ });
+
+ _endpoint.setLocalUnsettled(unsettled);
+ _endpoint.attach();
+
+ synchronized(_endpoint.getLock())
+ {
+ while(!_endpoint.isAttached() && !_endpoint.isDetached())
+ {
+ try
+ {
+ _endpoint.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+
+ if(_endpoint.getSource() == null)
+ {
+ synchronized(_endpoint.getLock())
+ {
+ while(!_endpoint.isDetached())
+ {
+ try
+ {
+ _endpoint.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+ throw new ConnectionErrorException(getError());
+ }
+ else
+ {
+
+ }
+ }
+
+ private void remoteError()
+ {
+ if(_remoteErrorTask != null)
+ {
+ _remoteErrorTask.run();
+ }
+ }
+
+ private void postPrefetchAction()
+ {
+ if(_messageArrivalListener != null)
+ {
+ _messageArrivalListener.messageArrived(this);
+ }
+ }
+
+ public void setCredit(UnsignedInteger credit, boolean window)
+ {
+ _endpoint.setLinkCredit(credit);
+ _endpoint.setCreditWindow(window);
+
+ }
+
+
+ public String getAddress()
+ {
+ return ((Source)_endpoint.getSource()).getAddress();
+ }
+
+ public Map getFilter()
+ {
+ return ((Source)_endpoint.getSource()).getFilter();
+ }
+
+ public Message receive()
+ {
+ return receive(-1L);
+ }
+
+ public Message receive(boolean wait)
+ {
+ return receive(wait ? -1L : 0L);
+ }
+
+ // 0 means no wait, -1 wait forever
+ public Message receive(long wait)
+ {
+ Message m = null;
+ Transfer xfr;
+ long endTime = wait > 0L ? System.currentTimeMillis() + wait : 0L;
+
+ while((xfr = receiveFromPrefetch(wait)) != null )
+ {
+
+ if(!Boolean.TRUE.equals(xfr.getAborted()))
+ {
+ Binary deliveryTag = xfr.getDeliveryTag();
+ Boolean resume = xfr.getResume();
+
+ List<Section> sections = new ArrayList<Section>();
+ List<ByteBuffer> payloads = new ArrayList<ByteBuffer>();
+ int totalSize = 0;
+
+ boolean hasMore;
+ do
+ {
+ hasMore = Boolean.TRUE.equals(xfr.getMore());
+
+ ByteBuffer buf = xfr.getPayload();
+
+ if(buf != null)
+ {
+
+ totalSize += buf.remaining();
+
+ payloads.add(buf);
+ }
+ if(hasMore)
+ {
+ xfr = receiveFromPrefetch(-1l);
+ if(xfr== null)
+ {
+ // TODO - this is wrong!!!!
+ System.out.println("eeek");
+ }
+ }
+ }
+ while(hasMore && !Boolean.TRUE.equals(xfr.getAborted()));
+
+ if(!Boolean.TRUE.equals(xfr.getAborted()))
+ {
+ ByteBuffer allPayload = ByteBuffer.allocate(totalSize);
+ for(ByteBuffer payload : payloads)
+ {
+ allPayload.put(payload);
+ }
+ allPayload.flip();
+ SectionDecoder decoder = _session.getSectionDecoder();
+
+ try
+ {
+ sections = decoder.parseAll(allPayload);
+ }
+ catch (AmqpErrorException e)
+ {
+ // todo - throw a sensible error
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ m = new Message(sections);
+ m.setDeliveryTag(deliveryTag);
+ m.setResume(resume);
+ m.setReceiver(this);
+ break;
+ }
+ }
+
+ if(wait > 0L)
+ {
+ wait = endTime - System.currentTimeMillis();
+ if(wait <=0L)
+ {
+ break;
+ }
+ }
+ }
+
+
+ return m;
+
+ }
+
+ private Transfer receiveFromPrefetch(long wait)
+ {
+ long endTime = ((wait >0L) ? (System.currentTimeMillis() + wait) : 0L);
+ final Object lock = _endpoint.getLock();
+ synchronized(lock)
+ {
+ Transfer xfr;
+ while(((xfr = _prefetchQueue.peek()) == null) && !_endpoint.isDrained() && !_endpoint.isDetached()
+ && wait != 0)
+ {
+ try
+ {
+ if(wait>0L)
+ {
+ lock.wait(wait);
+ }
+ else if(wait<0L)
+ {
+ lock.wait();
+ }
+ }
+ catch (InterruptedException e)
+ {
+ return null;
+ }
+ if(wait > 0L)
+ {
+ wait = endTime - System.currentTimeMillis();
+ if(wait <= 0L)
+ {
+ break;
+ }
+ }
+
+ }
+ if(xfr != null)
+ {
+ _prefetchQueue.poll();
+
+ }
+
+ return xfr;
+ }
+
+ }
+
+
+ public void release(final Message m)
+ {
+ release(m.getDeliveryTag());
+ }
+
+ public void release(Binary deliveryTag)
+ {
+ update(new Released(), deliveryTag, null, null);
+ }
+
+
+ public void modified(Binary tag)
+ {
+ final Modified outcome = new Modified();
+ outcome.setDeliveryFailed(true);
+
+ update(outcome, tag, null, null);
+ }
+
+ public void acknowledge(final Message m)
+ {
+ acknowledge(m.getDeliveryTag());
+ }
+
+ public void acknowledge(final Message m, SettledAction a)
+ {
+ acknowledge(m.getDeliveryTag(), a);
+ }
+
+
+ public void acknowledge(final Message m, Transaction txn)
+ {
+ acknowledge(m.getDeliveryTag(), txn);
+ }
+
+
+ public void acknowledge(final Binary deliveryTag)
+ {
+ acknowledge(deliveryTag, null, null);
+ }
+
+
+ public void acknowledge(final Binary deliveryTag, SettledAction a)
+ {
+ acknowledge(deliveryTag, null, a);
+ }
+
+ public void acknowledge(final Binary deliveryTag, final Transaction txn)
+ {
+ acknowledge(deliveryTag, txn, null);
+ }
+
+ public void acknowledge(final Binary deliveryTag, final Transaction txn, SettledAction action)
+ {
+ update(new Accepted(), deliveryTag, txn, action);
+ }
+
+ public void update(Outcome outcome, final Binary deliveryTag, final Transaction txn, SettledAction action)
+ {
+
+ DeliveryState state;
+ if(txn != null)
+ {
+ TransactionalState txnState = new TransactionalState();
+ txnState.setOutcome(outcome);
+ txnState.setTxnId(txn.getTxnId());
+ state = txnState;
+ }
+ else
+ {
+ state = (DeliveryState) outcome;
+ }
+ boolean settled = txn == null && !ReceiverSettleMode.SECOND.equals(_endpoint.getReceivingSettlementMode());
+
+ if(!(settled || action == null))
+ {
+ _unsettledMap.put(deliveryTag, action);
+ }
+
+ _endpoint.updateDisposition(deliveryTag,state, settled);
+ }
+
+ public Error getError()
+ {
+ return _error;
+ }
+
+ public void acknowledgeAll(Message m)
+ {
+ acknowledgeAll(m.getDeliveryTag());
+ }
+
+ public void acknowledgeAll(Binary deliveryTag)
+ {
+ acknowledgeAll(deliveryTag, null, null);
+ }
+
+ public void acknowledgeAll(Binary deliveryTag, final Transaction txn, SettledAction action)
+ {
+ updateAll(new Accepted(), deliveryTag, txn, action);
+ }
+
+ public void updateAll(Outcome outcome, Binary deliveryTag)
+ {
+ updateAll(outcome, deliveryTag, null, null);
+ }
+
+ public void updateAll(Outcome outcome, Binary deliveryTag, final Transaction txn, SettledAction action)
+ {
+ DeliveryState state;
+
+ if(txn != null)
+ {
+ TransactionalState txnState = new TransactionalState();
+ txnState.setOutcome(outcome);
+ txnState.setTxnId(txn.getTxnId());
+ state = txnState;
+ }
+ else
+ {
+ state = (DeliveryState) outcome;
+ }
+ boolean settled = txn == null && !ReceiverSettleMode.SECOND.equals(_endpoint.getReceivingSettlementMode());
+
+ if(!(settled || action == null))
+ {
+ _unsettledMap.put(deliveryTag, action);
+ }
+ _endpoint.updateAllDisposition(deliveryTag, state, settled);
+ }
+
+
+
+ public void close()
+ {
+ _endpoint.setTarget(null);
+ _endpoint.close();
+ Message msg;
+ while((msg = receive(-1l)) != null)
+ {
+ release(msg);
+ }
+
+ }
+
+
+ public void detach()
+ {
+ _endpoint.setTarget(null);
+ _endpoint.detach();
+ Message msg;
+ while((msg = receive(-1l)) != null)
+ {
+ release(msg);
+ }
+
+ }
+
+ public void drain()
+ {
+ _endpoint.drain();
+ }
+
+ /**
+ * Waits for the receiver to drain or a message to be available to be received.
+ * @return true if the receiver has been drained.
+ */
+ public boolean drainWait()
+ {
+ final Object lock = _endpoint.getLock();
+ synchronized(lock)
+ {
+ try
+ {
+ while( _prefetchQueue.peek()==null && !_endpoint.isDrained() && !_endpoint.isDetached() )
+ {
+ lock.wait();
+ }
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ return _prefetchQueue.peek()==null && _endpoint.isDrained();
+ }
+
+ /**
+ * Clears the receiver drain so that message delivery can resume.
+ */
+ public void clearDrain()
+ {
+ _endpoint.clearDrain();
+ }
+
+ public void setCreditWithTransaction(final UnsignedInteger credit, final Transaction txn)
+ {
+ _endpoint.setLinkCredit(credit);
+ _endpoint.setTransactionId(txn == null ? null : txn.getTxnId());
+ _endpoint.setCreditWindow(false);
+
+ }
+
+ public void handle(final Binary deliveryTag, final DeliveryState state, final Boolean settled)
+ {
+ if(Boolean.TRUE.equals(settled))
+ {
+ SettledAction action = _unsettledMap.remove(deliveryTag);
+ if(action != null)
+ {
+ action.onSettled(deliveryTag);
+ }
+ }
+ }
+
+ public Map<Binary, Outcome> getRemoteUnsettled()
+ {
+ return _endpoint.getInitialUnsettledMap();
+ }
+
+
+ public void setMessageArrivalListener(final MessageArrivalListener messageArrivalListener)
+ {
+ synchronized(_endpoint.getLock())
+ {
+ _messageArrivalListener = messageArrivalListener;
+ int prefetchSize = _prefetchQueue.size();
+ for(int i = 0; i < prefetchSize; i++)
+ {
+ postPrefetchAction();
+ }
+ }
+ }
+
+ public Session getSession()
+ {
+ return _session;
+ }
+
+ public org.apache.qpid.amqp_1_0.type.Source getSource()
+ {
+ return _endpoint.getSource();
+ }
+
+ public static interface SettledAction
+ {
+ public void onSettled(Binary deliveryTag);
+ }
+
+
+ public interface MessageArrivalListener
+ {
+ void messageArrived(Receiver receiver);
+ }
+
+ public void setRemoteErrorListener(Runnable listener)
+ {
+ _remoteErrorTask = listener;
+ }
+}
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java
index 0feaa48805..e35248f58c 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java
@@ -1,452 +1,497 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.amqp_1_0.client;
-
-import org.apache.qpid.amqp_1_0.messaging.SectionEncoder;
-import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
-import org.apache.qpid.amqp_1_0.transport.LinkEndpoint;
-import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
-import org.apache.qpid.amqp_1_0.transport.SendingLinkListener;
-import org.apache.qpid.amqp_1_0.type.*;
-import org.apache.qpid.amqp_1_0.type.Source;
-import org.apache.qpid.amqp_1_0.type.Target;
-import org.apache.qpid.amqp_1_0.type.messaging.*;
-import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
-import org.apache.qpid.amqp_1_0.type.transport.*;
-
-import java.nio.ByteBuffer;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.qpid.amqp_1_0.type.transport.Error;
-
-public class Sender implements DeliveryStateHandler
-{
- private SendingLinkEndpoint _endpoint;
- private int _id;
- private Session _session;
- private int _windowSize;
- private Map<Binary, OutcomeAction> _outcomeActions = Collections.synchronizedMap(new HashMap<Binary, OutcomeAction>());
- private boolean _closed;
- private Error _error;
- private Runnable _remoteErrorTask;
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, targetAddr, sourceAddr, false);
- }
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
- boolean synchronous)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, targetAddr, sourceAddr, synchronous ? 1 : 0);
- }
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
- int window) throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, targetAddr, sourceAddr, window, AcknowledgeMode.ALO);
- }
-
-
- public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
- int window) throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, target, source, window, AcknowledgeMode.ALO);
- }
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
- int window, AcknowledgeMode mode)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, targetAddr, sourceAddr, window, mode, null);
- }
-
- public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
- int window, AcknowledgeMode mode)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, target, source, window, mode, null);
- }
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
- int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, targetAddr, sourceAddr, window, mode, false, unsettled);
- }
-
- public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
- int window, AcknowledgeMode mode, boolean isDurable, Map<Binary, Outcome> unsettled)
- throws SenderCreationException, ConnectionClosedException
- {
- this(session, linkName, createTarget(targetAddr, isDurable), createSource(sourceAddr), window, mode, unsettled);
- }
-
- private static org.apache.qpid.amqp_1_0.type.messaging.Source createSource(final String sourceAddr)
- {
- org.apache.qpid.amqp_1_0.type.messaging.Source source = new org.apache.qpid.amqp_1_0.type.messaging.Source();
- source.setAddress(sourceAddr);
- return source;
- }
-
- private static org.apache.qpid.amqp_1_0.type.messaging.Target createTarget(final String targetAddr, final boolean isDurable)
- {
- org.apache.qpid.amqp_1_0.type.messaging.Target target = new org.apache.qpid.amqp_1_0.type.messaging.Target();
- target.setAddress(targetAddr);
- if(isDurable)
- {
- target.setDurable(TerminusDurability.UNSETTLED_STATE);
- target.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
- }
- return target;
- }
-
- public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
- int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
- throws SenderCreationException, ConnectionClosedException
- {
-
- _session = session;
- session.getConnection().checkNotClosed();
- _endpoint = session.getEndpoint().createSendingLinkEndpoint(linkName,
- source, target, unsettled);
-
-
- switch(mode)
- {
- case ALO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
- _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
- break;
- case AMO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.SETTLED);
- break;
- case EO:
- _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
- _endpoint.setReceivingSettlementMode(ReceiverSettleMode.SECOND);
- break;
-
- }
- _endpoint.setDeliveryStateHandler(this);
- _endpoint.attach();
- _windowSize = window;
-
- synchronized(_endpoint.getLock())
- {
- while(!(_endpoint.isAttached() || _endpoint.isDetached()))
- {
- try
- {
- _endpoint.getLock().wait();
- }
- catch (InterruptedException e)
- {
- throw new SenderCreationException(e);
- }
- }
- if(_endpoint.getTarget()== null)
- {
- throw new SenderCreationException("Peer did not create remote endpoint for link, target: " + target.getAddress());
- };
- }
-
- _endpoint.setLinkEventListener(new SendingLinkListener.DefaultLinkEventListener()
- {
-
- @Override
- public void remoteDetached(final LinkEndpoint endpoint, final Detach detach)
- {
- _error = detach.getError();
- if(_error != null)
- {
- remoteError();
- }
- super.remoteDetached(endpoint, detach);
- }
- });
- }
-
- public Source getSource()
- {
- return _endpoint.getSource();
- }
-
- public Target getTarget()
- {
- return _endpoint.getTarget();
- }
-
- public void send(Message message) throws LinkDetachedException
- {
- send(message, null, null);
- }
-
- public void send(Message message, final OutcomeAction action) throws LinkDetachedException
- {
- send(message, null, action);
- }
-
- public void send(Message message, final Transaction txn) throws LinkDetachedException
- {
- send(message, txn, null);
- }
-
- public void send(Message message, final Transaction txn, OutcomeAction action) throws LinkDetachedException
- {
-
- List<Section> sections = message.getPayload();
-
- Transfer xfr = new Transfer();
-
- if(sections != null && !sections.isEmpty())
- {
- SectionEncoder encoder = _session.getSectionEncoder();
- encoder.reset();
-
- int sectionNumber = 0;
- for(Section section : sections)
- {
- encoder.encodeObject(section);
- }
-
-
- Binary encoding = encoder.getEncoding();
- ByteBuffer payload = encoding.asByteBuffer();
- xfr.setPayload(payload);
- }
- if(message.getDeliveryTag() == null)
- {
- message.setDeliveryTag(new Binary(String.valueOf(_id++).getBytes()));
- }
- if(message.isResume())
- {
- xfr.setResume(Boolean.TRUE);
- }
- if(message.getDeliveryState() != null)
- {
- xfr.setState(message.getDeliveryState());
- }
-
- xfr.setDeliveryTag(message.getDeliveryTag());
- //xfr.setSettled(_windowSize ==0);
- if(txn != null)
- {
- xfr.setSettled(false);
- TransactionalState deliveryState = new TransactionalState();
- deliveryState.setTxnId(txn.getTxnId());
- xfr.setState(deliveryState);
- }
- else
- {
- xfr.setSettled(message.getSettled() || _endpoint.getSendingSettlementMode() == SenderSettleMode.SETTLED);
- }
- final Object lock = _endpoint.getLock();
- synchronized(lock)
- {
- while(!_endpoint.hasCreditToSend() && !_endpoint.isDetached())
- {
- try
- {
- lock.wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- if(_endpoint.isDetached())
- {
- throw new LinkDetachedException(_error);
- }
- if(action != null)
- {
- _outcomeActions.put(message.getDeliveryTag(), action);
- }
- _endpoint.transfer(xfr);
- //TODO - rationalise sending of flows
- // _endpoint.sendFlow();
- }
-
- if(_windowSize != 0)
- {
- synchronized(lock)
- {
-
-
- while(_endpoint.getUnsettledCount() >= _windowSize)
- {
- try
- {
- lock.wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
-
- }
-
-
- }
-
- public void close() throws SenderClosingException
- {
-
- if(_windowSize != 0)
- {
- synchronized(_endpoint.getLock())
- {
-
-
- while(_endpoint.getUnsettledCount() > 0)
- {
- try
- {
- _endpoint.getLock().wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
-
- }
- _session.removeSender(this);
- _endpoint.setSource(null);
- _endpoint.detach();
- _closed = true;
-
- synchronized(_endpoint.getLock())
- {
- while(!_endpoint.isDetached())
- {
- try
- {
- _endpoint.getLock().wait();
- }
- catch (InterruptedException e)
- {
- throw new SenderClosingException(e);
- }
- }
- }
- }
-
- public boolean isClosed()
- {
- return _closed;
- }
-
- public void handle(Binary deliveryTag, DeliveryState state, Boolean settled)
- {
- if(state instanceof Outcome)
- {
- OutcomeAction action;
- if((action = _outcomeActions.remove(deliveryTag)) != null)
- {
- action.onOutcome(deliveryTag, (Outcome) state);
- }
- if(!Boolean.TRUE.equals(settled))
- {
- _endpoint.updateDisposition(deliveryTag, state, true);
- }
- }
- else if(state instanceof TransactionalState)
- {
- OutcomeAction action;
-
- if((action = _outcomeActions.remove(deliveryTag)) != null)
- {
- action.onOutcome(deliveryTag, ((TransactionalState) state).getOutcome());
- }
-
- }
- }
-
- public SendingLinkEndpoint getEndpoint()
- {
- return _endpoint;
- }
-
- public Map<Binary, DeliveryState> getRemoteUnsettled()
- {
- return _endpoint.getInitialUnsettledMap();
- }
-
- public Session getSession()
- {
- return _session;
- }
-
-
- private void remoteError()
- {
- if(_remoteErrorTask != null)
- {
- _remoteErrorTask.run();
- }
- }
-
-
- public void setRemoteErrorListener(Runnable listener)
- {
- _remoteErrorTask = listener;
- }
-
- public Error getError()
- {
- return _error;
- }
-
- public class SenderCreationException extends Exception
- {
- public SenderCreationException(Throwable e)
- {
- super(e);
- }
-
- public SenderCreationException(String e)
- {
- super(e);
-
- }
- }
-
- public class SenderClosingException extends Exception
- {
- public SenderClosingException(Throwable e)
- {
- super(e);
- }
- }
-
- public static interface OutcomeAction
- {
- public void onOutcome(Binary deliveryTag, Outcome outcome);
- }
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.client;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.messaging.SectionEncoder;
+import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
+import org.apache.qpid.amqp_1_0.transport.LinkEndpoint;
+import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
+import org.apache.qpid.amqp_1_0.transport.SendingLinkListener;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.Source;
+import org.apache.qpid.amqp_1_0.type.Target;
+import org.apache.qpid.amqp_1_0.type.codec.AMQPDescribedTypeRegistry;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
+import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class Sender implements DeliveryStateHandler
+{
+ private SendingLinkEndpoint _endpoint;
+ private int _id;
+ private Session _session;
+ private int _windowSize;
+ private Map<Binary, OutcomeAction> _outcomeActions = Collections.synchronizedMap(new HashMap<Binary, OutcomeAction>());
+ private boolean _closed;
+ private Error _error;
+ private Runnable _remoteErrorTask;
+ private Outcome _defaultOutcome;
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, targetAddr, sourceAddr, false);
+ }
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
+ boolean synchronous)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, targetAddr, sourceAddr, synchronous ? 1 : 0);
+ }
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
+ int window) throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, targetAddr, sourceAddr, window, AcknowledgeMode.ALO);
+ }
+
+
+ public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+ int window) throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, target, source, window, AcknowledgeMode.ALO);
+ }
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
+ int window, AcknowledgeMode mode)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, targetAddr, sourceAddr, window, mode, null);
+ }
+
+ public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+ int window, AcknowledgeMode mode)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, target, source, window, mode, null);
+ }
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
+ int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, targetAddr, sourceAddr, window, mode, false, unsettled);
+ }
+
+ public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
+ int window, AcknowledgeMode mode, boolean isDurable, Map<Binary, Outcome> unsettled)
+ throws SenderCreationException, ConnectionClosedException
+ {
+ this(session, linkName, createTarget(targetAddr, isDurable), createSource(sourceAddr), window, mode, unsettled);
+ }
+
+ protected void configureSource(org.apache.qpid.amqp_1_0.type.messaging.Source source)
+ {
+
+ }
+
+ protected void configureTarget(org.apache.qpid.amqp_1_0.type.messaging.Target target)
+ {
+
+ }
+
+ private static org.apache.qpid.amqp_1_0.type.messaging.Source createSource(final String sourceAddr)
+ {
+ org.apache.qpid.amqp_1_0.type.messaging.Source source = new org.apache.qpid.amqp_1_0.type.messaging.Source();
+ source.setAddress(sourceAddr);
+ return source;
+ }
+
+ private static org.apache.qpid.amqp_1_0.type.messaging.Target createTarget(final String targetAddr, final boolean isDurable)
+ {
+ org.apache.qpid.amqp_1_0.type.messaging.Target target = new org.apache.qpid.amqp_1_0.type.messaging.Target();
+ target.setAddress(targetAddr);
+ if(isDurable)
+ {
+ target.setDurable(TerminusDurability.UNSETTLED_STATE);
+ target.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
+ }
+ return target;
+ }
+
+ public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+ int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
+ throws SenderCreationException, ConnectionClosedException
+ {
+
+ _session = session;
+ session.getConnection().checkNotClosed();
+ configureSource(source);
+ configureTarget(target);
+ _endpoint = session.getEndpoint().createSendingLinkEndpoint(linkName,
+ source, target, unsettled);
+
+
+ switch(mode)
+ {
+ case ALO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
+ _endpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
+ break;
+ case AMO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.SETTLED);
+ break;
+ case EO:
+ _endpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
+ _endpoint.setReceivingSettlementMode(ReceiverSettleMode.SECOND);
+ break;
+
+ }
+ _endpoint.setDeliveryStateHandler(this);
+ _endpoint.attach();
+ _windowSize = window;
+
+ synchronized(_endpoint.getLock())
+ {
+ while(!(_endpoint.isAttached() || _endpoint.isDetached()))
+ {
+ try
+ {
+ _endpoint.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ throw new SenderCreationException(e);
+ }
+ }
+ if(_endpoint.getTarget()== null)
+ {
+ throw new SenderCreationException("Peer did not create remote endpoint for link, target: " + target.getAddress());
+ };
+ }
+
+ _endpoint.setLinkEventListener(new SendingLinkListener.DefaultLinkEventListener()
+ {
+
+ @Override
+ public void remoteDetached(final LinkEndpoint endpoint, final Detach detach)
+ {
+ _error = detach.getError();
+ if(_error != null)
+ {
+ remoteError();
+ }
+ super.remoteDetached(endpoint, detach);
+ }
+ });
+
+ _defaultOutcome = source.getDefaultOutcome();
+ if(_defaultOutcome == null)
+ {
+ if(source.getOutcomes() == null || source.getOutcomes().length == 0)
+ {
+ _defaultOutcome = new Accepted();
+ }
+ else if(source.getOutcomes().length == 1)
+ {
+
+ final AMQPDescribedTypeRegistry describedTypeRegistry = _endpoint.getSession()
+ .getConnection()
+ .getDescribedTypeRegistry();
+
+ DescribedTypeConstructor constructor = describedTypeRegistry
+ .getConstructor(source.getOutcomes()[0]);
+ if(constructor != null)
+ {
+ Object impliedOutcome = constructor.construct(Collections.EMPTY_LIST);
+ if(impliedOutcome instanceof Outcome)
+ {
+ _defaultOutcome = (Outcome) impliedOutcome;
+ }
+ }
+
+ }
+ }
+ }
+
+ public Source getSource()
+ {
+ return _endpoint.getSource();
+ }
+
+ public Target getTarget()
+ {
+ return _endpoint.getTarget();
+ }
+
+ public void send(Message message) throws LinkDetachedException
+ {
+ send(message, null, null);
+ }
+
+ public void send(Message message, final OutcomeAction action) throws LinkDetachedException
+ {
+ send(message, null, action);
+ }
+
+ public void send(Message message, final Transaction txn) throws LinkDetachedException
+ {
+ send(message, txn, null);
+ }
+
+ public void send(Message message, final Transaction txn, OutcomeAction action) throws LinkDetachedException
+ {
+
+ List<Section> sections = message.getPayload();
+
+ Transfer xfr = new Transfer();
+
+ if(sections != null && !sections.isEmpty())
+ {
+ SectionEncoder encoder = _session.getSectionEncoder();
+ encoder.reset();
+
+ int sectionNumber = 0;
+ for(Section section : sections)
+ {
+ encoder.encodeObject(section);
+ }
+
+
+ Binary encoding = encoder.getEncoding();
+ ByteBuffer payload = encoding.asByteBuffer();
+ xfr.setPayload(payload);
+ }
+ if(message.getDeliveryTag() == null)
+ {
+ message.setDeliveryTag(new Binary(String.valueOf(_id++).getBytes()));
+ }
+ if(message.isResume())
+ {
+ xfr.setResume(Boolean.TRUE);
+ }
+ if(message.getDeliveryState() != null)
+ {
+ xfr.setState(message.getDeliveryState());
+ }
+
+ xfr.setDeliveryTag(message.getDeliveryTag());
+ //xfr.setSettled(_windowSize ==0);
+ if(txn != null)
+ {
+ xfr.setSettled(false);
+ TransactionalState deliveryState = new TransactionalState();
+ deliveryState.setTxnId(txn.getTxnId());
+ xfr.setState(deliveryState);
+ }
+ else
+ {
+ xfr.setSettled(message.getSettled() || _endpoint.getSendingSettlementMode() == SenderSettleMode.SETTLED);
+ }
+ final Object lock = _endpoint.getLock();
+ synchronized(lock)
+ {
+ while(!_endpoint.hasCreditToSend() && !_endpoint.isDetached())
+ {
+ try
+ {
+ lock.wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ if(_endpoint.isDetached())
+ {
+ throw new LinkDetachedException(_error);
+ }
+ if(action != null)
+ {
+ _outcomeActions.put(message.getDeliveryTag(), action);
+ }
+ _endpoint.transfer(xfr);
+ //TODO - rationalise sending of flows
+ // _endpoint.sendFlow();
+ }
+
+ if(_windowSize != 0)
+ {
+ synchronized(lock)
+ {
+
+
+ while(_endpoint.getUnsettledCount() >= _windowSize)
+ {
+ try
+ {
+ lock.wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+
+ }
+
+
+ }
+
+ public void close() throws SenderClosingException
+ {
+
+ if(_windowSize != 0)
+ {
+ synchronized(_endpoint.getLock())
+ {
+
+
+ while(_endpoint.getUnsettledCount() > 0)
+ {
+ try
+ {
+ _endpoint.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+
+ }
+ _session.removeSender(this);
+ _endpoint.setSource(null);
+ _endpoint.detach();
+ _closed = true;
+
+ synchronized(_endpoint.getLock())
+ {
+ while(!_endpoint.isDetached())
+ {
+ try
+ {
+ _endpoint.getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ throw new SenderClosingException(e);
+ }
+ }
+ }
+ }
+
+ public boolean isClosed()
+ {
+ return _closed;
+ }
+
+ public void handle(Binary deliveryTag, DeliveryState state, Boolean settled)
+ {
+ if(state instanceof Outcome)
+ {
+ OutcomeAction action;
+ if((action = _outcomeActions.remove(deliveryTag)) != null)
+ {
+
+ final Outcome outcome = (Outcome) state;
+ action.onOutcome(deliveryTag, (outcome == null && settled) ? _defaultOutcome : outcome);
+ }
+ if(!Boolean.TRUE.equals(settled))
+ {
+ _endpoint.updateDisposition(deliveryTag, state, true);
+ }
+ }
+ else if(state instanceof TransactionalState)
+ {
+ OutcomeAction action;
+ if((action = _outcomeActions.remove(deliveryTag)) != null)
+ {
+ final Outcome outcome = ((TransactionalState) state).getOutcome();
+ action.onOutcome(deliveryTag, outcome == null ? _defaultOutcome : outcome);
+ }
+
+ }
+ }
+
+ public SendingLinkEndpoint getEndpoint()
+ {
+ return _endpoint;
+ }
+
+ public Map<Binary, DeliveryState> getRemoteUnsettled()
+ {
+ return _endpoint.getInitialUnsettledMap();
+ }
+
+ public Session getSession()
+ {
+ return _session;
+ }
+
+
+ private void remoteError()
+ {
+ if(_remoteErrorTask != null)
+ {
+ _remoteErrorTask.run();
+ }
+ }
+
+
+ public void setRemoteErrorListener(Runnable listener)
+ {
+ _remoteErrorTask = listener;
+ }
+
+ public Error getError()
+ {
+ return _error;
+ }
+
+ public class SenderCreationException extends Exception
+ {
+ public SenderCreationException(Throwable e)
+ {
+ super(e);
+ }
+
+ public SenderCreationException(String e)
+ {
+ super(e);
+
+ }
+ }
+
+ public class SenderClosingException extends Exception
+ {
+ public SenderClosingException(Throwable e)
+ {
+ super(e);
+ }
+ }
+
+ public static interface OutcomeAction
+ {
+ public void onOutcome(Binary deliveryTag, Outcome outcome);
+ }
+}
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java
index 182d904a9c..21af6950d8 100644
--- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java
+++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java
@@ -1,384 +1,402 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.amqp_1_0.client;
-
-import org.apache.qpid.amqp_1_0.messaging.SectionDecoder;
-import org.apache.qpid.amqp_1_0.messaging.SectionDecoderImpl;
-import org.apache.qpid.amqp_1_0.messaging.SectionEncoder;
-import org.apache.qpid.amqp_1_0.messaging.SectionEncoderImpl;
-import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
-import org.apache.qpid.amqp_1_0.transport.SessionEndpoint;
-import org.apache.qpid.amqp_1_0.transport.SessionState;
-import org.apache.qpid.amqp_1_0.type.*;
-import org.apache.qpid.amqp_1_0.type.messaging.Filter;
-import org.apache.qpid.amqp_1_0.type.messaging.Source;
-import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
-import org.apache.qpid.amqp_1_0.type.messaging.Target;
-import org.apache.qpid.amqp_1_0.type.transaction.TxnCapability;
-import org.apache.qpid.amqp_1_0.type.transport.ReceiverSettleMode;
-import org.apache.qpid.amqp_1_0.type.transport.SenderSettleMode;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-public class Session
-{
- private SessionEndpoint _endpoint;
- private List<Receiver> _receivers = new ArrayList<Receiver>();
- private List<Sender> _senders = new ArrayList<Sender>();
- private SectionEncoder _sectionEncoder;
- private SectionDecoder _sectionDecoder;
- private TransactionController _sessionLocalTC;
- private Connection _connection;
-
- public Session(final Connection connection, String name)
- {
- _connection = connection;
- _endpoint = connection.getEndpoint().createSession(name);
- _sectionEncoder = new SectionEncoderImpl(connection.getEndpoint().getDescribedTypeRegistry());
- _sectionDecoder = new SectionDecoderImpl(connection.getEndpoint().getDescribedTypeRegistry());
- }
-
-
- public synchronized Sender createSender(final String targetName)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
- return createSender(targetName, false);
- }
-
- public synchronized Sender createSender(final String targetName, boolean synchronous)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
-
- final String sourceName = UUID.randomUUID().toString();
- return new Sender(this, targetName+"<-"+sourceName, targetName, sourceName, synchronous);
-
- }
-
- public synchronized Sender createSender(final String targetName, int window)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
- final String sourceName = UUID.randomUUID().toString();
- return new Sender(this, targetName+"<-"+sourceName, targetName, sourceName, window);
-
- }
-
- public Sender createSender(String targetName, int window, AcknowledgeMode mode)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
-
- return createSender(targetName, window, mode, null);
- }
-
- public Sender createSender(String targetName, int window, AcknowledgeMode mode, String linkName)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
- return createSender(targetName, window, mode, linkName, null);
- }
- public Sender createSender(String targetName, int window, AcknowledgeMode mode, String linkName, Map<Binary, Outcome> unsettled)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
- return createSender(targetName, window, mode, linkName, false, unsettled);
- }
-
- public Sender createSender(String targetName, int window, AcknowledgeMode mode, String linkName,
- boolean isDurable, Map<Binary, Outcome> unsettled)
- throws Sender.SenderCreationException, ConnectionClosedException
- {
- return new Sender(this, linkName == null ? "->" + targetName + '(' + UUID.randomUUID().toString()+')': linkName,
- targetName, null, window, mode, isDurable, unsettled);
-
- }
-
-
- public Receiver createReceiver(final String sourceAddr) throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, null, AcknowledgeMode.ALO);
- }
-
-
- public Receiver createReceiver(final String queue, final AcknowledgeMode mode)
- throws ConnectionErrorException
- {
- return createReceiver(queue, null, mode);
- }
-
- public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName)
- throws ConnectionErrorException
- {
- return createReceiver(queue, null, mode, linkName);
- }
-
- public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName, boolean isDurable)
- throws ConnectionErrorException
- {
- return createReceiver(queue, null, mode, linkName, isDurable);
- }
-
- public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName, boolean isDurable,
- Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
- throws ConnectionErrorException
- {
- return createReceiver(queue, null, mode, linkName, isDurable, filters, unsettled);
- }
-
-
- public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName,
- boolean isDurable, Map<Binary, Outcome> unsettled)
- throws ConnectionErrorException
- {
- return createReceiver(queue, null, mode, linkName, isDurable, unsettled);
- }
-
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, mode, AcknowledgeMode.ALO);
- }
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode, String linkName)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, mode, AcknowledgeMode.ALO, linkName);
- }
-
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
- final AcknowledgeMode ackMode)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, mode, ackMode, null);
- }
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
- final AcknowledgeMode ackMode, String linkName)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr,mode, ackMode, linkName, false);
- }
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
- final AcknowledgeMode ackMode, String linkName, boolean isDurable)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, mode, ackMode, linkName, isDurable, null);
- }
-
- private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
- final AcknowledgeMode ackMode, String linkName, boolean isDurable,
- Map<Binary, Outcome> unsettled)
- throws ConnectionErrorException
- {
- return createReceiver(sourceAddr,mode,ackMode, linkName, isDurable, null, unsettled);
- }
-
- public synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
- final AcknowledgeMode ackMode, String linkName, boolean isDurable,
- Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
- throws ConnectionErrorException
- {
-
- final Target target = new Target();
- final Source source = new Source();
- source.setAddress(sourceAddr);
- source.setDistributionMode(mode);
- source.setFilter(filters);
-
- if(linkName == null)
- {
- linkName = sourceAddr + "-> (" + UUID.randomUUID().toString() + ")";
- }
-
- final Receiver receiver =
- new Receiver(this, linkName,
- target, source, ackMode, isDurable, unsettled);
- _receivers.add(receiver);
-
- return receiver;
-
- }
-
- public synchronized Receiver createCopyingReceiver(final String sourceAddr) throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, StdDistMode.COPY);
- }
-
- public synchronized Receiver createMovingReceiver(final String sourceAddr) throws ConnectionErrorException
- {
- return createReceiver(sourceAddr, StdDistMode.MOVE);
- }
-
- public Receiver createTemporaryQueueReceiver() throws AmqpErrorException, ConnectionErrorException
- {
- Source source = new Source();
- source.setDynamic(true);
-
- final Receiver receiver = new Receiver(this, "tempSender"+UUID.randomUUID().toString(), new Target(),
- source, AcknowledgeMode.ALO);
- _receivers.add(receiver);
- return receiver;
- }
-
- public Sender createTemporaryQueueSender() throws Sender.SenderCreationException, ConnectionClosedException
- {
- Target target = new Target();
- target.setDynamic(true);
-
- final Sender sender;
- sender = new Sender(this, "tempSender"+ UUID.randomUUID().toString(), target,
- new Source(), 0, AcknowledgeMode.ALO);
- _senders.add(sender);
- return sender;
- }
-
-
-
- public SessionEndpoint getEndpoint()
- {
- return _endpoint;
- }
-
- public synchronized void close()
- {
- try
- {
- for(Sender sender : new ArrayList<Sender>(_senders))
- {
- sender.close();
- }
- for(Receiver receiver : new ArrayList<Receiver>(_receivers))
- {
- receiver.detach();
- }
- if(_sessionLocalTC != null)
- {
- _sessionLocalTC.close();
- }
- _endpoint.end();
- }
- catch (Sender.SenderClosingException e)
- {
-// TODO
- e.printStackTrace();
- }
-
- //TODO
-
- }
-
- void removeSender(Sender sender)
- {
- _senders.remove(sender);
- }
-
- void removeReceiver(Receiver receiver)
- {
- _receivers.remove(receiver);
- }
-
- public SectionEncoder getSectionEncoder()
- {
- return _sectionEncoder;
- }
-
- public SectionDecoder getSectionDecoder()
- {
- return _sectionDecoder;
- }
-
-
- public Transaction createSessionLocalTransaction()
- {
- TransactionController localController = getSessionLocalTransactionController();
- return localController.beginTransaction();
- }
-
- private TransactionController getSessionLocalTransactionController()
- {
- if(_sessionLocalTC == null)
- {
- _sessionLocalTC = createSessionLocalTransactionController();
- }
- return _sessionLocalTC;
- }
-
- private TransactionController createSessionLocalTransactionController()
- {
- String name = "txnControllerLink";
- SendingLinkEndpoint tcLinkEndpoint = _endpoint.createTransactionController(name, TxnCapability.LOCAL_TXN,
- TxnCapability.MULTI_TXNS_PER_SSN);
- tcLinkEndpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
- tcLinkEndpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
- tcLinkEndpoint.attach();
- return new TransactionController(this, tcLinkEndpoint);
- }
-
-
- public Message receive()
- {
- while(getEndpoint().getState() == SessionState.ACTIVE)
- {
- synchronized (getEndpoint().getLock())
- {
- try
- {
- for(Receiver r : _receivers)
- {
- Message m = r.receive(false);
- if(m != null)
- return m;
- }
- wait();
- }
- catch (InterruptedException e)
- {
- }
- }
- }
- return null;
- }
-
- public Connection getConnection()
- {
- return _connection;
- }
-
- public void awaitActive()
- {
- synchronized(getEndpoint().getLock())
- {
- while(!getEndpoint().isEnded() && !getEndpoint().isActive())
- {
- try
- {
- getEndpoint().getLock().wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- }
- }
-}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.client;
+
+import org.apache.qpid.amqp_1_0.messaging.SectionDecoder;
+import org.apache.qpid.amqp_1_0.messaging.SectionDecoderImpl;
+import org.apache.qpid.amqp_1_0.messaging.SectionEncoder;
+import org.apache.qpid.amqp_1_0.messaging.SectionEncoderImpl;
+import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
+import org.apache.qpid.amqp_1_0.transport.SessionEndpoint;
+import org.apache.qpid.amqp_1_0.transport.SessionState;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.messaging.Filter;
+import org.apache.qpid.amqp_1_0.type.messaging.Source;
+import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
+import org.apache.qpid.amqp_1_0.type.messaging.Target;
+import org.apache.qpid.amqp_1_0.type.transaction.TxnCapability;
+import org.apache.qpid.amqp_1_0.type.transport.ReceiverSettleMode;
+import org.apache.qpid.amqp_1_0.type.transport.SenderSettleMode;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+public class Session
+{
+ private SessionEndpoint _endpoint;
+ private List<Receiver> _receivers = new ArrayList<Receiver>();
+ private List<Sender> _senders = new ArrayList<Sender>();
+ private SectionEncoder _sectionEncoder;
+ private SectionDecoder _sectionDecoder;
+ private TransactionController _sessionLocalTC;
+ private Connection _connection;
+
+ public Session(final Connection connection, String name) throws SessionCreationException
+ {
+ _connection = connection;
+ _endpoint = connection.getEndpoint().createSession(name);
+ if(_endpoint == null)
+ {
+ throw new SessionCreationException("Cannot create session as all channels are in use");
+ }
+ _sectionEncoder = new SectionEncoderImpl(connection.getEndpoint().getDescribedTypeRegistry());
+ _sectionDecoder = new SectionDecoderImpl(connection.getEndpoint().getDescribedTypeRegistry());
+ }
+
+
+ public synchronized Sender createSender(final String targetName)
+ throws Sender.SenderCreationException, ConnectionClosedException
+ {
+
+ final String sourceName = UUID.randomUUID().toString();
+ return new Sender(this, targetName +"<-"+sourceName, targetName, sourceName, false);
+
+ }
+
+
+ public synchronized Sender createSender(final String targetName, final SourceConfigurator configurator)
+ throws Sender.SenderCreationException, ConnectionClosedException
+ {
+
+ final String sourceName = UUID.randomUUID().toString();
+ return new Sender(this, targetName +"<-"+sourceName, targetName, sourceName, false)
+ {
+ @Override
+ protected void configureSource(final Source source)
+ {
+ configurator.configureSource(source);
+ }
+ };
+
+ }
+
+ public synchronized Sender createSender(final String targetName, int window)
+ throws Sender.SenderCreationException, ConnectionClosedException
+ {
+ final String sourceName = UUID.randomUUID().toString();
+ return new Sender(this, targetName+"<-"+sourceName, targetName, sourceName, window);
+
+ }
+
+ public Sender createSender(String targetName, int window, AcknowledgeMode mode, String linkName)
+ throws Sender.SenderCreationException, ConnectionClosedException
+ {
+ return createSender(targetName, window, mode, linkName, false, null);
+ }
+
+ public Sender createSender(String targetName, int window, AcknowledgeMode mode, String linkName,
+ boolean isDurable, Map<Binary, Outcome> unsettled)
+ throws Sender.SenderCreationException, ConnectionClosedException
+ {
+ return new Sender(this, linkName == null ? "->" + targetName + '(' + UUID.randomUUID().toString()+')': linkName,
+ targetName, null, window, mode, isDurable, unsettled);
+
+ }
+
+
+ public Receiver createReceiver(final String sourceAddr) throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, null, AcknowledgeMode.ALO);
+ }
+
+
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode)
+ throws ConnectionErrorException
+ {
+ return createReceiver(queue, null, mode);
+ }
+
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName)
+ throws ConnectionErrorException
+ {
+ return createReceiver(queue, null, mode, linkName);
+ }
+
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName, boolean isDurable)
+ throws ConnectionErrorException
+ {
+ return createReceiver(queue, null, mode, linkName, isDurable);
+ }
+
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName, boolean isDurable,
+ Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
+ throws ConnectionErrorException
+ {
+ return createReceiver(queue, null, mode, linkName, isDurable, filters, unsettled);
+ }
+
+
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName,
+ boolean isDurable, Map<Binary, Outcome> unsettled)
+ throws ConnectionErrorException
+ {
+ return createReceiver(queue, null, mode, linkName, isDurable, unsettled);
+ }
+
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, mode, AcknowledgeMode.ALO);
+ }
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode, String linkName)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, mode, AcknowledgeMode.ALO, linkName);
+ }
+
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, mode, ackMode, null);
+ }
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode, String linkName)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr,mode, ackMode, linkName, false);
+ }
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode, String linkName, boolean isDurable)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, mode, ackMode, linkName, isDurable, null);
+ }
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode, String linkName, boolean isDurable,
+ Map<Binary, Outcome> unsettled)
+ throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr,mode,ackMode, linkName, isDurable, null, unsettled);
+ }
+
+ public synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode, String linkName, boolean isDurable,
+ Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
+ throws ConnectionErrorException
+ {
+
+ final Target target = new Target();
+ final Source source = new Source();
+ source.setAddress(sourceAddr);
+ source.setDistributionMode(mode);
+ source.setFilter(filters);
+
+ if(linkName == null)
+ {
+ linkName = sourceAddr + "-> (" + UUID.randomUUID().toString() + ")";
+ }
+
+ final Receiver receiver =
+ new Receiver(this, linkName,
+ target, source, ackMode, isDurable, unsettled);
+ _receivers.add(receiver);
+
+ return receiver;
+
+ }
+
+ public synchronized Receiver createCopyingReceiver(final String sourceAddr) throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, StdDistMode.COPY);
+ }
+
+ public synchronized Receiver createMovingReceiver(final String sourceAddr) throws ConnectionErrorException
+ {
+ return createReceiver(sourceAddr, StdDistMode.MOVE);
+ }
+
+ public Receiver createTemporaryQueueReceiver() throws AmqpErrorException, ConnectionErrorException
+ {
+ Source source = new Source();
+ source.setDynamic(true);
+
+ final Receiver receiver = new Receiver(this, "tempSender"+UUID.randomUUID().toString(), new Target(),
+ source, AcknowledgeMode.ALO);
+ _receivers.add(receiver);
+ return receiver;
+ }
+
+ public Sender createTemporaryQueueSender() throws Sender.SenderCreationException, ConnectionClosedException
+ {
+ Target target = new Target();
+ target.setDynamic(true);
+
+ final Sender sender;
+ sender = new Sender(this, "tempSender"+ UUID.randomUUID().toString(), target,
+ new Source(), 0, AcknowledgeMode.ALO);
+ _senders.add(sender);
+ return sender;
+ }
+
+
+
+ public SessionEndpoint getEndpoint()
+ {
+ return _endpoint;
+ }
+
+ public synchronized void close()
+ {
+ try
+ {
+ for(Sender sender : new ArrayList<Sender>(_senders))
+ {
+ sender.close();
+ }
+ for(Receiver receiver : new ArrayList<Receiver>(_receivers))
+ {
+ receiver.detach();
+ }
+ if(_sessionLocalTC != null)
+ {
+ _sessionLocalTC.close();
+ }
+ _endpoint.end();
+ }
+ catch (Sender.SenderClosingException e)
+ {
+// TODO
+ e.printStackTrace();
+ }
+
+ //TODO
+
+ }
+
+ void removeSender(Sender sender)
+ {
+ _senders.remove(sender);
+ }
+
+ void removeReceiver(Receiver receiver)
+ {
+ _receivers.remove(receiver);
+ }
+
+ public SectionEncoder getSectionEncoder()
+ {
+ return _sectionEncoder;
+ }
+
+ public SectionDecoder getSectionDecoder()
+ {
+ return _sectionDecoder;
+ }
+
+
+ public Transaction createSessionLocalTransaction()
+ {
+ TransactionController localController = getSessionLocalTransactionController();
+ return localController.beginTransaction();
+ }
+
+ private TransactionController getSessionLocalTransactionController()
+ {
+ if(_sessionLocalTC == null)
+ {
+ _sessionLocalTC = createSessionLocalTransactionController();
+ }
+ return _sessionLocalTC;
+ }
+
+ private TransactionController createSessionLocalTransactionController()
+ {
+ String name = "txnControllerLink";
+ SendingLinkEndpoint tcLinkEndpoint = _endpoint.createTransactionController(name, TxnCapability.LOCAL_TXN,
+ TxnCapability.MULTI_TXNS_PER_SSN);
+ tcLinkEndpoint.setReceivingSettlementMode(ReceiverSettleMode.FIRST);
+ tcLinkEndpoint.setSendingSettlementMode(SenderSettleMode.UNSETTLED);
+ tcLinkEndpoint.attach();
+ return new TransactionController(this, tcLinkEndpoint);
+ }
+
+
+ public Message receive()
+ {
+ while(getEndpoint().getState() == SessionState.ACTIVE)
+ {
+ synchronized (getEndpoint().getLock())
+ {
+ try
+ {
+ for(Receiver r : _receivers)
+ {
+ Message m = r.receive(false);
+ if(m != null)
+ return m;
+ }
+ wait();
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+ return null;
+ }
+
+ public Connection getConnection()
+ {
+ return _connection;
+ }
+
+ public void awaitActive()
+ {
+ synchronized(getEndpoint().getLock())
+ {
+ while(!getEndpoint().isEnded() && !getEndpoint().isActive())
+ {
+ try
+ {
+ getEndpoint().getLock().wait();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+ }
+ }
+
+ public static interface SourceConfigurator
+ {
+ public void configureSource(final Source source);
+ }
+
+ private class SessionCreationException extends ConnectionException
+ {
+
+ private SessionCreationException(final String message)
+ {
+ super(message);
+ }
+
+ }
+}
diff --git a/qpid/java/amqp-1-0-common/pom.xml b/qpid/java/amqp-1-0-common/pom.xml
new file mode 100644
index 0000000000..d771d58ab1
--- /dev/null
+++ b/qpid/java/amqp-1-0-common/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/StringTypeConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/StringTypeConstructor.java
index e89f038f23..cc788f72c5 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/StringTypeConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/StringTypeConstructor.java
@@ -32,30 +32,6 @@ public class StringTypeConstructor extends VariableWidthTypeConstructor
{
private Charset _charSet;
- private BinaryString _defaultBinaryString = new BinaryString();
- private ValueCache<BinaryString, String> _cachedValues = new ValueCache<BinaryString, String>(10);
-
- private static final class ValueCache<K,V> extends LinkedHashMap<K,V>
- {
- private final int _cacheSize;
-
- public ValueCache(int cacheSize)
- {
- _cacheSize = cacheSize;
- }
-
- @Override
- protected boolean removeEldestEntry(Map.Entry<K, V> eldest)
- {
- return size() > _cacheSize;
- }
-
- public boolean isFull()
- {
- return size() == _cacheSize;
- }
- }
-
public static StringTypeConstructor getInstance(int i, Charset c)
{
@@ -84,44 +60,19 @@ public class StringTypeConstructor extends VariableWidthTypeConstructor
}
int origPosition = in.position();
- _defaultBinaryString.setData(in.array(), in.arrayOffset()+ origPosition, size);
-
- BinaryString binaryStr = _defaultBinaryString;
- boolean isFull = _cachedValues.isFull();
-
- String str = isFull ? _cachedValues.remove(binaryStr) : _cachedValues.get(binaryStr);
-
- if(str == null)
+ ByteBuffer dup = in.duplicate();
+ try
{
-
- ByteBuffer dup = in.duplicate();
- try
- {
- dup.limit(dup.position()+size);
- }
- catch(IllegalArgumentException e)
- {
- throw new IllegalArgumentException("position: " + dup.position() + "size: " + size + " capacity: " + dup.capacity());
- }
- CharBuffer charBuf = _charSet.decode(dup);
-
- str = charBuf.toString();
-
- byte[] data = new byte[size];
- in.get(data);
- binaryStr = new BinaryString(data, 0, size);
-
- _cachedValues.put(binaryStr, str);
+ dup.limit(dup.position()+size);
}
- else if(isFull)
+ catch(IllegalArgumentException e)
{
- byte[] data = new byte[size];
- in.get(data);
- binaryStr = new BinaryString(data, 0, size);
-
- _cachedValues.put(binaryStr, str);
+ throw new IllegalArgumentException("position: " + dup.position() + "size: " + size + " capacity: " + dup.capacity());
}
+ CharBuffer charBuf = _charSet.decode(dup);
+
+ String str = charBuf.toString();
in.position(origPosition+size);
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/SymbolTypeConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/SymbolTypeConstructor.java
index 4049a40448..b846b16722 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/SymbolTypeConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/codec/SymbolTypeConstructor.java
@@ -32,8 +32,6 @@ public class SymbolTypeConstructor extends VariableWidthTypeConstructor
{
private static final Charset ASCII = Charset.forName("US-ASCII");
- private BinaryString _defaultBinaryString = new BinaryString();
-
private static final ConcurrentHashMap<BinaryString, Symbol> SYMBOL_MAP =
new ConcurrentHashMap<BinaryString, Symbol>(2048);
@@ -62,9 +60,7 @@ public class SymbolTypeConstructor extends VariableWidthTypeConstructor
size = in.getInt();
}
- _defaultBinaryString.setData(in.array(), in.arrayOffset()+in.position(), size);
-
- BinaryString binaryStr = _defaultBinaryString;
+ BinaryString binaryStr = new BinaryString(in.array(), in.arrayOffset()+in.position(), size);
Symbol symbolVal = SYMBOL_MAP.get(binaryStr);
if(symbolVal == null)
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/ConnectionHandler.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/ConnectionHandler.java
index f391cf3035..d4077e0f08 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/ConnectionHandler.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/ConnectionHandler.java
@@ -386,12 +386,14 @@ public class ConnectionHandler
private BytesSource _bytesSource;
private boolean _closed;
private ConnectionEndpoint _conn;
+ private SocketExceptionHandler _exceptionHandler;
- public BytesOutputHandler(OutputStream outputStream, BytesSource source, ConnectionEndpoint conn)
+ public BytesOutputHandler(OutputStream outputStream, BytesSource source, ConnectionEndpoint conn, SocketExceptionHandler exceptionHandler)
{
_outputStream = outputStream;
_bytesSource = source;
_conn = conn;
+ _exceptionHandler = exceptionHandler;
}
public void run()
@@ -421,7 +423,7 @@ public class ConnectionHandler
catch (IOException e)
{
_closed = true;
- e.printStackTrace(); //TODO
+ _exceptionHandler.processSocketException(e);
}
}
}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/FrameHandler.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/FrameHandler.java
index 99b25d4193..c98ebadaa6 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/FrameHandler.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/FrameHandler.java
@@ -184,7 +184,7 @@ public class FrameHandler implements ProtocolHandler
// type
int type = in.get() & 0xFF;
- int channel = in.getShort() & 0xFF;
+ int channel = in.getShort() & 0xFFFF;
if(type != 0 && type != 1)
{
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/SocketExceptionHandler.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/SocketExceptionHandler.java
new file mode 100644
index 0000000000..540aee0f8d
--- /dev/null
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/framing/SocketExceptionHandler.java
@@ -0,0 +1,31 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.amqp_1_0.framing;
+
+/**
+ * Callback interface for processing socket exceptions.
+ */
+public interface SocketExceptionHandler
+{
+
+ public void processSocketException(Exception exception);
+
+}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java
index ea3ad7606e..5775eb4c2e 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java
@@ -68,22 +68,22 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
private final Container _container;
private Principal _user;
- private static final short DEFAULT_CHANNEL_MAX = 255;
+ private static final short DEFAULT_CHANNEL_MAX = Integer.getInteger("amqp.channel_max", 255).shortValue();
private static final int DEFAULT_MAX_FRAME = Integer.getInteger("amqp.max_frame_size", 1 << 15);
private ConnectionState _state = ConnectionState.UNOPENED;
- private short _channelMax;
+ private short _channelMax = DEFAULT_CHANNEL_MAX;
private int _maxFrameSize = 4096;
private String _remoteContainerId;
private SocketAddress _remoteAddress;
// positioned by the *outgoing* channel
- private SessionEndpoint[] _sendingSessions = new SessionEndpoint[DEFAULT_CHANNEL_MAX + 1];
+ private SessionEndpoint[] _sendingSessions;
// positioned by the *incoming* channel
- private SessionEndpoint[] _receivingSessions = new SessionEndpoint[DEFAULT_CHANNEL_MAX + 1];
+ private SessionEndpoint[] _receivingSessions;
private boolean _closedForInput;
private boolean _closedForOutput;
@@ -165,7 +165,7 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
}
if (_state == ConnectionState.UNOPENED)
{
- sendOpen(DEFAULT_CHANNEL_MAX, DEFAULT_MAX_FRAME);
+ sendOpen(_channelMax, DEFAULT_MAX_FRAME);
_state = ConnectionState.AWAITING_OPEN;
}
}
@@ -183,10 +183,10 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
public synchronized SessionEndpoint createSession(String name)
{
// todo assert connection state
- SessionEndpoint endpoint = new SessionEndpoint(this);
short channel = getFirstFreeChannel();
if (channel != -1)
{
+ SessionEndpoint endpoint = new SessionEndpoint(this);
_sendingSessions[channel] = endpoint;
endpoint.setSendingChannel(channel);
Begin begin = new Begin();
@@ -196,13 +196,14 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
begin.setHandleMax(_handleMax);
send(channel, begin);
+ return endpoint;
}
else
{
- // todo error
+ // TODO - report error
+ return null;
}
- return endpoint;
}
@@ -235,7 +236,16 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
{
Open open = new Open();
- open.setChannelMax(UnsignedShort.valueOf(DEFAULT_CHANNEL_MAX));
+ if(_receivingSessions == null)
+ {
+ _receivingSessions = new SessionEndpoint[channelMax+1];
+ _sendingSessions = new SessionEndpoint[channelMax+1];
+ }
+ if(channelMax < _channelMax)
+ {
+ _channelMax = channelMax;
+ }
+ open.setChannelMax(UnsignedShort.valueOf(channelMax));
open.setContainerId(_container.getId());
open.setMaxFrameSize(getDesiredMaxFrameSize());
open.setHostname(getRemoteHostname());
@@ -268,7 +278,7 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
short getFirstFreeChannel()
{
- for (int i = 0; i < _sendingSessions.length; i++)
+ for (int i = 0; i <= _channelMax; i++)
{
if (_sendingSessions[i] == null)
{
@@ -288,10 +298,16 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
public synchronized void receiveOpen(short channel, Open open)
{
- _channelMax = open.getChannelMax() == null ? DEFAULT_CHANNEL_MAX
- : open.getChannelMax().shortValue() < DEFAULT_CHANNEL_MAX
- ? DEFAULT_CHANNEL_MAX
- : open.getChannelMax().shortValue();
+ _channelMax = open.getChannelMax() == null ? _channelMax
+ : open.getChannelMax().shortValue() < _channelMax
+ ? open.getChannelMax().shortValue()
+ : _channelMax;
+
+ if(_receivingSessions == null)
+ {
+ _receivingSessions = new SessionEndpoint[_channelMax+1];
+ _sendingSessions = new SessionEndpoint[_channelMax+1];
+ }
UnsignedInteger remoteDesiredMaxFrameSize =
open.getMaxFrameSize() == null ? UnsignedInteger.valueOf(DEFAULT_MAX_FRAME) : open.getMaxFrameSize();
@@ -380,13 +396,30 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
if (!_closedForInput)
{
_closedForInput = true;
- for (int i = 0; i < _receivingSessions.length; i++)
+ switch(_state)
+ {
+ case UNOPENED:
+ case AWAITING_OPEN:
+ case CLOSE_SENT:
+ _state = ConnectionState.CLOSED;
+ case OPEN:
+ _state = ConnectionState.CLOSE_RECEIVED;
+ case CLOSED:
+ // already sent our close - too late to do anything more
+ break;
+ default:
+ }
+
+ if(_receivingSessions != null)
{
- if (_receivingSessions[i] != null)
+ for (int i = 0; i < _receivingSessions.length; i++)
{
- _receivingSessions[i].end();
- _receivingSessions[i] = null;
+ if (_receivingSessions[i] != null)
+ {
+ _receivingSessions[i].end();
+ _receivingSessions[i] = null;
+ }
}
}
}
@@ -604,7 +637,6 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
}
}
-
public void invalidHeaderReceived()
{
// TODO
@@ -984,4 +1016,9 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour
{
return _remoteError;
}
+
+ public void setChannelMax(final short channelMax)
+ {
+ _channelMax = channelMax;
+ }
}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/LinkEndpoint.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/LinkEndpoint.java
index 3a7af39d8a..587d26026f 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/LinkEndpoint.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/LinkEndpoint.java
@@ -444,13 +444,25 @@ public abstract class LinkEndpoint<T extends LinkEventListener>
sendFlow(_flowTransactionId != null);
}
+ public void sendFlowWithEcho()
+ {
+ sendFlow(_flowTransactionId != null, true);
+ }
+
+
public void sendFlow(boolean setTransactionId)
{
+ sendFlow(setTransactionId, false);
+ }
+
+ public void sendFlow(boolean setTransactionId, boolean echo)
+ {
if(_state == State.ATTACHED || _state == State.ATTACH_SENT)
{
Flow flow = new Flow();
flow.setLinkCredit(_linkCredit);
flow.setDeliveryCount(_deliveryCount);
+ flow.setEcho(echo);
_lastSentCreditLimit = _linkCredit.add(_deliveryCount);
flow.setAvailable(_available);
flow.setDrain(_drain);
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ReceivingLinkEndpoint.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ReceivingLinkEndpoint.java
index e5019f9479..8a5940658c 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ReceivingLinkEndpoint.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ReceivingLinkEndpoint.java
@@ -288,7 +288,7 @@ public class ReceivingLinkEndpoint extends LinkEndpoint<ReceivingLinkListener>
setDrain(true);
_creditWindow = false;
_drainLimit = getDeliveryCount().add(getLinkCredit());
- sendFlow();
+ sendFlowWithEcho();
getLock().notifyAll();
}
}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
index 82e6216c21..ff886090be 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
@@ -49,6 +49,7 @@ import org.apache.qpid.amqp_1_0.codec.UnsignedShortWriter;
import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+import org.apache.qpid.amqp_1_0.type.Binary;
import org.apache.qpid.amqp_1_0.type.RestrictedType;
import org.apache.qpid.amqp_1_0.type.transport.*;
import org.apache.qpid.amqp_1_0.type.transport.codec.*;
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Source.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Source.java
index b634542fd6..e24fb1af7d 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Source.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Source.java
@@ -152,7 +152,7 @@ public class Source
return _outcomes;
}
- public void setOutcomes(Symbol[] outcomes)
+ public void setOutcomes(Symbol... outcomes)
{
_outcomes = outcomes;
}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java
index 8000853a4d..438378599e 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java
@@ -34,9 +34,10 @@ import java.util.List;
public class AcceptedConstructor extends DescribedTypeConstructor<Accepted>
{
+ public static final Symbol SYMBOL_CONSTRUCTOR = Symbol.valueOf("amqp:accepted:list");
private static final Object[] DESCRIPTORS =
{
- Symbol.valueOf("amqp:accepted:list"),UnsignedLong.valueOf(0x0000000000000024L),
+ SYMBOL_CONSTRUCTOR,UnsignedLong.valueOf(0x0000000000000024L),
};
private static final AcceptedConstructor INSTANCE = new AcceptedConstructor();
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java
index eb923c535d..d7713bbb52 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java
@@ -34,9 +34,10 @@ import java.util.List;
public class RejectedConstructor extends DescribedTypeConstructor<Rejected>
{
+ public static final Symbol SYMBOL_CONSTRUCTOR = Symbol.valueOf("amqp:rejected:list");
private static final Object[] DESCRIPTORS =
{
- Symbol.valueOf("amqp:rejected:list"),UnsignedLong.valueOf(0x0000000000000025L),
+ SYMBOL_CONSTRUCTOR,UnsignedLong.valueOf(0x0000000000000025L),
};
private static final RejectedConstructor INSTANCE = new RejectedConstructor();
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java
index 764fa222ee..be9b271f72 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java
@@ -231,7 +231,7 @@ public class SourceConstructor extends DescribedTypeConstructor<Source>
try
{
- obj.setDistributionMode( (DistributionMode) val );
+ obj.setDistributionMode( StdDistMode.valueOf(val) );
}
catch(ClassCastException e)
{
@@ -326,7 +326,7 @@ public class SourceConstructor extends DescribedTypeConstructor<Source>
// TODO Error
}
}
-
+
}
@@ -360,7 +360,7 @@ public class SourceConstructor extends DescribedTypeConstructor<Source>
// TODO Error
}
}
-
+
}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java
index 07f0496e23..8a2120a252 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java
@@ -43,6 +43,8 @@ public class ConnectionError
public static final ConnectionError REDIRECT = new ConnectionError(Symbol.valueOf("amqp:connection:redirect"));
+ public static final ConnectionError SOCKET_ERROR = new ConnectionError(Symbol.valueOf("amqp:connection:socket-error"));
+
private ConnectionError(Symbol val)
@@ -73,6 +75,11 @@ public class ConnectionError
return "redirect";
}
+ if(this == SOCKET_ERROR)
+ {
+ return "socket-error";
+ }
+
else
{
return String.valueOf(_val);
@@ -97,6 +104,11 @@ public class ConnectionError
{
return REDIRECT;
}
+
+ if(SOCKET_ERROR._val.equals(val))
+ {
+ return SOCKET_ERROR;
+ }
// TODO ERROR
return null;
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java
index 6d745adb7e..510170ae1f 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java
@@ -86,6 +86,10 @@ public class ErrorConstructor extends DescribedTypeConstructor<org.apache.qpid.a
if(condition == null)
{
condition = TransactionErrors.valueOf(val);
+ if(condition == null)
+ {
+ condition = new UnknownErrorCondition((Symbol)val);
+ }
}
}
}
@@ -166,4 +170,52 @@ public class ErrorConstructor extends DescribedTypeConstructor<org.apache.qpid.a
}
+ private static final class UnknownErrorCondition implements ErrorCondition
+ {
+ private final Symbol _value;
+
+ public UnknownErrorCondition(final Symbol value)
+ {
+ _value = value;
+ }
+
+ public Symbol getValue()
+ {
+ return _value;
+ }
+
+ @Override
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final UnknownErrorCondition that = (UnknownErrorCondition) o;
+
+ if (!_value.equals(that._value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return _value.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return _value.toString();
+ }
+ }
}
diff --git a/qpid/java/bdbstore/bin/backup.sh b/qpid/java/bdbstore/bin/backup.sh
index ba51758d3c..71935bac40 100755
--- a/qpid/java/bdbstore/bin/backup.sh
+++ b/qpid/java/bdbstore/bin/backup.sh
@@ -35,7 +35,7 @@ if [ -z "${QPID_HOME}" ]; then
fi
# BDB's je JAR expected to be found in lib/opt
-LIBS="${QPID_HOME}/lib/opt/*:${QPID_HOME}/lib/qpid-all.jar"
+LIBS="${QPID_HOME}/lib/*:${QPID_HOME}/lib/plugins/*:${QPID_HOME}/lib/opt/*"
echo "Starting Hot Backup Script"
java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBBackup "${ARGS[@]}"
diff --git a/qpid/java/bdbstore/build.xml b/qpid/java/bdbstore/build.xml
index a74457d9ad..975176c834 100644
--- a/qpid/java/bdbstore/build.xml
+++ b/qpid/java/bdbstore/build.xml
@@ -17,10 +17,10 @@
- under the License.
-->
<project name="bdbstore" xmlns:ivy="antlib:org.apache.ivy.ant" default="build">
- <property name="module.depends" value="common broker broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol" />
- <property name="module.test.depends" value="client common/tests broker/tests management/common systests broker-plugins/management-jmx broker-plugins/memory-store broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10" />
+ <property name="module.depends" value="common broker-core broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol" />
+ <property name="module.test.depends" value="client qpid-test-utils broker-core/tests management/common systests broker-plugins/management-jmx broker-plugins/memory-store broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided -Sje=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided -Sje=provided"/>
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/bdbstore/jmx/build.xml b/qpid/java/bdbstore/jmx/build.xml
index 898eac9070..544cdef2fc 100644
--- a/qpid/java/bdbstore/jmx/build.xml
+++ b/qpid/java/bdbstore/jmx/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="bdbstore-jmx" default="build">
- <property name="module.depends" value="common broker broker-plugins/management-jmx management/common bdbstore" />
- <property name="module.test.depends" value="broker/tests common/tests management/common client systests bdbstore/tests broker-plugins/memory-store" />
+ <property name="module.depends" value="common broker-core broker-plugins/management-jmx management/common bdbstore" />
+ <property name="module.test.depends" value="broker-core/tests qpid-test-utils management/common client systests bdbstore/tests broker-plugins/memory-store" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-broker-plugins-management-jmx=provided -Sqpid-management-common=provided -Sqpid-bdbstore=provided -Sje=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-broker-plugins-management-jmx=provided -Sqpid-management-common=provided -Sqpid-bdbstore=provided -Sje=provided"/>
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/bdbstore/jmx/pom.xml b/qpid/java/bdbstore/jmx/pom.xml
new file mode 100644
index 0000000000..3480460972
--- /dev/null
+++ b/qpid/java/bdbstore/jmx/pom.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-bdbstore-jmx</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-management-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sleepycat</groupId>
+ <artifactId>je</artifactId>
+ <version>5.0.84</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/bdbstore/pom.xml b/qpid/java/bdbstore/pom.xml
new file mode 100644
index 0000000000..8e71ee1b02
--- /dev/null
+++ b/qpid/java/bdbstore/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-bdbstore</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sleepycat</groupId>
+ <artifactId>je</artifactId>
+ <version>5.0.97</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
deleted file mode 100644
index 7c04d83e79..0000000000
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.server.store.berkeleydb;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.test.utils.Piper;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.util.FileUtils;
-
-/**
- * Tests the BDB backup script can successfully perform a backup and that
- * backup can be restored and used by the Broker.
- */
-public class BDBBackupTest extends QpidBrokerTestCase
-{
- protected static final Logger LOGGER = Logger.getLogger(BDBBackupTest.class);
-
- private static final String BACKUP_SCRIPT = "/bin/backup.sh";
- private static final String BACKUP_COMPLETE_MESSAGE = "Hot Backup Completed";
-
- private static final String TEST_VHOST = "test";
- private static final String SYSTEM_TMP_DIR = System.getProperty("java.io.tmpdir");
-
- private File _backupToDir;
- private File _backupFromDir;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- _backupToDir = new File(SYSTEM_TMP_DIR + File.separator + getTestName());
- _backupToDir.mkdirs();
-
- final String qpidWork = getBroker(DEFAULT_PORT).getWorkingDirectory();
-
- // It would be preferable to lookup the store path using #getConfigurationStringProperty("virtualhosts...")
- // but the config as known to QBTC does not pull-in the virtualhost section from its separate source file
- _backupFromDir = new File(qpidWork + File.separator + TEST_VHOST + "-store");
- boolean fromDirExistsAndIsDir = _backupFromDir.isDirectory();
- assertTrue("backupFromDir " + _backupFromDir + " should already exist", fromDirExistsAndIsDir);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- super.tearDown();
- }
- finally
- {
- FileUtils.delete(_backupToDir, true);
- }
- }
-
- public void testBackupAndRestoreMaintainsMessages() throws Exception
- {
- sendNumberedMessages(0, 10);
- invokeBdbBackup(_backupFromDir, _backupToDir);
- sendNumberedMessages(10, 20);
- confirmBrokerHasMessages(0, 20);
- stopBroker();
-
- deleteStore(_backupFromDir);
- replaceStoreWithBackup(_backupToDir, _backupFromDir);
-
- startBroker();
- confirmBrokerHasMessages(0, 10);
- }
-
- private void sendNumberedMessages(final int startIndex, final int endIndex) throws JMSException, Exception
- {
- Connection con = getConnection();
- Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Destination destination = session.createQueue(getTestQueueName());
- // Create queue by consumer side-effect
- session.createConsumer(destination).close();
-
- final int numOfMessages = endIndex - startIndex;
- final int batchSize = 0;
- sendMessage(session, destination, numOfMessages, startIndex, batchSize);
- con.close();
- }
-
- private void confirmBrokerHasMessages(final int startIndex, final int endIndex) throws Exception
- {
- Connection con = getConnection();
- Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- con.start();
- Destination destination = session.createQueue(getTestQueueName());
- MessageConsumer consumer = session.createConsumer(destination);
- for (int i = startIndex; i < endIndex; i++)
- {
- Message msg = consumer.receive(RECEIVE_TIMEOUT);
- assertNotNull("Message " + i + " not received", msg);
- assertEquals("Did not receive the expected message", i, msg.getIntProperty(INDEX));
- }
-
- Message msg = consumer.receive(100);
- if(msg != null)
- {
- fail("No more messages should be received, but received additional message with index: " + msg.getIntProperty(INDEX));
- }
- con.close();
- }
-
- private void invokeBdbBackup(final File backupFromDir, final File backupToDir) throws Exception
- {
- if (String.valueOf(System.getProperty("os.name")).toLowerCase().contains("windows"))
- {
- BDBBackup.main(new String[]{"-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath()});
- }
- else
- {
- runBdbBackupScript(backupFromDir, backupToDir);
- }
- }
-
- private void runBdbBackupScript(final File backupFromDir, final File backupToDir) throws IOException,
- InterruptedException
- {
- Process backupProcess = null;
- try
- {
- String qpidHome = System.getProperty(QPID_HOME);
- ProcessBuilder pb = new ProcessBuilder(qpidHome + BACKUP_SCRIPT, "-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath());
- pb.redirectErrorStream(true);
- Map<String, String> env = pb.environment();
- env.put(QPID_HOME, qpidHome);
-
- LOGGER.debug("Backup command is " + pb.command());
- backupProcess = pb.start();
- Piper piper = new Piper(backupProcess.getInputStream(), _testcaseOutputStream, null, BACKUP_COMPLETE_MESSAGE);
- piper.start();
- piper.await(2, TimeUnit.SECONDS);
- backupProcess.waitFor();
- piper.join();
-
- LOGGER.debug("Backup command completed " + backupProcess.exitValue());
- assertEquals("Unexpected exit value from backup script", 0, backupProcess.exitValue());
- }
- finally
- {
- if (backupProcess != null)
- {
- backupProcess.getErrorStream().close();
- backupProcess.getInputStream().close();
- backupProcess.getOutputStream().close();
- }
- }
- }
-
- private void replaceStoreWithBackup(File source, File dst) throws Exception
- {
- LOGGER.debug("Copying store " + source + " to " + dst);
- FileUtils.copyRecursive(source, dst);
- }
-
- private void deleteStore(File storeDir)
- {
- LOGGER.debug("Deleting store " + storeDir);
- FileUtils.delete(storeDir, true);
- }
-
-}
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java
index 63af8d3840..ed6024feb1 100644
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java
+++ b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgradeTestPreparer.java
@@ -293,7 +293,7 @@ public class BDBStoreUpgradeTestPreparer
connection.close();
}
- public static void sendMessages(Session session, MessageProducer messageProducer,
+ private static void sendMessages(Session session, MessageProducer messageProducer,
Destination dest, int deliveryMode, int length, int numMesages) throws JMSException
{
for (int i = 1; i <= numMesages; i++)
@@ -304,7 +304,7 @@ public class BDBStoreUpgradeTestPreparer
}
}
- public static void publishMessages(Session session, TopicPublisher publisher,
+ private static void publishMessages(Session session, TopicPublisher publisher,
Destination dest, int deliveryMode, int length, int numMesages, String selectorProperty) throws JMSException
{
for (int i = 1; i <= numMesages; i++)
@@ -322,7 +322,7 @@ public class BDBStoreUpgradeTestPreparer
* @param length number of characters in the string
* @return string sequence of the given length
*/
- public static String generateString(int length)
+ private static String generateString(int length)
{
char[] base_chars = new char[]{'0','1','2','3','4','5','6','7','8','9'};
char[] chars = new char[length];
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
deleted file mode 100644
index e4837b212e..0000000000
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.store.berkeleydb;
-
-
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.NON_DURABLE_QUEUE_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.PRIORITY_QUEUE_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.QUEUE_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.QUEUE_WITH_DLQ_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.SELECTOR_SUB_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.SELECTOR_TOPIC_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.SUB_NAME;
-import static org.apache.qpid.server.store.berkeleydb.BDBStoreUpgradeTestPreparer.TOPIC_NAME;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularDataSupport;
-
-import org.apache.qpid.management.common.mbeans.ManagedExchange;
-import org.apache.qpid.management.common.mbeans.ManagedQueue;
-import org.apache.qpid.test.utils.JMXTestUtils;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.util.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Tests upgrading a BDB store on broker startup.
- * The store will then be used to verify that the upgrade is completed
- * properly and that once upgraded it functions as expected.
- */
-public class BDBUpgradeTest extends QpidBrokerTestCase
-{
- protected static final Logger _logger = LoggerFactory.getLogger(BDBUpgradeTest.class);
-
- private static final String STRING_1024 = BDBStoreUpgradeTestPreparer.generateString(1024);
- private static final String STRING_1024_256 = BDBStoreUpgradeTestPreparer.generateString(1024*256);
- private static final String QPID_WORK_ORIG = System.getProperty("QPID_WORK");
-
- private String _storeLocation;
-
- @Override
- public void setUp() throws Exception
- {
- assertNotNull("QPID_WORK must be set", QPID_WORK_ORIG);
- _storeLocation = getWorkDirBaseDir() + File.separator + "test-store";
-
- //Clear the two target directories if they exist.
- File directory = new File(_storeLocation);
- if (directory.exists() && directory.isDirectory())
- {
- FileUtils.delete(directory, true);
- }
- directory.mkdirs();
-
- // copy store files
- InputStream src = getClass().getClassLoader().getResourceAsStream("upgrade/bdbstore-v4/test-store/00000000.jdb");
- FileUtils.copy(src, new File(_storeLocation, "00000000.jdb"));
-
- getBrokerConfiguration().addJmxManagementConfiguration();
- super.setUp();
- }
-
- private String getWorkDirBaseDir()
- {
- return QPID_WORK_ORIG + (isInternalBroker() ? "" : "/" + getPort());
- }
-
- /**
- * Test that the selector applied to the DurableSubscription was successfully
- * transfered to the new store, and functions as expected with continued use
- * by monitoring message count while sending new messages to the topic and then
- * consuming them.
- */
- public void testSelectorDurability() throws Exception
- {
- JMXTestUtils jmxUtils = null;
- try
- {
- jmxUtils = new JMXTestUtils(this, "guest", "guest");
- jmxUtils.open();
- }
- catch (Exception e)
- {
- fail("Unable to establish JMX connection, test cannot proceed");
- }
-
- try
- {
- ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SELECTOR_SUB_NAME);
- assertEquals("DurableSubscription backing queue should have 1 message on it initially",
- new Integer(1), dursubQueue.getMessageCount());
-
- // Create a connection and start it
- TopicConnection connection = (TopicConnection) getConnection();
- connection.start();
-
- // Send messages which don't match and do match the selector, checking message count
- TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
- Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
- TopicPublisher publisher = pubSession.createPublisher(topic);
-
- BDBStoreUpgradeTestPreparer.publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
- pubSession.commit();
- assertEquals("DurableSubscription backing queue should still have 1 message on it",
- Integer.valueOf(1), dursubQueue.getMessageCount());
-
- BDBStoreUpgradeTestPreparer.publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "true");
- pubSession.commit();
- assertEquals("DurableSubscription backing queue should now have 2 messages on it",
- Integer.valueOf(2), dursubQueue.getMessageCount());
-
- TopicSubscriber durSub = pubSession.createDurableSubscriber(topic, SELECTOR_SUB_NAME,"testprop='true'", false);
- Message m = durSub.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- m = durSub.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- pubSession.commit();
-
- pubSession.close();
- }
- finally
- {
- jmxUtils.close();
- }
- }
-
- /**
- * Test that the DurableSubscription without selector was successfully
- * transfered to the new store, and functions as expected with continued use.
- */
- public void testDurableSubscriptionWithoutSelector() throws Exception
- {
- JMXTestUtils jmxUtils = null;
- try
- {
- jmxUtils = new JMXTestUtils(this, "guest", "guest");
- jmxUtils.open();
- }
- catch (Exception e)
- {
- fail("Unable to establish JMX connection, test cannot proceed");
- }
-
- try
- {
- ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SUB_NAME);
- assertEquals("DurableSubscription backing queue should have 1 message on it initially",
- new Integer(1), dursubQueue.getMessageCount());
-
- // Create a connection and start it
- TopicConnection connection = (TopicConnection) getConnection();
- connection.start();
-
- // Send new message matching the topic, checking message count
- TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
- Topic topic = session.createTopic(TOPIC_NAME);
- TopicPublisher publisher = session.createPublisher(topic);
-
- BDBStoreUpgradeTestPreparer.publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
- session.commit();
- assertEquals("DurableSubscription backing queue should now have 2 messages on it",
- Integer.valueOf(2), dursubQueue.getMessageCount());
-
- TopicSubscriber durSub = session.createDurableSubscriber(topic, SUB_NAME);
- Message m = durSub.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- m = durSub.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
-
- session.commit();
- session.close();
- }
- finally
- {
- jmxUtils.close();
- }
- }
-
- /**
- * Test that the backing queue for the durable subscription created was successfully
- * detected and set as being exclusive during the upgrade process, and that the
- * regular queue was not.
- */
- public void testQueueExclusivity() throws Exception
- {
- JMXTestUtils jmxUtils = null;
- try
- {
- jmxUtils = new JMXTestUtils(this, "guest", "guest");
- jmxUtils.open();
- }
- catch (Exception e)
- {
- fail("Unable to establish JMX connection, test cannot proceed");
- }
-
- try
- {
- ManagedQueue queue = jmxUtils.getManagedQueue(QUEUE_NAME);
- assertFalse("Queue should not have been marked as Exclusive during upgrade", queue.isExclusive());
-
- ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SUB_NAME);
- assertTrue("DurableSubscription backing queue should have been marked as Exclusive during upgrade", dursubQueue.isExclusive());
- }
- finally
- {
- jmxUtils.close();
- }
- }
-
- /**
- * Test that the upgraded queue continues to function properly when used
- * for persistent messaging and restarting the broker.
- *
- * Sends the new messages to the queue BEFORE consuming those which were
- * sent before the upgrade. In doing so, this also serves to test that
- * the queue bindings were successfully transitioned during the upgrade.
- */
- public void testBindingAndMessageDurabability() throws Exception
- {
- // Create a connection and start it
- TopicConnection connection = (TopicConnection) getConnection();
- connection.start();
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = session.createQueue(QUEUE_NAME);
- MessageProducer messageProducer = session.createProducer(queue);
-
- // Send a new message
- BDBStoreUpgradeTestPreparer.sendMessages(session, messageProducer, queue, DeliveryMode.PERSISTENT, 256*1024, 1);
-
- session.close();
-
- // Restart the broker
- restartBroker();
-
- // Drain the queue of all messages
- connection = (TopicConnection) getConnection();
- connection.start();
- consumeQueueMessages(connection, true);
- }
-
- /**
- * Test that all of the committed persistent messages previously sent to
- * the broker are properly received following update of the MetaData and
- * Content entries during the store upgrade process.
- */
- public void testConsumptionOfUpgradedMessages() throws Exception
- {
- // Create a connection and start it
- Connection connection = getConnection();
- connection.start();
-
- consumeDurableSubscriptionMessages(connection, true);
- consumeDurableSubscriptionMessages(connection, false);
- consumeQueueMessages(connection, false);
- }
-
- /**
- * Tests store migration containing messages for non-existing queue.
- *
- * @throws Exception
- */
- public void testMigrationOfMessagesForNonDurableQueues() throws Exception
- {
- // Create a connection and start it
- Connection connection = getConnection();
- connection.start();
-
- // consume a message for non-existing store
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = session.createQueue(NON_DURABLE_QUEUE_NAME);
- MessageConsumer messageConsumer = session.createConsumer(queue);
-
- for (int i = 1; i <= 3; i++)
- {
- Message message = messageConsumer.receive(1000);
- assertNotNull("Message was not migrated!", message);
- assertTrue("Unexpected message received!", message instanceof TextMessage);
- assertEquals("ID property did not match", i, message.getIntProperty("ID"));
- }
- }
-
- /**
- * Tests store upgrade has maintained the priority queue configuration,
- * such that sending messages with priorities out-of-order and then consuming
- * them gets the messages back in priority order.
- */
- public void testPriorityQueue() throws Exception
- {
- // Create a connection and start it
- Connection connection = getConnection();
- connection.start();
-
- // send some messages to the priority queue
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = session.createQueue(PRIORITY_QUEUE_NAME);
- MessageProducer producer = session.createProducer(queue);
-
- producer.setPriority(4);
- producer.send(createMessage(1, false, session, producer));
- producer.setPriority(1);
- producer.send(createMessage(2, false, session, producer));
- producer.setPriority(9);
- producer.send(createMessage(3, false, session, producer));
- session.close();
-
- //consume the messages, expected order: msg 3, msg 1, msg 2.
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer consumer = session.createConsumer(queue);
-
- Message msg = consumer.receive(1500);
- assertNotNull("expected message was not received", msg);
- assertEquals(3, msg.getIntProperty("msg"));
- msg = consumer.receive(1500);
- assertNotNull("expected message was not received", msg);
- assertEquals(1, msg.getIntProperty("msg"));
- msg = consumer.receive(1500);
- assertNotNull("expected message was not received", msg);
- assertEquals(2, msg.getIntProperty("msg"));
- }
-
- /**
- * Test that the queue configured to have a DLQ was recovered and has the alternate exchange
- * and max delivery count, the DLE exists, the DLQ exists with no max delivery count, the
- * DLQ is bound to the DLE, and that the DLQ does not itself have a DLQ.
- *
- * DLQs are NOT enabled at the virtualhost level, we are testing recovery of the arguments
- * that turned it on for this specific queue.
- */
- public void testRecoveryOfQueueWithDLQ() throws Exception
- {
- JMXTestUtils jmxUtils = null;
- try
- {
- jmxUtils = new JMXTestUtils(this, "guest", "guest");
- jmxUtils.open();
- }
- catch (Exception e)
- {
- fail("Unable to establish JMX connection, test cannot proceed");
- }
-
- try
- {
- //verify the DLE exchange exists, has the expected type, and a single binding for the DLQ
- ManagedExchange exchange = jmxUtils.getManagedExchange(QUEUE_WITH_DLQ_NAME + "_DLE");
- assertEquals("Wrong exchange type", "fanout", exchange.getExchangeType());
- TabularDataSupport bindings = (TabularDataSupport) exchange.bindings();
- assertEquals(1, bindings.size());
- for(Object o : bindings.values())
- {
- CompositeData binding = (CompositeData) o;
-
- String bindingKey = (String) binding.get(ManagedExchange.BINDING_KEY);
- String[] queueNames = (String[]) binding.get(ManagedExchange.QUEUE_NAMES);
-
- //Because its a fanout exchange, we just return a single '*' key with all bound queues
- assertEquals("unexpected binding key", "*", bindingKey);
- assertEquals("unexpected number of queues bound", 1, queueNames.length);
- assertEquals("unexpected queue name", QUEUE_WITH_DLQ_NAME + "_DLQ", queueNames[0]);
- }
-
- //verify the queue exists, has the expected alternate exchange and max delivery count
- ManagedQueue queue = jmxUtils.getManagedQueue(QUEUE_WITH_DLQ_NAME);
- assertEquals("Queue does not have the expected AlternateExchange", QUEUE_WITH_DLQ_NAME + "_DLE", queue.getAlternateExchange());
- assertEquals("Unexpected maximum delivery count", Integer.valueOf(2), queue.getMaximumDeliveryCount());
-
- ManagedQueue dlQqueue = jmxUtils.getManagedQueue(QUEUE_WITH_DLQ_NAME + "_DLQ");
- assertNull("Queue should not have an AlternateExchange", dlQqueue.getAlternateExchange());
- assertEquals("Unexpected maximum delivery count", Integer.valueOf(0), dlQqueue.getMaximumDeliveryCount());
-
- String dlqDlqObjectNameString = jmxUtils.getQueueObjectNameString("test", QUEUE_WITH_DLQ_NAME + "_DLQ" + "_DLQ");
- assertFalse("a DLQ should not exist for the DLQ itself", jmxUtils.doesManagedObjectExist(dlqDlqObjectNameString));
- }
- finally
- {
- jmxUtils.close();
- }
- }
-
- private void consumeDurableSubscriptionMessages(Connection connection, boolean selector) throws Exception
- {
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Topic topic = null;
- TopicSubscriber durSub = null;
-
- if(selector)
- {
- topic = session.createTopic(SELECTOR_TOPIC_NAME);
- durSub = session.createDurableSubscriber(topic, SELECTOR_SUB_NAME,"testprop='true'", false);
- }
- else
- {
- topic = session.createTopic(TOPIC_NAME);
- durSub = session.createDurableSubscriber(topic, SUB_NAME);
- }
-
-
- // Retrieve the matching message
- Message m = durSub.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- if(selector)
- {
- assertEquals("Selector property did not match", "true", m.getStringProperty("testprop"));
- }
- assertEquals("ID property did not match", 1, m.getIntProperty("ID"));
- assertEquals("Message content was not as expected",BDBStoreUpgradeTestPreparer.generateString(1024) , ((TextMessage)m).getText());
-
- // Verify that no more messages are received
- m = durSub.receive(1000);
- assertNull("No more messages should have been recieved", m);
-
- durSub.close();
- session.close();
- }
-
- private void consumeQueueMessages(Connection connection, boolean extraMessage) throws Exception
- {
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = session.createQueue(QUEUE_NAME);
-
- MessageConsumer consumer = session.createConsumer(queue);
- Message m;
-
- // Retrieve the initial pre-upgrade messages
- for (int i=1; i <= 5 ; i++)
- {
- m = consumer.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- assertEquals("ID property did not match", i, m.getIntProperty("ID"));
- assertEquals("Message content was not as expected", STRING_1024_256, ((TextMessage)m).getText());
- }
- for (int i=1; i <= 5 ; i++)
- {
- m = consumer.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- assertEquals("ID property did not match", i, m.getIntProperty("ID"));
- assertEquals("Message content was not as expected", STRING_1024, ((TextMessage)m).getText());
- }
-
- if(extraMessage)
- {
- //verify that the extra message is received
- m = consumer.receive(2000);
- assertNotNull("Failed to receive an expected message", m);
- assertEquals("ID property did not match", 1, m.getIntProperty("ID"));
- assertEquals("Message content was not as expected", STRING_1024_256, ((TextMessage)m).getText());
- }
-
- // Verify that no more messages are received
- m = consumer.receive(1000);
- assertNull("No more messages should have been recieved", m);
-
- consumer.close();
- session.close();
- }
-
- private Message createMessage(int msgId, boolean first, Session producerSession, MessageProducer producer) throws JMSException
- {
- Message send = producerSession.createTextMessage("Message: " + msgId);
- send.setIntProperty("msg", msgId);
-
- return send;
- }
-}
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java b/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java
deleted file mode 100644
index 0e1ef7b25d..0000000000
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.store.berkeleydb;
-
-import java.io.File;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.jms.Connection;
-import javax.jms.Session;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.test.utils.TestUtils;
-
-import com.sleepycat.je.rep.ReplicationConfig;
-
-/**
- * The HA black box tests test the BDB cluster as a opaque unit. Client connects to
- * the cluster via a failover url
- *
- * @see HAClusterWhiteboxTest
- */
-public class HAClusterBlackboxTest extends QpidBrokerTestCase
-{
- protected static final Logger LOGGER = Logger.getLogger(HAClusterBlackboxTest.class);
-
- private static final String VIRTUAL_HOST = "test";
- private static final int NUMBER_OF_NODES = 3;
-
- private final HATestClusterCreator _clusterCreator = new HATestClusterCreator(this, VIRTUAL_HOST, NUMBER_OF_NODES);
-
- private FailoverAwaitingListener _failoverAwaitingListener;
- private ConnectionURL _brokerFailoverUrl;
-
- @Override
- protected void setUp() throws Exception
- {
- _brokerType = BrokerType.SPAWNED;
-
- assertTrue(isJavaBroker());
- assertTrue(isBrokerStorePersistent());
-
- setSystemProperty("java.util.logging.config.file", "etc" + File.separator + "log.properties");
-
- _clusterCreator.configureClusterNodes();
-
- _brokerFailoverUrl = _clusterCreator.getConnectionUrlForAllClusterNodes();
-
- _clusterCreator.startCluster();
- _failoverAwaitingListener = new FailoverAwaitingListener();
-
- super.setUp();
- }
-
- @Override
- public void startBroker() throws Exception
- {
- // Don't start default broker provided by QBTC.
- }
-
- public void testLossOfMasterNodeCausesClientToFailover() throws Exception
- {
- final Connection connection = getConnection(_brokerFailoverUrl);
-
- ((AMQConnection)connection).setConnectionListener(_failoverAwaitingListener);
-
- final int activeBrokerPort = _clusterCreator.getBrokerPortNumberFromConnection(connection);
- LOGGER.info("Active connection port " + activeBrokerPort);
-
- _clusterCreator.stopNode(activeBrokerPort);
- LOGGER.info("Node is stopped");
- _failoverAwaitingListener.assertFailoverOccurs(20000);
- LOGGER.info("Listener has finished");
- // any op to ensure connection remains
- connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- public void testLossOfReplicaNodeDoesNotCauseClientToFailover() throws Exception
- {
- LOGGER.info("Connecting to " + _brokerFailoverUrl);
- final Connection connection = getConnection(_brokerFailoverUrl);
- LOGGER.info("Got connection to cluster");
-
- ((AMQConnection)connection).setConnectionListener(_failoverAwaitingListener);
- final int activeBrokerPort = _clusterCreator.getBrokerPortNumberFromConnection(connection);
- LOGGER.info("Active connection port " + activeBrokerPort);
- final int inactiveBrokerPort = _clusterCreator.getPortNumberOfAnInactiveBroker(connection);
-
- LOGGER.info("Stopping inactive broker on port " + inactiveBrokerPort);
-
- _clusterCreator.stopNode(inactiveBrokerPort);
-
- _failoverAwaitingListener.assertFailoverDoesNotOccur(2000);
-
- // any op to ensure connection remains
- connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- private final class FailoverAwaitingListener implements ConnectionListener
- {
- private final CountDownLatch _failoverLatch = new CountDownLatch(1);
-
- @Override
- public boolean preResubscribe()
- {
- return true;
- }
-
- @Override
- public boolean preFailover(boolean redirect)
- {
- return true;
- }
-
- public void assertFailoverOccurs(long delay) throws InterruptedException
- {
- if (!_failoverLatch.await(delay, TimeUnit.MILLISECONDS))
- {
- LOGGER.warn("Test thread dump:\n\n" + TestUtils.dumpThreads() + "\n");
- }
- assertEquals("Failover did not occur", 0, _failoverLatch.getCount());
- }
-
- public void assertFailoverDoesNotOccur(long delay) throws InterruptedException
- {
- _failoverLatch.await(delay, TimeUnit.MILLISECONDS);
- assertEquals("Failover occurred unexpectedly", 1L, _failoverLatch.getCount());
- }
-
-
- @Override
- public void failoverComplete()
- {
- _failoverLatch.countDown();
- }
-
- @Override
- public void bytesSent(long count)
- {
- }
-
- @Override
- public void bytesReceived(long count)
- {
- }
- }
-
-}
diff --git a/qpid/java/bdbstore/systests/build.xml b/qpid/java/bdbstore/systests/build.xml
new file mode 100644
index 0000000000..ca809ad0cb
--- /dev/null
+++ b/qpid/java/bdbstore/systests/build.xml
@@ -0,0 +1,28 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+nn - or more contributor license agreements. See the NOTICE file
+ -n 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.
+ -
+ -->
+<project name="BDBStoreSystemTests" default="build">
+ <property name="module.depends" value="qpid-test-utils systests client management/common broker-core broker-core/tests common amqp-1-0-common common/tests jca ra broker-plugins/access-control broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store broker-plugins/derby-store broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 bdbstore bdbstore/jmx"/>
+ <property name="module.test.src" location="src/main/java"/>
+
+ <import file="../../module.xml"/>
+
+ <property name="module.src.resources.extra" location="../src/test/resources"/>
+</project>
diff --git a/qpid/java/bdbstore/systests/pom.xml b/qpid/java/bdbstore/systests/pom.xml
new file mode 100644
index 0000000000..5660b47085
--- /dev/null
+++ b/qpid/java/bdbstore/systests/pom.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-bdbstore-systests</artifactId>
+
+ <properties>
+ <broker.home.dir>target/qpid-broker/${project.version}</broker.home.dir>
+ <!-- test properties -->
+ <qpid.home>${basedir}/${broker.home.dir}</qpid.home>
+ <qpid.home.qbtc.output>${qpid.home}/qbtc-output</qpid.home.qbtc.output>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit-version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-systests</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sleepycat</groupId>
+ <artifactId>je</artifactId>
+ <version>5.0.84</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testSourceDirectory>src/main/java</testSourceDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <workingDirectory>${basedir}/../..</workingDirectory>
+ <!-- Skip the default test phase, bind to the
+ integration-test phase below instead -->
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <!-- copy the systests config files into the ${qpid.home}/etc
+ directory where the tests expect them -->
+ <execution>
+ <id>copy-systests-etc-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/../../systests</directory>
+ <includes>
+ <include>etc/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <!-- copy the ../test-profiles directory into ${qpid.home}/..
+ directory where the tests expect it -->
+ <execution>
+ <id>copy-test-profile-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}/..</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/../..</directory>
+ <includes>
+ <include>test-profiles/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>extract-broker-distribution</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputAbsoluteArtifactFilename>false</outputAbsoluteArtifactFilename>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker</artifactId>
+ <version>${project.version}</version>
+ <classifier>bin</classifier>
+ <type>tar.gz</type>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
new file mode 100644
index 0000000000..73eaf363ad
--- /dev/null
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.test.utils.Piper;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.util.FileUtils;
+
+/**
+ * Tests the BDB backup script can successfully perform a backup and that
+ * backup can be restored and used by the Broker.
+ */
+public class BDBBackupTest extends QpidBrokerTestCase
+{
+ protected static final Logger LOGGER = Logger.getLogger(BDBBackupTest.class);
+
+ private static final String BACKUP_SCRIPT = "/bin/backup.sh";
+ private static final String BACKUP_COMPLETE_MESSAGE = "Hot Backup Completed";
+
+ private static final String TEST_VHOST = "test";
+ private static final String SYSTEM_TMP_DIR = System.getProperty("java.io.tmpdir");
+
+ private File _backupToDir;
+ private File _backupFromDir;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ _backupToDir = new File(SYSTEM_TMP_DIR + File.separator + getTestName());
+ _backupToDir.mkdirs();
+
+ final String qpidWork = getBroker(DEFAULT_PORT).getWorkingDirectory();
+
+ // It would be preferable to lookup the store path using #getConfigurationStringProperty("virtualhosts...")
+ // but the config as known to QBTC does not pull-in the virtualhost section from its separate source file
+ _backupFromDir = new File(qpidWork + File.separator + TEST_VHOST + "-store");
+ boolean fromDirExistsAndIsDir = _backupFromDir.isDirectory();
+ assertTrue("backupFromDir " + _backupFromDir + " should already exist", fromDirExistsAndIsDir);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ super.tearDown();
+ }
+ finally
+ {
+ FileUtils.delete(_backupToDir, true);
+ }
+ }
+
+ public void testBackupAndRestoreMaintainsMessages() throws Exception
+ {
+ sendNumberedMessages(0, 10);
+ invokeBdbBackup(_backupFromDir, _backupToDir);
+ sendNumberedMessages(10, 20);
+ confirmBrokerHasMessages(0, 20);
+ stopBroker();
+
+ deleteStore(_backupFromDir);
+ replaceStoreWithBackup(_backupToDir, _backupFromDir);
+
+ startBroker();
+ confirmBrokerHasMessages(0, 10);
+ }
+
+ private void sendNumberedMessages(final int startIndex, final int endIndex) throws JMSException, Exception
+ {
+ Connection con = getConnection();
+ Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Destination destination = session.createQueue(getTestQueueName());
+ // Create queue by consumer side-effect
+ session.createConsumer(destination).close();
+
+ final int numOfMessages = endIndex - startIndex;
+ final int batchSize = 0;
+ sendMessage(session, destination, numOfMessages, startIndex, batchSize);
+ con.close();
+ }
+
+ private void confirmBrokerHasMessages(final int startIndex, final int endIndex) throws Exception
+ {
+ Connection con = getConnection();
+ Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ con.start();
+ Destination destination = session.createQueue(getTestQueueName());
+ MessageConsumer consumer = session.createConsumer(destination);
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ Message msg = consumer.receive(RECEIVE_TIMEOUT);
+ assertNotNull("Message " + i + " not received", msg);
+ assertEquals("Did not receive the expected message", i, msg.getIntProperty(INDEX));
+ }
+
+ Message msg = consumer.receive(100);
+ if(msg != null)
+ {
+ fail("No more messages should be received, but received additional message with index: " + msg.getIntProperty(INDEX));
+ }
+ con.close();
+ }
+
+ private void invokeBdbBackup(final File backupFromDir, final File backupToDir) throws Exception
+ {
+ if (IS_OS_WINDOWS)
+ {
+ BDBBackup.main(new String[]{"-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath()});
+ }
+ else
+ {
+ runBdbBackupScript(backupFromDir, backupToDir);
+ }
+ }
+
+ private void runBdbBackupScript(final File backupFromDir, final File backupToDir) throws IOException,
+ InterruptedException
+ {
+ Process backupProcess = null;
+ try
+ {
+ String qpidHome = System.getProperty(QPID_HOME);
+ ProcessBuilder pb = new ProcessBuilder(qpidHome + BACKUP_SCRIPT, "-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath());
+ pb.redirectErrorStream(true);
+ Map<String, String> env = pb.environment();
+ env.put(QPID_HOME, qpidHome);
+
+ LOGGER.debug("Backup command is " + pb.command());
+ backupProcess = pb.start();
+ Piper piper = new Piper(backupProcess.getInputStream(), _testcaseOutputStream, null, BACKUP_COMPLETE_MESSAGE);
+ piper.start();
+ piper.await(2, TimeUnit.SECONDS);
+ backupProcess.waitFor();
+ piper.join();
+
+ LOGGER.debug("Backup command completed " + backupProcess.exitValue());
+ assertEquals("Unexpected exit value from backup script", 0, backupProcess.exitValue());
+ }
+ finally
+ {
+ if (backupProcess != null)
+ {
+ backupProcess.getErrorStream().close();
+ backupProcess.getInputStream().close();
+ backupProcess.getOutputStream().close();
+ }
+ }
+ }
+
+ private void replaceStoreWithBackup(File source, File dst) throws Exception
+ {
+ LOGGER.debug("Copying store " + source + " to " + dst);
+ FileUtils.copyRecursive(source, dst);
+ }
+
+ private void deleteStore(File storeDir)
+ {
+ LOGGER.debug("Deleting store " + storeDir);
+ FileUtils.delete(storeDir, true);
+ }
+
+}
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java
index 76b990038d..76b990038d 100644
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java
diff --git a/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
new file mode 100644
index 0000000000..755168ca9c
--- /dev/null
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
@@ -0,0 +1,544 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularDataSupport;
+
+import org.apache.qpid.management.common.mbeans.ManagedExchange;
+import org.apache.qpid.management.common.mbeans.ManagedQueue;
+import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Tests upgrading a BDB store on broker startup.
+ * The store will then be used to verify that the upgrade is completed
+ * properly and that once upgraded it functions as expected.
+ *
+ * Store prepared using old client/broker with BDBStoreUpgradeTestPreparer.
+ */
+public class BDBUpgradeTest extends QpidBrokerTestCase
+{
+ protected static final Logger _logger = LoggerFactory.getLogger(BDBUpgradeTest.class);
+
+ private static final String QPID_WORK_ORIG = System.getProperty("QPID_WORK");
+
+ private static final String STRING_1024 = generateString(1024);
+ private static final String STRING_1024_256 = generateString(1024*256);
+
+ private static final String TOPIC_NAME="myUpgradeTopic";
+ private static final String SUB_NAME="myDurSubName";
+ private static final String SELECTOR_SUB_NAME="mySelectorDurSubName";
+ private static final String SELECTOR_TOPIC_NAME="mySelectorUpgradeTopic";
+ private static final String QUEUE_NAME="myUpgradeQueue";
+ private static final String NON_DURABLE_QUEUE_NAME="queue-non-durable";
+ private static final String PRIORITY_QUEUE_NAME="myPriorityQueue";
+ private static final String QUEUE_WITH_DLQ_NAME="myQueueWithDLQ";
+
+ private String _storeLocation;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ assertNotNull("QPID_WORK must be set", QPID_WORK_ORIG);
+ _storeLocation = getWorkDirBaseDir() + File.separator + "test-store";
+
+ //Clear the two target directories if they exist.
+ File directory = new File(_storeLocation);
+ if (directory.exists() && directory.isDirectory())
+ {
+ FileUtils.delete(directory, true);
+ }
+ directory.mkdirs();
+
+ // copy store files
+ InputStream src = getClass().getClassLoader().getResourceAsStream("upgrade/bdbstore-v4/test-store/00000000.jdb");
+ FileUtils.copy(src, new File(_storeLocation, "00000000.jdb"));
+
+ getBrokerConfiguration().addJmxManagementConfiguration();
+ super.setUp();
+ }
+
+ private String getWorkDirBaseDir()
+ {
+ return QPID_WORK_ORIG + (isInternalBroker() ? "" : "/" + getPort());
+ }
+
+ /**
+ * Test that the selector applied to the DurableSubscription was successfully
+ * transfered to the new store, and functions as expected with continued use
+ * by monitoring message count while sending new messages to the topic and then
+ * consuming them.
+ */
+ public void testSelectorDurability() throws Exception
+ {
+ JMXTestUtils jmxUtils = null;
+ try
+ {
+ jmxUtils = new JMXTestUtils(this, "guest", "guest");
+ jmxUtils.open();
+ }
+ catch (Exception e)
+ {
+ fail("Unable to establish JMX connection, test cannot proceed");
+ }
+
+ try
+ {
+ ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SELECTOR_SUB_NAME);
+ assertEquals("DurableSubscription backing queue should have 1 message on it initially",
+ new Integer(1), dursubQueue.getMessageCount());
+
+ // Create a connection and start it
+ TopicConnection connection = (TopicConnection) getConnection();
+ connection.start();
+
+ // Send messages which don't match and do match the selector, checking message count
+ TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
+ Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
+ TopicPublisher publisher = pubSession.createPublisher(topic);
+
+ publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
+ pubSession.commit();
+ assertEquals("DurableSubscription backing queue should still have 1 message on it",
+ Integer.valueOf(1), dursubQueue.getMessageCount());
+
+ publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "true");
+ pubSession.commit();
+ assertEquals("DurableSubscription backing queue should now have 2 messages on it",
+ Integer.valueOf(2), dursubQueue.getMessageCount());
+
+ TopicSubscriber durSub = pubSession.createDurableSubscriber(topic, SELECTOR_SUB_NAME,"testprop='true'", false);
+ Message m = durSub.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ m = durSub.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ pubSession.commit();
+
+ pubSession.close();
+ }
+ finally
+ {
+ jmxUtils.close();
+ }
+ }
+
+ /**
+ * Test that the DurableSubscription without selector was successfully
+ * transfered to the new store, and functions as expected with continued use.
+ */
+ public void testDurableSubscriptionWithoutSelector() throws Exception
+ {
+ JMXTestUtils jmxUtils = null;
+ try
+ {
+ jmxUtils = new JMXTestUtils(this, "guest", "guest");
+ jmxUtils.open();
+ }
+ catch (Exception e)
+ {
+ fail("Unable to establish JMX connection, test cannot proceed");
+ }
+
+ try
+ {
+ ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SUB_NAME);
+ assertEquals("DurableSubscription backing queue should have 1 message on it initially",
+ new Integer(1), dursubQueue.getMessageCount());
+
+ // Create a connection and start it
+ TopicConnection connection = (TopicConnection) getConnection();
+ connection.start();
+
+ // Send new message matching the topic, checking message count
+ TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
+ Topic topic = session.createTopic(TOPIC_NAME);
+ TopicPublisher publisher = session.createPublisher(topic);
+
+ publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
+ session.commit();
+ assertEquals("DurableSubscription backing queue should now have 2 messages on it",
+ Integer.valueOf(2), dursubQueue.getMessageCount());
+
+ TopicSubscriber durSub = session.createDurableSubscriber(topic, SUB_NAME);
+ Message m = durSub.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ m = durSub.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+
+ session.commit();
+ session.close();
+ }
+ finally
+ {
+ jmxUtils.close();
+ }
+ }
+
+ /**
+ * Test that the backing queue for the durable subscription created was successfully
+ * detected and set as being exclusive during the upgrade process, and that the
+ * regular queue was not.
+ */
+ public void testQueueExclusivity() throws Exception
+ {
+ JMXTestUtils jmxUtils = null;
+ try
+ {
+ jmxUtils = new JMXTestUtils(this, "guest", "guest");
+ jmxUtils.open();
+ }
+ catch (Exception e)
+ {
+ fail("Unable to establish JMX connection, test cannot proceed");
+ }
+
+ try
+ {
+ ManagedQueue queue = jmxUtils.getManagedQueue(QUEUE_NAME);
+ assertFalse("Queue should not have been marked as Exclusive during upgrade", queue.isExclusive());
+
+ ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + ":" + SUB_NAME);
+ assertTrue("DurableSubscription backing queue should have been marked as Exclusive during upgrade", dursubQueue.isExclusive());
+ }
+ finally
+ {
+ jmxUtils.close();
+ }
+ }
+
+ /**
+ * Test that the upgraded queue continues to function properly when used
+ * for persistent messaging and restarting the broker.
+ *
+ * Sends the new messages to the queue BEFORE consuming those which were
+ * sent before the upgrade. In doing so, this also serves to test that
+ * the queue bindings were successfully transitioned during the upgrade.
+ */
+ public void testBindingAndMessageDurabability() throws Exception
+ {
+ // Create a connection and start it
+ TopicConnection connection = (TopicConnection) getConnection();
+ connection.start();
+
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = session.createQueue(QUEUE_NAME);
+ MessageProducer messageProducer = session.createProducer(queue);
+
+ // Send a new message
+ sendMessages(session, messageProducer, queue, DeliveryMode.PERSISTENT, 256*1024, 1);
+
+ session.close();
+
+ // Restart the broker
+ restartBroker();
+
+ // Drain the queue of all messages
+ connection = (TopicConnection) getConnection();
+ connection.start();
+ consumeQueueMessages(connection, true);
+ }
+
+ /**
+ * Test that all of the committed persistent messages previously sent to
+ * the broker are properly received following update of the MetaData and
+ * Content entries during the store upgrade process.
+ */
+ public void testConsumptionOfUpgradedMessages() throws Exception
+ {
+ // Create a connection and start it
+ Connection connection = getConnection();
+ connection.start();
+
+ consumeDurableSubscriptionMessages(connection, true);
+ consumeDurableSubscriptionMessages(connection, false);
+ consumeQueueMessages(connection, false);
+ }
+
+ /**
+ * Tests store migration containing messages for non-existing queue.
+ *
+ * @throws Exception
+ */
+ public void testMigrationOfMessagesForNonDurableQueues() throws Exception
+ {
+ // Create a connection and start it
+ Connection connection = getConnection();
+ connection.start();
+
+ // consume a message for non-existing store
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = session.createQueue(NON_DURABLE_QUEUE_NAME);
+ MessageConsumer messageConsumer = session.createConsumer(queue);
+
+ for (int i = 1; i <= 3; i++)
+ {
+ Message message = messageConsumer.receive(1000);
+ assertNotNull("Message was not migrated!", message);
+ assertTrue("Unexpected message received!", message instanceof TextMessage);
+ assertEquals("ID property did not match", i, message.getIntProperty("ID"));
+ }
+ }
+
+ /**
+ * Tests store upgrade has maintained the priority queue configuration,
+ * such that sending messages with priorities out-of-order and then consuming
+ * them gets the messages back in priority order.
+ */
+ public void testPriorityQueue() throws Exception
+ {
+ // Create a connection and start it
+ Connection connection = getConnection();
+ connection.start();
+
+ // send some messages to the priority queue
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = session.createQueue(PRIORITY_QUEUE_NAME);
+ MessageProducer producer = session.createProducer(queue);
+
+ producer.setPriority(4);
+ producer.send(createMessage(1, false, session, producer));
+ producer.setPriority(1);
+ producer.send(createMessage(2, false, session, producer));
+ producer.setPriority(9);
+ producer.send(createMessage(3, false, session, producer));
+ session.close();
+
+ //consume the messages, expected order: msg 3, msg 1, msg 2.
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ Message msg = consumer.receive(1500);
+ assertNotNull("expected message was not received", msg);
+ assertEquals(3, msg.getIntProperty("msg"));
+ msg = consumer.receive(1500);
+ assertNotNull("expected message was not received", msg);
+ assertEquals(1, msg.getIntProperty("msg"));
+ msg = consumer.receive(1500);
+ assertNotNull("expected message was not received", msg);
+ assertEquals(2, msg.getIntProperty("msg"));
+ }
+
+ /**
+ * Test that the queue configured to have a DLQ was recovered and has the alternate exchange
+ * and max delivery count, the DLE exists, the DLQ exists with no max delivery count, the
+ * DLQ is bound to the DLE, and that the DLQ does not itself have a DLQ.
+ *
+ * DLQs are NOT enabled at the virtualhost level, we are testing recovery of the arguments
+ * that turned it on for this specific queue.
+ */
+ public void testRecoveryOfQueueWithDLQ() throws Exception
+ {
+ JMXTestUtils jmxUtils = null;
+ try
+ {
+ jmxUtils = new JMXTestUtils(this, "guest", "guest");
+ jmxUtils.open();
+ }
+ catch (Exception e)
+ {
+ fail("Unable to establish JMX connection, test cannot proceed");
+ }
+
+ try
+ {
+ //verify the DLE exchange exists, has the expected type, and a single binding for the DLQ
+ ManagedExchange exchange = jmxUtils.getManagedExchange(QUEUE_WITH_DLQ_NAME + "_DLE");
+ assertEquals("Wrong exchange type", "fanout", exchange.getExchangeType());
+ TabularDataSupport bindings = (TabularDataSupport) exchange.bindings();
+ assertEquals(1, bindings.size());
+ for(Object o : bindings.values())
+ {
+ CompositeData binding = (CompositeData) o;
+
+ String bindingKey = (String) binding.get(ManagedExchange.BINDING_KEY);
+ String[] queueNames = (String[]) binding.get(ManagedExchange.QUEUE_NAMES);
+
+ //Because its a fanout exchange, we just return a single '*' key with all bound queues
+ assertEquals("unexpected binding key", "*", bindingKey);
+ assertEquals("unexpected number of queues bound", 1, queueNames.length);
+ assertEquals("unexpected queue name", QUEUE_WITH_DLQ_NAME + "_DLQ", queueNames[0]);
+ }
+
+ //verify the queue exists, has the expected alternate exchange and max delivery count
+ ManagedQueue queue = jmxUtils.getManagedQueue(QUEUE_WITH_DLQ_NAME);
+ assertEquals("Queue does not have the expected AlternateExchange", QUEUE_WITH_DLQ_NAME + "_DLE", queue.getAlternateExchange());
+ assertEquals("Unexpected maximum delivery count", Integer.valueOf(2), queue.getMaximumDeliveryCount());
+
+ ManagedQueue dlQqueue = jmxUtils.getManagedQueue(QUEUE_WITH_DLQ_NAME + "_DLQ");
+ assertNull("Queue should not have an AlternateExchange", dlQqueue.getAlternateExchange());
+ assertEquals("Unexpected maximum delivery count", Integer.valueOf(0), dlQqueue.getMaximumDeliveryCount());
+
+ String dlqDlqObjectNameString = jmxUtils.getQueueObjectNameString("test", QUEUE_WITH_DLQ_NAME + "_DLQ" + "_DLQ");
+ assertFalse("a DLQ should not exist for the DLQ itself", jmxUtils.doesManagedObjectExist(dlqDlqObjectNameString));
+ }
+ finally
+ {
+ jmxUtils.close();
+ }
+ }
+
+ private void consumeDurableSubscriptionMessages(Connection connection, boolean selector) throws Exception
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Topic topic = null;
+ TopicSubscriber durSub = null;
+
+ if(selector)
+ {
+ topic = session.createTopic(SELECTOR_TOPIC_NAME);
+ durSub = session.createDurableSubscriber(topic, SELECTOR_SUB_NAME,"testprop='true'", false);
+ }
+ else
+ {
+ topic = session.createTopic(TOPIC_NAME);
+ durSub = session.createDurableSubscriber(topic, SUB_NAME);
+ }
+
+
+ // Retrieve the matching message
+ Message m = durSub.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ if(selector)
+ {
+ assertEquals("Selector property did not match", "true", m.getStringProperty("testprop"));
+ }
+ assertEquals("ID property did not match", 1, m.getIntProperty("ID"));
+ assertEquals("Message content was not as expected", generateString(1024) , ((TextMessage)m).getText());
+
+ // Verify that no more messages are received
+ m = durSub.receive(1000);
+ assertNull("No more messages should have been recieved", m);
+
+ durSub.close();
+ session.close();
+ }
+
+ private void consumeQueueMessages(Connection connection, boolean extraMessage) throws Exception
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = session.createQueue(QUEUE_NAME);
+
+ MessageConsumer consumer = session.createConsumer(queue);
+ Message m;
+
+ // Retrieve the initial pre-upgrade messages
+ for (int i=1; i <= 5 ; i++)
+ {
+ m = consumer.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ assertEquals("ID property did not match", i, m.getIntProperty("ID"));
+ assertEquals("Message content was not as expected", STRING_1024_256, ((TextMessage)m).getText());
+ }
+ for (int i=1; i <= 5 ; i++)
+ {
+ m = consumer.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ assertEquals("ID property did not match", i, m.getIntProperty("ID"));
+ assertEquals("Message content was not as expected", STRING_1024, ((TextMessage)m).getText());
+ }
+
+ if(extraMessage)
+ {
+ //verify that the extra message is received
+ m = consumer.receive(2000);
+ assertNotNull("Failed to receive an expected message", m);
+ assertEquals("ID property did not match", 1, m.getIntProperty("ID"));
+ assertEquals("Message content was not as expected", STRING_1024_256, ((TextMessage)m).getText());
+ }
+
+ // Verify that no more messages are received
+ m = consumer.receive(1000);
+ assertNull("No more messages should have been recieved", m);
+
+ consumer.close();
+ session.close();
+ }
+
+ private Message createMessage(int msgId, boolean first, Session producerSession, MessageProducer producer) throws JMSException
+ {
+ Message send = producerSession.createTextMessage("Message: " + msgId);
+ send.setIntProperty("msg", msgId);
+
+ return send;
+ }
+
+ /**
+ * Generates a string of a given length consisting of the sequence 0,1,2,..,9,0,1,2.
+ *
+ * @param length number of characters in the string
+ * @return string sequence of the given length
+ */
+ private static String generateString(int length)
+ {
+ char[] base_chars = new char[]{'0','1','2','3','4','5','6','7','8','9'};
+ char[] chars = new char[length];
+ for (int i = 0; i < (length); i++)
+ {
+ chars[i] = base_chars[i % 10];
+ }
+ return new String(chars);
+ }
+
+ private static void sendMessages(Session session, MessageProducer messageProducer,
+ Destination dest, int deliveryMode, int length, int numMesages) throws JMSException
+ {
+ for (int i = 1; i <= numMesages; i++)
+ {
+ Message message = session.createTextMessage(generateString(length));
+ message.setIntProperty("ID", i);
+ messageProducer.send(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
+ }
+ }
+
+ private static void publishMessages(Session session, TopicPublisher publisher,
+ Destination dest, int deliveryMode, int length, int numMesages, String selectorProperty) throws JMSException
+ {
+ for (int i = 1; i <= numMesages; i++)
+ {
+ Message message = session.createTextMessage(generateString(length));
+ message.setIntProperty("ID", i);
+ message.setStringProperty("testprop", selectorProperty);
+ publisher.publish(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
+ }
+ }
+}
diff --git a/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java
new file mode 100644
index 0000000000..0464269efc
--- /dev/null
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterBlackboxTest.java
@@ -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.
+ *
+ */
+package org.apache.qpid.server.store.berkeleydb;
+
+import java.io.File;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.Connection;
+import javax.jms.Session;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.jms.ConnectionURL;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestUtils;
+
+/**
+ * The HA black box tests test the BDB cluster as a opaque unit. Client connects to
+ * the cluster via a failover url
+ *
+ * @see HAClusterWhiteboxTest
+ */
+public class HAClusterBlackboxTest extends QpidBrokerTestCase
+{
+ protected static final Logger LOGGER = Logger.getLogger(HAClusterBlackboxTest.class);
+
+ private static final String VIRTUAL_HOST = "test";
+ private static final int NUMBER_OF_NODES = 3;
+
+ private final HATestClusterCreator _clusterCreator = new HATestClusterCreator(this, VIRTUAL_HOST, NUMBER_OF_NODES);
+
+ private FailoverAwaitingListener _failoverAwaitingListener;
+ private ConnectionURL _brokerFailoverUrl;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ _brokerType = BrokerType.SPAWNED;
+
+ assertTrue(isJavaBroker());
+ assertTrue(isBrokerStorePersistent());
+
+ setSystemProperty("java.util.logging.config.file", "etc" + File.separator + "log.properties");
+
+ _clusterCreator.configureClusterNodes();
+
+ _brokerFailoverUrl = _clusterCreator.getConnectionUrlForAllClusterNodes();
+
+ _clusterCreator.startCluster();
+ _failoverAwaitingListener = new FailoverAwaitingListener();
+
+ super.setUp();
+ }
+
+ @Override
+ public void startBroker() throws Exception
+ {
+ // Don't start default broker provided by QBTC.
+ }
+
+ public void testLossOfMasterNodeCausesClientToFailover() throws Exception
+ {
+ final Connection connection = getConnection(_brokerFailoverUrl);
+
+ ((AMQConnection)connection).setConnectionListener(_failoverAwaitingListener);
+
+ final int activeBrokerPort = _clusterCreator.getBrokerPortNumberFromConnection(connection);
+ LOGGER.info("Active connection port " + activeBrokerPort);
+
+ _clusterCreator.stopNode(activeBrokerPort);
+ LOGGER.info("Node is stopped");
+ _failoverAwaitingListener.assertFailoverOccurs(20000);
+ LOGGER.info("Listener has finished");
+ // any op to ensure connection remains
+ connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ }
+
+ public void testLossOfReplicaNodeDoesNotCauseClientToFailover() throws Exception
+ {
+ LOGGER.info("Connecting to " + _brokerFailoverUrl);
+ final Connection connection = getConnection(_brokerFailoverUrl);
+ LOGGER.info("Got connection to cluster");
+
+ ((AMQConnection)connection).setConnectionListener(_failoverAwaitingListener);
+ final int activeBrokerPort = _clusterCreator.getBrokerPortNumberFromConnection(connection);
+ LOGGER.info("Active connection port " + activeBrokerPort);
+ final int inactiveBrokerPort = _clusterCreator.getPortNumberOfAnInactiveBroker(connection);
+
+ LOGGER.info("Stopping inactive broker on port " + inactiveBrokerPort);
+
+ _clusterCreator.stopNode(inactiveBrokerPort);
+
+ _failoverAwaitingListener.assertFailoverDoesNotOccur(2000);
+
+ // any op to ensure connection remains
+ connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ }
+
+ private final class FailoverAwaitingListener implements ConnectionListener
+ {
+ private final CountDownLatch _failoverLatch = new CountDownLatch(1);
+
+ @Override
+ public boolean preResubscribe()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean preFailover(boolean redirect)
+ {
+ return true;
+ }
+
+ public void assertFailoverOccurs(long delay) throws InterruptedException
+ {
+ if (!_failoverLatch.await(delay, TimeUnit.MILLISECONDS))
+ {
+ LOGGER.warn("Test thread dump:\n\n" + TestUtils.dumpThreads() + "\n");
+ }
+ assertEquals("Failover did not occur", 0, _failoverLatch.getCount());
+ }
+
+ public void assertFailoverDoesNotOccur(long delay) throws InterruptedException
+ {
+ _failoverLatch.await(delay, TimeUnit.MILLISECONDS);
+ assertEquals("Failover occurred unexpectedly", 1L, _failoverLatch.getCount());
+ }
+
+
+ @Override
+ public void failoverComplete()
+ {
+ _failoverLatch.countDown();
+ }
+
+ @Override
+ public void bytesSent(long count)
+ {
+ }
+
+ @Override
+ public void bytesReceived(long count)
+ {
+ }
+ }
+
+}
diff --git a/qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java
index 0e25c4e17a..0e25c4e17a 100644
--- a/qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterManagementTest.java
diff --git a/qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java
index 95626f7fa5..95626f7fa5 100644
--- a/qpid/java/bdbstore/jmx/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java
index 408643b98a..408643b98a 100644
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterWhiteboxTest.java
diff --git a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java
index 353c3a0ec5..353c3a0ec5 100644
--- a/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java
+++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java
diff --git a/qpid/java/broker-core/build-generate-sources.xml b/qpid/java/broker-core/build-generate-sources.xml
new file mode 100644
index 0000000000..56637c2bce
--- /dev/null
+++ b/qpid/java/broker-core/build-generate-sources.xml
@@ -0,0 +1,101 @@
+<!--
+ -
+ - 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.
+ -
+ -->
+<project name="QpidBrokerCoreGenerateSources" default="generate-logmessages">
+
+ <!-- Additions to perform LogMessage generation. To enable for a given
+ module using the Ant build, add the following to the build.xml:
+
+ <import file="${project.root}/broker-core/build-generate-sources.xml"/>
+
+ <target name="precompile" depends="generate-logmessages"/> -->
+
+ <dirname property="QpidBrokerCoreGenerateSources.basedir" file="${ant.file.QpidBrokerCoreGenerateSources}"/>
+
+ <property name="gentools.classes" location="${build.scratch}/common/gentools" />
+ <property name="generated-logmessages-dir" location="${module.src}" />
+ <property name="velocity.classes" value="${build.scratch}/broker-core/velocity"/>
+ <property name="velocity.timestamp" location="${generated-logmessages-dir}/velocity.timestamp" />
+ <property name="velocity.src.dir" value="${QpidBrokerCoreGenerateSources.basedir}/src/velocity/java"/>
+ <property name="velocity.template.dir" value="${QpidBrokerCoreGenerateSources.basedir}/src/velocity/templates/org/apache/qpid/server/logging/messages"/>
+
+ <path id="source.generation.classpathref">
+ <pathelement path="${project.root}/${velocity.jar}" />
+ <pathelement path="${project.root}/${velocity-dep.jar}" />
+ </path>
+
+ <condition property="generate.logmessage.sources" value="true">
+ <istrue value="${generate}"/>
+ </condition>
+
+ <target name="compile-logmessages-generator" >
+ <mkdir dir="${velocity.classes}" />
+ <!-- Compile LogMessages Velocity Generator -->
+ <javac source="${java.source}" target="${java.target}"
+ destdir="${velocity.classes}" debug="on" includeantruntime="false"
+ srcdir="${velocity.src.dir}" >
+ <classpath>
+ <path refid="source.generation.classpathref"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="check-logmessages-generation-required">
+ <uptodate property="logmessages-generation-not-required" targetfile="${velocity.timestamp}">
+ <srcfiles dir="${module.src}" includes="**/*_logmessages.properties" />
+ <srcfiles dir="${velocity.src.dir}" includes="**/*.java **/*.vm" />
+ </uptodate>
+ </target>
+
+ <target name="generate-logmessages" depends="compile-logmessages-generator" if="generate.logmessage.sources">
+ <mkdir dir="${generated-logmessages-dir}"/>
+
+ <path id="logmessages.path">
+ <fileset dir="${module.src}">
+ <include name="**/*_logmessages.properties"/>
+ </fileset>
+ </path>
+
+ <pathconvert property="logmessages"
+ refid="logmessages.path"
+ pathsep="' '"/>
+
+ <echo message="logmessages is ${logmessages}"/>
+
+ <java classname="org.apache.qpid.server.logging.GenerateLogMessages" fork="true" dir="${gentools.classes}" failonerror="true">
+ <arg line="'${logmessages}'"/>
+ <arg value="-j"/>
+ <arg value="-o"/>
+ <arg value="${generated-logmessages-dir}"/>
+ <arg value="-t"/>
+ <arg value="${velocity.template.dir}"/>
+ <arg value="-s"/>
+ <arg value="${module.src}"/>
+
+ <classpath>
+ <pathelement path="${module.src}"/>
+ <pathelement path="${velocity.classes}" />
+ <path refid="source.generation.classpathref"/>
+ </classpath>
+ </java>
+ <touch file="${velocity.timestamp}" />
+ </target>
+
+</project>
diff --git a/qpid/java/broker-core/build.xml b/qpid/java/broker-core/build.xml
new file mode 100644
index 0000000000..c8c54a6f70
--- /dev/null
+++ b/qpid/java/broker-core/build.xml
@@ -0,0 +1,33 @@
+<!--
+ -
+ - 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.
+ -
+ -->
+<project name="AMQ Broker" default="build">
+ <property name="module.depends" value="management/common common"/>
+ <property name="module.test.depends" value="qpid-test-utils" />
+ <property name="module.genpom" value="true"/>
+
+ <import file="../module.xml"/>
+
+ <import file="${project.root}/broker-core/build-generate-sources.xml"/>
+
+ <target name="precompile" depends="generate-logmessages"/>
+
+ <target name="bundle" depends="bundle-tasks"/>
+</project>
diff --git a/qpid/java/broker-core/pom.xml b/qpid/java/broker-core/pom.xml
new file mode 100644
index 0000000000..a872bf565a
--- /dev/null
+++ b/qpid/java/broker-core/pom.xml
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-core</artifactId>
+
+ <properties>
+ <generated-logmessages-dir>${basedir}/src/main/java</generated-logmessages-dir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-management-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.0</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils-core</artifactId>
+ <version>1.8.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8.1</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.6</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.8</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.bcel</groupId>
+ <artifactId>bcel</artifactId>
+ <version>5.2</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <!-- Qpid doesn't require BCEL InstructionFinder, so does not need jakarta-regexp. -->
+ <artifactId>jakarta-regexp</artifactId>
+ <groupId>jakarta-regexp</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </testResource>
+ <testResource>
+ <directory>${basedir}/src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <workingDirectory>${basedir}/..</workingDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>generate-sources-broker-core</id>
+ <activation>
+ <property>
+ <name>generate</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>generate-sources-broker-core</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <ant antfile="build-generate-sources.xml">
+ <reference torefid="source.generation.classpathref" refid="maven.plugin.classpath" />
+ <property name="build.compiler" value="extJavac"/>
+ <property name="generated-logmessages-dir" value ="${generated-logmessages-dir}"/>
+ <property name="gentools.classes" location="${basedir}/../common/target/gentools-classes" />
+ <property name="velocity.classes" value="${project.build.directory}/velocity-classes"/>
+ <property name="module.src" value="${basedir}/src/main/java"/>
+ </ant>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ <version>1.4</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/qpid/java/broker/src/main/java/broker.bnd b/qpid/java/broker-core/src/main/java/broker.bnd
index 8296764126..8296764126 100755
--- a/qpid/java/broker/src/main/java/broker.bnd
+++ b/qpid/java/broker-core/src/main/java/broker.bnd
diff --git a/qpid/java/broker/src/main/java/fallback-log4j.properties b/qpid/java/broker-core/src/main/java/fallback-log4j.properties
index 7b95a89924..7b95a89924 100644
--- a/qpid/java/broker/src/main/java/fallback-log4j.properties
+++ b/qpid/java/broker-core/src/main/java/fallback-log4j.properties
diff --git a/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java b/qpid/java/broker-core/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
index 54ca574871..54ca574871 100644
--- a/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/Broker.java
index 7de0ebe1de..7de0ebe1de 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/Broker.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java
index d5f344f4ed..d5f344f4ed 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java
index b7007bf768..b7007bf768 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/Binding.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/Binding.java
index 469a4bb9d0..469a4bb9d0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/Binding.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/Binding.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
index 2d42d60039..2d42d60039 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java
index fb382a8ca9..fb382a8ca9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/BrokerProperties.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java
index 8afb1af24d..8afb1af24d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java
index 5f3589c7ef..5f3589c7ef 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java
index 65d97e6db1..65d97e6db1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfiguredObjectRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java
index c7cf0c0892..c7cf0c0892 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java
index bedd470ddf..bedd470ddf 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/IllegalConfigurationException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java
index 25466d9c55..25466d9c55 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java
index 963d019ec3..963d019ec3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/RecovererProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
index 189f5916e0..189f5916e0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java
index 84972c1e0a..84972c1e0a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java
index b87022868e..b87022868e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/plugins/AbstractConfiguration.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java
index df80b9fe5f..df80b9fe5f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AccessControlProviderRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java
index 8eec88d556..8eec88d556 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecoverer.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
new file mode 100644
index 0000000000..f260b27259
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
+import org.apache.qpid.server.model.adapter.BrokerAdapter;
+import org.apache.qpid.server.model.adapter.GroupProviderFactory;
+import org.apache.qpid.server.model.adapter.PortFactory;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.util.MapValueConverter;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+
+public class BrokerRecoverer implements ConfiguredObjectRecoverer<Broker>
+{
+ private static final Pattern MODEL_VERSION_PATTERN = Pattern.compile("^\\d+\\.\\d+$");
+
+ private final StatisticsGatherer _statisticsGatherer;
+ private final VirtualHostRegistry _virtualHostRegistry;
+ private final LogRecorder _logRecorder;
+ private final RootMessageLogger _rootMessageLogger;
+ private final AuthenticationProviderFactory _authenticationProviderFactory;
+ private final AccessControlProviderFactory _accessControlProviderFactory;
+ private final PortFactory _portFactory;
+ private final TaskExecutor _taskExecutor;
+ private final BrokerOptions _brokerOptions;
+ private final GroupProviderFactory _groupProviderFactory;
+ private final StoreConfigurationChangeListener _storeChangeListener;
+
+ public BrokerRecoverer(AuthenticationProviderFactory authenticationProviderFactory, GroupProviderFactory groupProviderFactory,
+ AccessControlProviderFactory accessControlProviderFactory, PortFactory portFactory, StatisticsGatherer statisticsGatherer,
+ VirtualHostRegistry virtualHostRegistry, LogRecorder logRecorder, RootMessageLogger rootMessageLogger, TaskExecutor taskExecutor,
+ BrokerOptions brokerOptions, StoreConfigurationChangeListener storeChangeListener)
+ {
+ _groupProviderFactory = groupProviderFactory;
+ _portFactory = portFactory;
+ _authenticationProviderFactory = authenticationProviderFactory;
+ _accessControlProviderFactory = accessControlProviderFactory;
+ _statisticsGatherer = statisticsGatherer;
+ _virtualHostRegistry = virtualHostRegistry;
+ _logRecorder = logRecorder;
+ _rootMessageLogger = rootMessageLogger;
+ _taskExecutor = taskExecutor;
+ _brokerOptions = brokerOptions;
+ _storeChangeListener = storeChangeListener;
+ }
+
+ @Override
+ public Broker create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject... parents)
+ {
+ Map<String, Object> attributesCopy = validateAttributes(entry);
+
+ attributesCopy.put(Broker.MODEL_VERSION, Model.MODEL_VERSION);
+
+ BrokerAdapter broker = new BrokerAdapter(entry.getId(), attributesCopy, _statisticsGatherer, _virtualHostRegistry,
+ _logRecorder, _rootMessageLogger, _authenticationProviderFactory,_groupProviderFactory, _accessControlProviderFactory,
+ _portFactory, _taskExecutor, entry.getStore(), _brokerOptions);
+
+ broker.addChangeListener(_storeChangeListener);
+
+ Map<String, Collection<ConfigurationEntry>> childEntries = new HashMap<String, Collection<ConfigurationEntry>>(entry.getChildren());
+
+ List<String> types = makePrioritisedListOfTypes(childEntries.keySet(), TrustStore.class.getSimpleName(), KeyStore.class.getSimpleName(), AuthenticationProvider.class.getSimpleName());
+
+ for (String type : types)
+ {
+ recoverType(recovererProvider, _storeChangeListener, broker, childEntries, type);
+ }
+
+ return broker;
+ }
+
+ private List<String> makePrioritisedListOfTypes(Set<String> allTypes, String... priorityOrderedTypes)
+ {
+ List<String> prioritisedList = new ArrayList<String>(allTypes.size());
+ Set<String> remainder = new HashSet<String>(allTypes);
+
+ for (String type : priorityOrderedTypes)
+ {
+ Set<String> singleton = Collections.singleton(type);
+ Set<String> intersection = new HashSet<String>(allTypes);
+ intersection.retainAll(singleton);
+ remainder.removeAll(singleton);
+ prioritisedList.addAll(intersection);
+ }
+
+ prioritisedList.addAll(remainder);
+ return prioritisedList;
+ }
+
+ private Map<String, Object> validateAttributes(ConfigurationEntry entry)
+ {
+ Map<String, Object> attributes = entry.getAttributes();
+
+ String modelVersion = null;
+ if (attributes.containsKey(Broker.MODEL_VERSION))
+ {
+ modelVersion = MapValueConverter.getStringAttribute(Broker.MODEL_VERSION, attributes, null);
+ }
+
+ if (modelVersion == null)
+ {
+ throw new IllegalConfigurationException("Broker " + Broker.MODEL_VERSION + " must be specified");
+ }
+
+ if (!MODEL_VERSION_PATTERN.matcher(modelVersion).matches())
+ {
+ throw new IllegalConfigurationException("Broker " + Broker.MODEL_VERSION + " is specified in incorrect format: "
+ + modelVersion);
+ }
+
+ int versionSeparatorPosition = modelVersion.indexOf(".");
+ String majorVersionPart = modelVersion.substring(0, versionSeparatorPosition);
+ int majorModelVersion = Integer.parseInt(majorVersionPart);
+ int minorModelVersion = Integer.parseInt(modelVersion.substring(versionSeparatorPosition + 1));
+
+ if (majorModelVersion != Model.MODEL_MAJOR_VERSION || minorModelVersion > Model.MODEL_MINOR_VERSION)
+ {
+ throw new IllegalConfigurationException("The model version '" + modelVersion
+ + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'");
+ }
+
+ if(!Model.MODEL_VERSION.equals(modelVersion))
+ {
+ String oldVersion;
+ do
+ {
+ oldVersion = modelVersion;
+ StoreUpgrader.upgrade(entry.getStore());
+ entry = entry.getStore().getRootEntry();
+ attributes = entry.getAttributes();
+ modelVersion = MapValueConverter.getStringAttribute(Broker.MODEL_VERSION, attributes, null);
+ }
+ while(!(modelVersion.equals(oldVersion) || modelVersion.equals(Model.MODEL_VERSION)));
+ }
+
+ return new HashMap<String, Object>(attributes);
+ }
+
+ private void recoverType(RecovererProvider recovererProvider,
+ StoreConfigurationChangeListener storeChangeListener,
+ BrokerAdapter broker,
+ Map<String, Collection<ConfigurationEntry>> childEntries,
+ String type)
+ {
+ ConfiguredObjectRecoverer<?> recoverer = recovererProvider.getRecoverer(type);
+ if (recoverer == null)
+ {
+ throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
+ }
+ Collection<ConfigurationEntry> entries = childEntries.get(type);
+ for (ConfigurationEntry childEntry : entries)
+ {
+ ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
+ if (object == null)
+ {
+ throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
+ }
+ broker.recoverChild(object);
+ object.addChangeListener(storeChangeListener);
+ }
+ }
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java
new file mode 100644
index 0000000000..14b6d9f118
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.model.AccessControlProvider;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.GroupProvider;
+import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.Plugin;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
+import org.apache.qpid.server.model.adapter.GroupProviderFactory;
+import org.apache.qpid.server.model.adapter.PortFactory;
+import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.plugin.AccessControlFactory;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.plugin.GroupManagerFactory;
+import org.apache.qpid.server.plugin.PluginFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+
+public class DefaultRecovererProvider implements RecovererProvider
+{
+
+ private final StatisticsGatherer _brokerStatisticsGatherer;
+ private final VirtualHostRegistry _virtualHostRegistry;
+ private final LogRecorder _logRecorder;
+ private final RootMessageLogger _rootMessageLogger;
+ private final AuthenticationProviderFactory _authenticationProviderFactory;
+ private final AccessControlProviderFactory _accessControlProviderFactory;
+ private final PortFactory _portFactory;
+ private final GroupProviderFactory _groupProviderFactory;
+ private final QpidServiceLoader<PluginFactory> _pluginFactoryServiceLoader;
+ private final TaskExecutor _taskExecutor;
+ private final BrokerOptions _brokerOptions;
+ private final StoreConfigurationChangeListener _storeChangeListener;
+
+ public DefaultRecovererProvider(StatisticsGatherer brokerStatisticsGatherer, VirtualHostRegistry virtualHostRegistry,
+ LogRecorder logRecorder, RootMessageLogger rootMessageLogger, TaskExecutor taskExecutor, BrokerOptions brokerOptions, StoreConfigurationChangeListener storeChangeListener)
+ {
+ _authenticationProviderFactory = new AuthenticationProviderFactory(new QpidServiceLoader<AuthenticationManagerFactory>());
+ _accessControlProviderFactory = new AccessControlProviderFactory(new QpidServiceLoader<AccessControlFactory>());
+ _groupProviderFactory = new GroupProviderFactory(new QpidServiceLoader<GroupManagerFactory>());
+ _portFactory = new PortFactory();
+ _brokerStatisticsGatherer = brokerStatisticsGatherer;
+ _virtualHostRegistry = virtualHostRegistry;
+ _logRecorder = logRecorder;
+ _rootMessageLogger = rootMessageLogger;
+ _pluginFactoryServiceLoader = new QpidServiceLoader<PluginFactory>();
+ _taskExecutor = taskExecutor;
+ _brokerOptions = brokerOptions;
+ _storeChangeListener = storeChangeListener;
+ }
+
+ @Override
+ public ConfiguredObjectRecoverer<?> getRecoverer(String type)
+ {
+ if (Broker.class.getSimpleName().equals(type))
+ {
+ return new BrokerRecoverer(_authenticationProviderFactory, _groupProviderFactory, _accessControlProviderFactory, _portFactory,
+ _brokerStatisticsGatherer, _virtualHostRegistry, _logRecorder, _rootMessageLogger, _taskExecutor, _brokerOptions, _storeChangeListener);
+ }
+ else if(VirtualHost.class.getSimpleName().equals(type))
+ {
+ return new VirtualHostRecoverer(_brokerStatisticsGatherer);
+ }
+ else if(AccessControlProvider.class.getSimpleName().equals(type))
+ {
+ return new AccessControlProviderRecoverer(_accessControlProviderFactory);
+ }
+ else if(AuthenticationProvider.class.getSimpleName().equals(type))
+ {
+ return new AuthenticationProviderRecoverer(_authenticationProviderFactory, _storeChangeListener);
+ }
+ else if(Port.class.getSimpleName().equals(type))
+ {
+ return new PortRecoverer(_portFactory);
+ }
+ else if(GroupProvider.class.getSimpleName().equals(type))
+ {
+ return new GroupProviderRecoverer(_groupProviderFactory);
+ }
+ else if(KeyStore.class.getSimpleName().equals(type))
+ {
+ return new KeyStoreRecoverer();
+ }
+ else if(TrustStore.class.getSimpleName().equals(type))
+ {
+ return new TrustStoreRecoverer();
+ }
+ else if(PreferencesProvider.class.getSimpleName().equals(type))
+ {
+ return new PreferencesProviderRecoverer();
+ }
+ else if(Plugin.class.getSimpleName().equals(type))
+ {
+ return new PluginRecoverer(_pluginFactoryServiceLoader);
+ }
+
+ return null;
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
index 00f23b3c1c..00f23b3c1c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java
index 8efedd37b5..8efedd37b5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/KeyStoreRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java
index ddc4482953..ddc4482953 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PluginRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java
index 147e835a8d..147e835a8d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PortRecoverer.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java
new file mode 100644
index 0000000000..db3f968435
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import java.util.Map;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.plugin.PreferencesProviderFactory;
+import org.apache.qpid.server.util.MapValueConverter;
+
+public class PreferencesProviderRecoverer implements ConfiguredObjectRecoverer<PreferencesProvider>
+{
+
+ @Override
+ public PreferencesProvider create(RecovererProvider recovererProvider, ConfigurationEntry entry,
+ ConfiguredObject... parents)
+ {
+ AuthenticationProvider authenticationProvider = RecovererHelper.verifyOnlyParentIsOfType(AuthenticationProvider.class, parents);
+ Map<String, Object> attributes = entry.getAttributes();
+ String type = MapValueConverter.getStringAttribute(PreferencesProvider.TYPE, attributes);
+ PreferencesProviderFactory factory = PreferencesProviderFactory.FACTORIES.get(type);
+ return factory.createInstance(entry.getId(), attributes, authenticationProvider);
+ }
+
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java
new file mode 100644
index 0000000000..cc0426131f
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+public class RecovererHelper
+{
+ public static Broker verifyOnlyBrokerIsParent(ConfiguredObject... parents)
+ {
+ return verifyOnlyParentIsOfType(Broker.class, parents);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends ConfiguredObject> T verifyOnlyParentIsOfType(Class<T> parentClass, ConfiguredObject... parents)
+ {
+ if (parentClass == null)
+ {
+ throw new IllegalArgumentException("Parent class is not specified!");
+ }
+ if (parents == null || parents.length == 0)
+ {
+ throw new IllegalArgumentException("Parent of type " + parentClass.getSimpleName() +" is not passed!");
+ }
+ if (parents.length != 1)
+ {
+ throw new IllegalArgumentException("Only one parent is expected!");
+ }
+ if (!parentClass.isAssignableFrom(parents[0].getClass()))
+ {
+ throw new IllegalArgumentException("Parent is not instance of " + parentClass.getSimpleName());
+ }
+ return (T)parents[0];
+ }
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java
new file mode 100644
index 0000000000..1a5ef9adca
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java
@@ -0,0 +1,102 @@
+package org.apache.qpid.server.configuration.startup;/*
+ *
+ * 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.
+ *
+ */
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.model.Broker;
+
+public abstract class StoreUpgrader
+{
+
+ private static Map<String, StoreUpgrader> _upgraders = new HashMap<String, StoreUpgrader>();
+
+ // Note: don't use externally defined constants in upgraders in case they change, the values here MUST stay the same
+ // no matter what changes are made to the code in the future
+
+ private final static StoreUpgrader UPGRADE_1_0 = new StoreUpgrader("1.0")
+ {
+ @Override
+ protected void doUpgrade(ConfigurationEntryStore store)
+ {
+ ConfigurationEntry root = store.getRootEntry();
+ Map<String, Collection<ConfigurationEntry>> children = root.getChildren();
+ Collection<ConfigurationEntry> vhosts = children.get("VirtualHost");
+ Collection<ConfigurationEntry> changed = new HashSet<ConfigurationEntry>();
+ for(ConfigurationEntry vhost : vhosts)
+ {
+ Map<String, Object> attributes = vhost.getAttributes();
+ if(attributes.containsKey("storeType"))
+ {
+ attributes = new HashMap<String, Object>(attributes);
+ attributes.put("type", "STANDARD");
+
+ changed.add(new ConfigurationEntry(vhost.getId(),vhost.getType(),attributes,vhost.getChildrenIds(),store));
+
+ }
+
+ }
+ Map<String, Object> attributes = new HashMap<String, Object>(root.getAttributes());
+ attributes.put(Broker.MODEL_VERSION, "1.1");
+ changed.add(new ConfigurationEntry(root.getId(),root.getType(),attributes,root.getChildrenIds(),store));
+
+ store.save(changed.toArray(new ConfigurationEntry[changed.size()]));
+
+ }
+ };
+
+ private final static StoreUpgrader UPGRADE_1_1 = new StoreUpgrader("1.1")
+ {
+ @Override
+ protected void doUpgrade(ConfigurationEntryStore store)
+ {
+ ConfigurationEntry root = store.getRootEntry();
+
+ Map<String, Object> attributes = new HashMap<String, Object>(root.getAttributes());
+ attributes.put(Broker.MODEL_VERSION, "1.2");
+ ConfigurationEntry newRoot = new ConfigurationEntry(root.getId(),root.getType(),attributes,root.getChildrenIds(),store);
+
+ store.save(newRoot);
+
+ }
+ };
+
+ private StoreUpgrader(String version)
+ {
+ _upgraders.put(version, this);
+ }
+
+ public static void upgrade(ConfigurationEntryStore store)
+ {
+ StoreUpgrader upgrader = null;
+ while ((upgrader = _upgraders.get(store.getRootEntry().getAttributes().get(Broker.MODEL_VERSION).toString())) != null)
+ {
+ upgrader.doUpgrade(store);
+ }
+ }
+
+ protected abstract void doUpgrade(ConfigurationEntryStore store);
+
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java
index 7e9428a4d6..7e9428a4d6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/TrustStoreRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
index 4f863adfb5..4f863adfb5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java
index 6d895892b3..6d895892b3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreUtil.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java
index df82822a86..df82822a86 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
index 639f3cd5c4..639f3cd5c4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
new file mode 100644
index 0000000000..56b0aec7dd
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
@@ -0,0 +1,725 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.store;
+
+import static org.apache.qpid.server.configuration.ConfigurationEntry.ATTRIBUTE_NAME;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.util.Strings;
+import org.apache.qpid.util.Strings.ChainedResolver;
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+import org.codehaus.jackson.node.ArrayNode;
+
+public class MemoryConfigurationEntryStore implements ConfigurationEntryStore
+{
+ public static final String STORE_TYPE = "memory";
+
+ private static final String DEFAULT_BROKER_NAME = "Broker";
+ private static final String ID = "id";
+ private static final String TYPE = "@type";
+
+ static final int STORE_VERSION = 1;
+
+ private final ObjectMapper _objectMapper;
+ private final Map<UUID, ConfigurationEntry> _entries;
+ private final Map<String, Class<? extends ConfiguredObject>> _brokerChildrenRelationshipMap;
+ private final ConfigurationEntryStoreUtil _util = new ConfigurationEntryStoreUtil();
+
+ private String _storeLocation;
+ private UUID _rootId;
+
+ private boolean _generatedObjectIdDuringLoad;
+
+ private ChainedResolver _resolver;
+
+ protected MemoryConfigurationEntryStore(Map<String, String> configProperties)
+ {
+ _objectMapper = new ObjectMapper();
+ _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+ _objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
+ _entries = new HashMap<UUID, ConfigurationEntry>();
+ _brokerChildrenRelationshipMap = buildRelationshipClassMap();
+ _resolver = new Strings.ChainedResolver(Strings.SYSTEM_RESOLVER,
+ new Strings.MapResolver(configProperties));
+ }
+
+ MemoryConfigurationEntryStore(String json, Map<String, String> configProperties)
+ {
+ this(configProperties);
+ if (json == null || "".equals(json))
+ {
+ createRootEntry();
+ }
+ else
+ {
+ loadFromJson(json);
+ }
+ }
+
+ public MemoryConfigurationEntryStore(String initialStoreLocation, ConfigurationEntryStore initialStore, Map<String, String> configProperties)
+ {
+ this(configProperties);
+ if (initialStore == null && (initialStoreLocation == null || "".equals(initialStoreLocation) ))
+ {
+ throw new IllegalConfigurationException("Cannot instantiate the memory broker store as neither initial store nor initial store location is provided");
+ }
+
+ if (initialStore != null)
+ {
+ if (initialStore instanceof MemoryConfigurationEntryStore)
+ {
+ _storeLocation = initialStore.getStoreLocation();
+ }
+ _rootId = initialStore.getRootEntry().getId();
+ copyEntry(_rootId, initialStore, _entries);
+ }
+ else
+ {
+ _storeLocation = initialStoreLocation;
+ load(_util.toURL(_storeLocation));
+ }
+ }
+
+ @Override
+ public synchronized UUID[] remove(UUID... entryIds)
+ {
+ List<UUID> removedIds = new ArrayList<UUID>();
+ for (UUID uuid : entryIds)
+ {
+ if (_rootId.equals(uuid))
+ {
+ throw new IllegalConfigurationException("Cannot remove root entry");
+ }
+ }
+ for (UUID uuid : entryIds)
+ {
+ if (removeInternal(uuid))
+ {
+ // remove references to the entry from parent entries
+ for (ConfigurationEntry entry : _entries.values())
+ {
+ if (entry.hasChild(uuid))
+ {
+ Set<UUID> children = new HashSet<UUID>(entry.getChildrenIds());
+ children.remove(uuid);
+ ConfigurationEntry referal = new ConfigurationEntry(entry.getId(), entry.getType(),
+ entry.getAttributes(), children, this);
+ _entries.put(entry.getId(), referal);
+ }
+ }
+ removedIds.add(uuid);
+ }
+ }
+
+ return removedIds.toArray(new UUID[removedIds.size()]);
+ }
+
+ @Override
+ public synchronized void save(ConfigurationEntry... entries)
+ {
+ replaceEntries(entries);
+ }
+
+ @Override
+ public ConfigurationEntry getRootEntry()
+ {
+ return getEntry(_rootId);
+ }
+
+ @Override
+ public synchronized ConfigurationEntry getEntry(UUID id)
+ {
+ return _entries.get(id);
+ }
+
+ /**
+ * Copies the store into the given location
+ *
+ * @param target location to copy store into
+ * @throws IllegalConfigurationException if store cannot be copied into given location
+ */
+ public void copyTo(String copyLocation)
+ {
+ File file = new File(copyLocation);
+ if (!file.exists())
+ {
+ createFileIfNotExist(file);
+ }
+ saveAsTree(file);
+ }
+
+ @Override
+ public String getStoreLocation()
+ {
+ return _storeLocation;
+ }
+
+ @Override
+ public int getVersion()
+ {
+ return STORE_VERSION;
+ }
+
+ @Override
+ public String getType()
+ {
+ return STORE_TYPE;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "MemoryConfigurationEntryStore [_rootId=" + _rootId + "]";
+ }
+
+ protected boolean replaceEntries(ConfigurationEntry... entries)
+ {
+ boolean anySaved = false;
+ for (ConfigurationEntry entry : entries)
+ {
+ ConfigurationEntry oldEntry = _entries.put(entry.getId(), entry);
+ if (!entry.equals(oldEntry))
+ {
+ anySaved = true;
+ }
+ }
+ return anySaved;
+ }
+
+ protected ObjectMapper getObjectMapper()
+ {
+ return _objectMapper;
+ }
+
+ protected void saveAsTree(File file)
+ {
+ saveAsTree(_rootId, _entries, _objectMapper, file, STORE_VERSION);
+ }
+
+ protected void saveAsTree(UUID rootId, Map<UUID, ConfigurationEntry> entries, ObjectMapper mapper, File file, int version)
+ {
+ Map<String, Object> tree = toTree(rootId, entries);
+ tree.put(Broker.STORE_VERSION, version);
+ try
+ {
+ mapper.writeValue(file, tree);
+ }
+ catch (JsonGenerationException e)
+ {
+ throw new IllegalConfigurationException("Cannot generate json!", e);
+ }
+ catch (JsonMappingException e)
+ {
+ throw new IllegalConfigurationException("Cannot map objects for json serialization!", e);
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot save configuration into " + file + "!", e);
+ }
+ }
+
+ protected void load(URL url)
+ {
+ InputStream is = null;
+ try
+ {
+ is = url.openStream();
+ JsonNode node = loadJsonNodes(is, _objectMapper);
+
+ int storeVersion = 0;
+ JsonNode storeVersionNode = node.get(Broker.STORE_VERSION);
+ if (storeVersionNode == null || storeVersionNode.isNull())
+ {
+ throw new IllegalConfigurationException("Broker " + Broker.STORE_VERSION + " attribute must be specified");
+ }
+ else
+ {
+ storeVersion = storeVersionNode.getIntValue();
+ }
+
+ if (storeVersion != STORE_VERSION)
+ {
+ throw new IllegalConfigurationException("The data of version " + storeVersion
+ + " can not be loaded by store of version " + STORE_VERSION);
+ }
+
+ ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
+ _rootId = brokerEntry.getId();
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot load store from: " + url, e);
+ }
+ finally
+ {
+ if (is != null)
+ {
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot close input stream for: " + url, e);
+ }
+ }
+ }
+ }
+ }
+
+ protected void createFileIfNotExist(File file)
+ {
+ File parent = file.getParentFile();
+ if (!parent.exists())
+ {
+ if (!parent.mkdirs())
+ {
+ throw new IllegalConfigurationException("Cannot create folders " + parent);
+ }
+ }
+ try
+ {
+ file.createNewFile();
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot create file " + file, e);
+ }
+ }
+
+ protected void copyEntry(UUID entryId, ConfigurationEntryStore initialStore, Map<UUID,ConfigurationEntry> entries)
+ {
+ ConfigurationEntry entry = initialStore.getEntry(entryId);
+ if (entry != null)
+ {
+ if (entries.containsKey(entryId))
+ {
+ throw new IllegalConfigurationException("Duplicate id is found: " + entryId
+ + "! The following configuration entries have the same id: " + entries.get(entryId) + ", " + entry);
+ }
+
+ Set<UUID> children = entry.getChildrenIds();
+ Set<UUID> childrenCopy = children == null? null : new HashSet<UUID>(children);
+ ConfigurationEntry copy = new ConfigurationEntry(entryId, entry.getType(), new HashMap<String, Object>(entry.getAttributes()), childrenCopy, this);
+ entries.put(entryId, copy);
+ if (children != null)
+ {
+ for (UUID uuid : children)
+ {
+ copyEntry(uuid, initialStore, entries);
+ }
+ }
+ }
+ }
+
+ private void loadFromJson(String json)
+ {
+ ByteArrayInputStream bais = null;
+ try
+ {
+ byte[] bytes = json.getBytes("UTF-8");
+ bais = new ByteArrayInputStream(bytes);
+ JsonNode node = loadJsonNodes(bais, _objectMapper);
+ ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
+ _rootId = brokerEntry.getId();
+ }
+ catch(Exception e)
+ {
+ throw new IllegalConfigurationException("Cannot create store from json:" + json);
+ }
+ finally
+ {
+ if (bais != null)
+ {
+ try
+ {
+ bais.close();
+ }
+ catch (IOException e)
+ {
+ // ByteArrayInputStream#close() is an empty method
+ }
+ }
+ }
+ }
+
+ private void createRootEntry()
+ {
+ ConfigurationEntry brokerEntry = new ConfigurationEntry(UUIDGenerator.generateRandomUUID(),
+ Broker.class.getSimpleName(), Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), this);
+ _rootId = brokerEntry.getId();
+ _entries.put(_rootId, brokerEntry);
+ }
+
+ private Map<String, Object> toTree(UUID rootId, Map<UUID, ConfigurationEntry> entries)
+ {
+ ConfigurationEntry entry = entries.get(rootId);
+ if (entry == null || !entry.getId().equals(rootId))
+ {
+ throw new IllegalConfigurationException("Cannot find entry with id " + rootId + "!");
+ }
+ Map<String, Object> tree = new TreeMap<String, Object>();
+ Map<String, Object> attributes = entry.getAttributes();
+ if (attributes != null)
+ {
+ tree.putAll(attributes);
+ }
+ tree.put(ID, entry.getId());
+ Set<UUID> childrenIds = entry.getChildrenIds();
+ if (childrenIds != null && !childrenIds.isEmpty())
+ {
+ for (UUID relationship : childrenIds)
+ {
+ ConfigurationEntry child = entries.get(relationship);
+ if (child != null)
+ {
+ String relationshipName = child.getType().toLowerCase() + "s";
+
+ @SuppressWarnings("unchecked")
+ Collection<Map<String, Object>> children = (Collection<Map<String, Object>>) tree.get(relationshipName);
+ if (children == null)
+ {
+ children = new ArrayList<Map<String, Object>>();
+ tree.put(relationshipName, children);
+ }
+ Map<String, Object> childAsMap = toTree(relationship, entries);
+ children.add(childAsMap);
+ }
+ }
+ }
+ return tree;
+ }
+
+ private Map<String, Class<? extends ConfiguredObject>> buildRelationshipClassMap()
+ {
+ Map<String, Class<? extends ConfiguredObject>> relationships = new HashMap<String, Class<? extends ConfiguredObject>>();
+
+ Collection<Class<? extends ConfiguredObject>> children = Model.getInstance().getChildTypes(Broker.class);
+ for (Class<? extends ConfiguredObject> childClass : children)
+ {
+ String name = childClass.getSimpleName().toLowerCase();
+ String relationshipName = name + (name.endsWith("s") ? "es" : "s");
+ relationships.put(relationshipName, childClass);
+ }
+ return relationships;
+ }
+
+ private boolean removeInternal(UUID entryId)
+ {
+ ConfigurationEntry oldEntry = _entries.remove(entryId);
+ if (oldEntry != null)
+ {
+ Set<UUID> children = oldEntry.getChildrenIds();
+ if (children != null && !children.isEmpty())
+ {
+ for (UUID childId : children)
+ {
+ removeInternal(childId);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private JsonNode loadJsonNodes(InputStream is, ObjectMapper mapper)
+ {
+ JsonNode root = null;
+ try
+ {
+ root = mapper.readTree(is);
+ }
+ catch (JsonProcessingException e)
+ {
+ throw new IllegalConfigurationException("Cannot parse json", e);
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot read json", e);
+ }
+ return root;
+ }
+
+ private ConfigurationEntry toEntry(JsonNode parent, Class<? extends ConfiguredObject> expectedConfiguredObjectClass, Map<UUID, ConfigurationEntry> entries)
+ {
+ Map<String, Object> attributes = null;
+ Set<UUID> childrenIds = new TreeSet<UUID>();
+ Iterator<String> fieldNames = parent.getFieldNames();
+ String type = null;
+ String idAsString = null;
+ while (fieldNames.hasNext())
+ {
+ String fieldName = fieldNames.next();
+ JsonNode fieldNode = parent.get(fieldName);
+ if (fieldName.equals(ID))
+ {
+ idAsString = fieldNode.asText();
+ }
+ else if (fieldName.equals(TYPE))
+ {
+ type = fieldNode.asText();
+ }
+ else if (fieldNode.isArray())
+ {
+ // array containing either broker children or attribute values
+ Iterator<JsonNode> elements = fieldNode.getElements();
+ List<Object> fieldValues = null;
+ while (elements.hasNext())
+ {
+ JsonNode element = elements.next();
+ if (element.isObject())
+ {
+ Class<? extends ConfiguredObject> expectedChildConfiguredObjectClass = findExpectedChildConfiguredObjectClass(
+ fieldName, expectedConfiguredObjectClass);
+
+ // assuming it is a child node
+ ConfigurationEntry entry = toEntry(element, expectedChildConfiguredObjectClass, entries);
+ childrenIds.add(entry.getId());
+ }
+ else
+ {
+ if (fieldValues == null)
+ {
+ fieldValues = new ArrayList<Object>();
+ }
+ fieldValues.add(toObject(element));
+ }
+ }
+ if (fieldValues != null)
+ {
+ Object[] array = fieldValues.toArray(new Object[fieldValues.size()]);
+ if (attributes == null)
+ {
+ attributes = new HashMap<String, Object>();
+ }
+ attributes.put(fieldName, array);
+ }
+ }
+ else if (fieldNode.isObject())
+ {
+ // ignore, in-line objects are not supported yet
+ }
+ else
+ {
+ // primitive attribute
+ Object value = toObject(fieldNode);
+ if (attributes == null)
+ {
+ attributes = new HashMap<String, Object>();
+ }
+ attributes.put(fieldName, value);
+ }
+ }
+
+ if (type == null)
+ {
+ if (expectedConfiguredObjectClass == null)
+ {
+ throw new IllegalConfigurationException("Type attribute is not provided for configuration entry " + parent);
+ }
+ else
+ {
+ type = expectedConfiguredObjectClass.getSimpleName();
+ }
+ }
+ String name = null;
+ if (attributes != null)
+ {
+ name = (String) attributes.get(ATTRIBUTE_NAME);
+ }
+ if ((name == null || "".equals(name)))
+ {
+ if (expectedConfiguredObjectClass == Broker.class)
+ {
+ name = DEFAULT_BROKER_NAME;
+ }
+ else
+ {
+ throw new IllegalConfigurationException("Name attribute is not provided for configuration entry " + parent);
+ }
+ }
+ UUID id = null;
+ if (idAsString == null)
+ {
+ id = UUIDGenerator.generateRandomUUID();
+
+ _generatedObjectIdDuringLoad = true;
+ }
+ else
+ {
+ try
+ {
+ id = UUID.fromString(idAsString);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalConfigurationException(
+ "ID attribute value does not conform to UUID format for configuration entry " + parent);
+ }
+ }
+ ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, childrenIds, this);
+ if (entries.containsKey(id))
+ {
+ throw new IllegalConfigurationException("Duplicate id is found: " + id
+ + "! The following configuration entries have the same id: " + entries.get(id) + ", " + entry);
+ }
+ entries.put(id, entry);
+ return entry;
+ }
+
+ private Class<? extends ConfiguredObject> findExpectedChildConfiguredObjectClass(String parentFieldName,
+ Class<? extends ConfiguredObject> parentConfiguredObjectClass)
+ {
+ if (parentConfiguredObjectClass == Broker.class)
+ {
+ return _brokerChildrenRelationshipMap.get(parentFieldName);
+ }
+
+ // for non-broker parent classes
+ // try to determine the child class from the model by iterating through the children classes
+ // for the parent configured object class
+ if (parentConfiguredObjectClass != null)
+ {
+ Collection<Class<? extends ConfiguredObject>> childTypes = Model.getInstance().getChildTypes(parentConfiguredObjectClass);
+ for (Class<? extends ConfiguredObject> childType : childTypes)
+ {
+ String relationship = childType.getSimpleName().toLowerCase();
+ relationship += relationship.endsWith("s") ? "es": "s";
+ if (parentFieldName.equals(relationship))
+ {
+ return childType;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private Object toObject(JsonNode node)
+ {
+ if (node.isValueNode())
+ {
+ if (node.isBoolean())
+ {
+ return node.asBoolean();
+ }
+ else if (node.isDouble())
+ {
+ return node.asDouble();
+ }
+ else if (node.isInt())
+ {
+ return node.asInt();
+ }
+ else if (node.isLong())
+ {
+ return node.asLong();
+ }
+ else if (node.isNull())
+ {
+ return null;
+ }
+ else
+ {
+ return Strings.expand(node.asText(), _resolver);
+ }
+ }
+ else if (node.isArray())
+ {
+ return toArray(node);
+ }
+ else if (node.isObject())
+ {
+ return toMap(node);
+ }
+ else
+ {
+ throw new IllegalConfigurationException("Unexpected node: " + node);
+ }
+ }
+
+ private Map<String, Object> toMap(JsonNode node)
+ {
+ Map<String, Object> object = new TreeMap<String, Object>();
+ Iterator<String> fieldNames = node.getFieldNames();
+ while (fieldNames.hasNext())
+ {
+ String name = fieldNames.next();
+ Object value = toObject(node.get(name));
+ object.put(name, value);
+ }
+ return object;
+ }
+
+ private Object toArray(JsonNode node)
+ {
+ ArrayNode arrayNode = (ArrayNode) node;
+ Object[] array = new Object[arrayNode.size()];
+ Iterator<JsonNode> elements = arrayNode.getElements();
+ for (int i = 0; i < array.length; i++)
+ {
+ array[i] = toObject(elements.next());
+ }
+ return array;
+ }
+
+ protected boolean isGeneratedObjectIdDuringLoad()
+ {
+ return _generatedObjectIdDuringLoad;
+ }
+
+ protected ConfigurationEntryStoreUtil getConfigurationEntryStoreUtil()
+ {
+ return _util;
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
index 3022898300..3022898300 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java
index de007e68d7..de007e68d7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java
index f7a9157144..f7a9157144 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java
index 4ba4057fee..4ba4057fee 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeAttributesTask.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java
index b6de1e136a..b6de1e136a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/ChangeStateTask.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java
index d3a8f5b797..d3a8f5b797 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/CreateChildTask.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java
index 94649434e6..94649434e6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/SetAttributeTask.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java
index 671104d413..671104d413 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/updater/TaskExecutor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
index b933d3f961..b933d3f961 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
index 07d934027e..07d934027e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
index c30ebe17be..c30ebe17be 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
index aed2ddb8cf..aed2ddb8cf 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
index 612fa855a4..612fa855a4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
index b54f995b5e..b54f995b5e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
index 1e022c994e..1e022c994e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java
index d61d10155e..d61d10155e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DirectExchangeType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/Exchange.java
index d05e731daa..d05e731daa 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/Exchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
index f364691666..f364691666 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
index c77f114428..c77f114428 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java
index 6dbc1d54d1..6dbc1d54d1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java
index e41d63d97d..e41d63d97d 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeReferrer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
index 53ee7de661..53ee7de661 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
index cd830d69a9..cd830d69a9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java
index ac864df02c..ac864df02c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FanoutExchangeType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java
index e78516cf69..e78516cf69 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/FilterSupport.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
index eb4a84a5b9..eb4a84a5b9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
index 41dd7e010c..41dd7e010c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java
index 42d04f5a97..42d04f5a97 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
index 6b8b84f5dd..6b8b84f5dd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java
index 3bbae700be..3bbae700be 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/TopicExchangeType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java
index 44d5f7f1d0..44d5f7f1d0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicExchangeResult.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java
index 85338c0760..85338c0760 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java
index 6084b18b31..6084b18b31 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java
index e45d6a539d..e45d6a539d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicNormalizer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java
index 214ca23b49..214ca23b49 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java
index c905299733..c905299733 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java
index 24c41ee7da..24c41ee7da 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManager.java
index b5e282038b..b5e282038b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
index 07049a6c97..07049a6c97 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
index 3d0d9a0f31..3d0d9a0f31 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
index f5416af09a..f5416af09a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
index d3e097d22c..d3e097d22c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
index 6c158de8b5..6c158de8b5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java
index 124fb0d1d9..124fb0d1d9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
index be3a13d2d3..be3a13d2d3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
index 280f2851a4..280f2851a4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
index 89fc60666b..89fc60666b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
index 31c1fda968..31c1fda968 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
index 1817e8ad31..1817e8ad31 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
index fc2d4bfb53..fc2d4bfb53 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java
index 98da9074ef..98da9074ef 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/AbstractRootMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java
index e0a51b3a3e..e0a51b3a3e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/CompositeStartupMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java
index b4e9f2f333..b4e9f2f333 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogActor.java
index 18f03c2716..18f03c2716 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogMessage.java
index fa18435fab..fa18435fab 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogRecorder.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java
index dfffbdbb5f..dfffbdbb5f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogRecorder.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogSubject.java
index 09a277e520..09a277e520 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/LogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java
index db8b24e90e..db8b24e90e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/NullRootMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java
index 1431dd1da9..1431dd1da9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java
index b384b3fde3..b384b3fde3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/SystemOutMessageLogger.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java
index d23122ac5d..d23122ac5d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java
index 99e11bf9ae..99e11bf9ae 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java
index e8c6c9c323..e8c6c9c323 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java
index 8cf121b3d9..8cf121b3d9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/AbstractManagementActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java
index 9e77452228..9e77452228 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java
index 6251471139..6251471139 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/CurrentActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java
index 0e418a95e2..0e418a95e2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/GenericActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java
index 9b445c2bd9..9b445c2bd9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/HttpManagementActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java
index ba5ea47fc1..ba5ea47fc1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java
index 4b17e8c0e6..4b17e8c0e6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java
index a2dbf2f6ee..a2dbf2f6ee 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
index 468b06be34..468b06be34 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java
index 6a961c8fa4..6a961c8fa4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
new file mode 100644
index 0000000000..9894db5000
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of AccessControl_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class AccessControlMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String ACCESSCONTROL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol";
+ public static final String DENIED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.denied";
+ public static final String ALLOWED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.allowed";
+
+ static
+ {
+ Logger.getLogger(ACCESSCONTROL_LOG_HIERARCHY);
+ Logger.getLogger(DENIED_LOG_HIERARCHY);
+ Logger.getLogger(ALLOWED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.AccessControl_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a AccessControl message of the Format:
+ * <pre>ACL-1002 : Denied : {0} {1} {2}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DENIED(String param1, String param2, String param3)
+ {
+ String rawMessage = _messages.getString("DENIED");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DENIED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a AccessControl message of the Format:
+ * <pre>ACL-1001 : Allowed : {0} {1} {2}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage ALLOWED(String param1, String param2, String param3)
+ {
+ String rawMessage = _messages.getString("ALLOWED");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return ALLOWED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private AccessControlMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControl_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControl_logmessages.properties
new file mode 100644
index 0000000000..c953076165
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControl_logmessages.properties
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+# Access Control logging message i18n strings.
+
+# 'accept-log' rule message
+ALLOWED = ACL-1001 : Allowed : {0} {1} {2}
+
+# 'deny-log' rule message
+DENIED = ACL-1002 : Denied : {0} {1} {2}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
new file mode 100644
index 0000000000..f160235e43
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Binding_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class BindingMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String BINDING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding.created";
+ public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding.deleted";
+
+ static
+ {
+ Logger.getLogger(BINDING_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(DELETED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Binding_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Binding message of the Format:
+ * <pre>BND-1001 : Create[ : Arguments : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED(String param1, boolean opt1)
+ {
+ String rawMessage = _messages.getString("CREATED");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : Arguments : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Binding message of the Format:
+ * <pre>BND-1002 : Deleted</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DELETED()
+ {
+ String rawMessage = _messages.getString("DELETED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DELETED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private BindingMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties
index 808ec7918f..808ec7918f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
new file mode 100644
index 0000000000..d4ba32673f
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
@@ -0,0 +1,458 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Broker_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class BrokerMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String BROKER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker";
+ public static final String LOG_CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.log_config";
+ public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
+ public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
+ public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
+ public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
+ public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.listening";
+ public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
+ public static final String PLATFORM_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.platform";
+ public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down";
+ public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode";
+ public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
+ public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
+
+ static
+ {
+ Logger.getLogger(BROKER_LOG_HIERARCHY);
+ Logger.getLogger(LOG_CONFIG_LOG_HIERARCHY);
+ Logger.getLogger(CONFIG_LOG_HIERARCHY);
+ Logger.getLogger(STATS_DATA_LOG_HIERARCHY);
+ Logger.getLogger(STOPPED_LOG_HIERARCHY);
+ Logger.getLogger(STATS_MSGS_LOG_HIERARCHY);
+ Logger.getLogger(LISTENING_LOG_HIERARCHY);
+ Logger.getLogger(MAX_MEMORY_LOG_HIERARCHY);
+ Logger.getLogger(PLATFORM_LOG_HIERARCHY);
+ Logger.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
+ Logger.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY);
+ Logger.getLogger(STARTUP_LOG_HIERARCHY);
+ Logger.getLogger(READY_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1007 : Using logging configuration : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage LOG_CONFIG(String param1)
+ {
+ String rawMessage = _messages.getString("LOG_CONFIG");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return LOG_CONFIG_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1006 : Using configuration : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CONFIG(String param1)
+ {
+ String rawMessage = _messages.getString("CONFIG");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CONFIG_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
+ {
+ String rawMessage = _messages.getString("STATS_DATA");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_DATA_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1005 : Stopped</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STOPPED()
+ {
+ String rawMessage = _messages.getString("STOPPED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STOPPED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1009 : {0,choice,0#delivered|1#received} : {1,number,#.###} msg/s peak : {2,number,#} msgs total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
+ {
+ String rawMessage = _messages.getString("STATS_MSGS");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_MSGS_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage LISTENING(String param1, Number param2)
+ {
+ String rawMessage = _messages.getString("LISTENING");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return LISTENING_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1011 : Maximum Memory : {0,number} bytes</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage MAX_MEMORY(Number param1)
+ {
+ String rawMessage = _messages.getString("MAX_MEMORY");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return MAX_MEMORY_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1010 : Platform : JVM : {0} version: {1} OS : {2} version: {3} arch: {4}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage PLATFORM(String param1, String param2, String param3, String param4, String param5)
+ {
+ String rawMessage = _messages.getString("PLATFORM");
+
+ final Object[] messageArguments = {param1, param2, param3, param4, param5};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return PLATFORM_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+ {
+ String rawMessage = _messages.getString("SHUTTING_DOWN");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return SHUTTING_DOWN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1012 : Management Mode : User Details : {0} / {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage MANAGEMENT_MODE(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("MANAGEMENT_MODE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return MANAGEMENT_MODE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STARTUP(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("STARTUP");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STARTUP_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1004 : Qpid Broker Ready</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage READY()
+ {
+ String rawMessage = _messages.getString("READY");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return READY_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private BrokerMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
index 76c1fa1b5b..76c1fa1b5b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
new file mode 100644
index 0000000000..66fdc93c6d
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
@@ -0,0 +1,453 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Channel_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ChannelMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String CHANNEL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel";
+ public static final String FLOW_ENFORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_enforced";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.create";
+ public static final String FLOW_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close";
+ public static final String PREFETCH_SIZE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.prefetch_size";
+ public static final String CLOSE_FORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close_forced";
+ public static final String DEADLETTERMSG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.deadlettermsg";
+ public static final String DISCARDMSG_NOALTEXCH_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noaltexch";
+ public static final String IDLE_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.idle_txn";
+ public static final String DISCARDMSG_NOROUTE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noroute";
+ public static final String OPEN_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.open_txn";
+ public static final String FLOW_REMOVED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_removed";
+
+ static
+ {
+ Logger.getLogger(CHANNEL_LOG_HIERARCHY);
+ Logger.getLogger(FLOW_ENFORCED_LOG_HIERARCHY);
+ Logger.getLogger(CREATE_LOG_HIERARCHY);
+ Logger.getLogger(FLOW_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_LOG_HIERARCHY);
+ Logger.getLogger(PREFETCH_SIZE_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_FORCED_LOG_HIERARCHY);
+ Logger.getLogger(DEADLETTERMSG_LOG_HIERARCHY);
+ Logger.getLogger(DISCARDMSG_NOALTEXCH_LOG_HIERARCHY);
+ Logger.getLogger(IDLE_TXN_LOG_HIERARCHY);
+ Logger.getLogger(DISCARDMSG_NOROUTE_LOG_HIERARCHY);
+ Logger.getLogger(OPEN_TXN_LOG_HIERARCHY);
+ Logger.getLogger(FLOW_REMOVED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Channel_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1005 : Flow Control Enforced (Queue {0})</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage FLOW_ENFORCED(String param1)
+ {
+ String rawMessage = _messages.getString("FLOW_ENFORCED");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return FLOW_ENFORCED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1001 : Create</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATE()
+ {
+ String rawMessage = _messages.getString("CREATE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1002 : Flow {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage FLOW(String param1)
+ {
+ String rawMessage = _messages.getString("FLOW");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return FLOW_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1003 : Close</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE()
+ {
+ String rawMessage = _messages.getString("CLOSE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage PREFETCH_SIZE(Number param1, Number param2)
+ {
+ String rawMessage = _messages.getString("PREFETCH_SIZE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return PREFETCH_SIZE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1003 : Close : {0,number} - {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE_FORCED(Number param1, String param2)
+ {
+ String rawMessage = _messages.getString("CLOSE_FORCED");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_FORCED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1011 : Message : {0,number} moved to dead letter queue : {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DEADLETTERMSG(Number param1, String param2)
+ {
+ String rawMessage = _messages.getString("DEADLETTERMSG");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DEADLETTERMSG_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1009 : Discarded message : {0,number} as no alternate exchange configured for queue : {1} routing key : {2}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DISCARDMSG_NOALTEXCH(Number param1, String param2, String param3)
+ {
+ String rawMessage = _messages.getString("DISCARDMSG_NOALTEXCH");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DISCARDMSG_NOALTEXCH_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1008 : Idle Transaction : {0,number} ms</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage IDLE_TXN(Number param1)
+ {
+ String rawMessage = _messages.getString("IDLE_TXN");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return IDLE_TXN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1010 : Discarded message : {0,number} as no binding on alternate exchange : {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DISCARDMSG_NOROUTE(Number param1, String param2)
+ {
+ String rawMessage = _messages.getString("DISCARDMSG_NOROUTE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DISCARDMSG_NOROUTE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1007 : Open Transaction : {0,number} ms</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OPEN_TXN(Number param1)
+ {
+ String rawMessage = _messages.getString("OPEN_TXN");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OPEN_TXN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Channel message of the Format:
+ * <pre>CHN-1006 : Flow Control Removed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage FLOW_REMOVED()
+ {
+ String rawMessage = _messages.getString("FLOW_REMOVED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return FLOW_REMOVED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private ChannelMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties
index 397c12d73c..397c12d73c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
new file mode 100644
index 0000000000..a07e0e3fe4
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of ConfigStore_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ConfigStoreMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String CONFIGSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore";
+ public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_complete";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.close";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.created";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.store_location";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_start";
+
+ static
+ {
+ Logger.getLogger(CONFIGSTORE_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_START_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ConfigStore_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a ConfigStore message of the Format:
+ * <pre>CFG-1005 : Recovery Complete</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_COMPLETE()
+ {
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ConfigStore message of the Format:
+ * <pre>CFG-1003 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE()
+ {
+ String rawMessage = _messages.getString("CLOSE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ConfigStore message of the Format:
+ * <pre>CFG-1001 : Created</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED()
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ConfigStore message of the Format:
+ * <pre>CFG-1002 : Store location : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STORE_LOCATION(String param1)
+ {
+ String rawMessage = _messages.getString("STORE_LOCATION");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STORE_LOCATION_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ConfigStore message of the Format:
+ * <pre>CFG-1004 : Recovery Start</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_START()
+ {
+ String rawMessage = _messages.getString("RECOVERY_START");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_START_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private ConfigStoreMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties
index 541f8b8c68..541f8b8c68 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
new file mode 100644
index 0000000000..639705edbf
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Connection_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ConnectionMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String CONNECTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection";
+ public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.open";
+ public static final String IDLE_CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.idle_close";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.close";
+
+ static
+ {
+ Logger.getLogger(CONNECTION_LOG_HIERARCHY);
+ Logger.getLogger(OPEN_LOG_HIERARCHY);
+ Logger.getLogger(IDLE_CLOSE_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Connection_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Connection message of the Format:
+ * <pre>CON-1001 : Open[ : Client ID : {0}][ : Protocol Version : {1}][ : Client Version : {2}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OPEN(String param1, String param2, String param3, boolean opt1, boolean opt2, boolean opt3)
+ {
+ String rawMessage = _messages.getString("OPEN");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : Client ID : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+
+ // Add Option : : Protocol Version : {1}.
+ end = parts[2].indexOf(']');
+ if (opt2)
+ {
+ msg.append(parts[2].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[2].substring(end + 1));
+
+ // Add Option : : Client Version : {2}.
+ end = parts[3].indexOf(']');
+ if (opt3)
+ {
+ msg.append(parts[3].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[3].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OPEN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Connection message of the Format:
+ * <pre>CON-1003 : Closed due to inactivity</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage IDLE_CLOSE()
+ {
+ String rawMessage = _messages.getString("IDLE_CLOSE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return IDLE_CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Connection message of the Format:
+ * <pre>CON-1002 : Close</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE()
+ {
+ String rawMessage = _messages.getString("CLOSE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private ConnectionMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties
index a99bcc7352..a99bcc7352 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
new file mode 100644
index 0000000000..f9e86ef8b3
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Exchange_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ExchangeMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String EXCHANGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange";
+ public static final String DISCARDMSG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.discardmsg";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.created";
+ public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.deleted";
+
+ static
+ {
+ Logger.getLogger(EXCHANGE_LOG_HIERARCHY);
+ Logger.getLogger(DISCARDMSG_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(DELETED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Exchange_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Exchange message of the Format:
+ * <pre>EXH-1003 : Discarded Message : Name: {0} Routing Key: {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DISCARDMSG(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("DISCARDMSG");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DISCARDMSG_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Exchange message of the Format:
+ * <pre>EXH-1001 : Create :[ Durable] Type: {0} Name: {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED(String param1, String param2, boolean opt1)
+ {
+ String rawMessage = _messages.getString("CREATED");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : Durable.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Exchange message of the Format:
+ * <pre>EXH-1002 : Deleted</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DELETED()
+ {
+ String rawMessage = _messages.getString("DELETED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DELETED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private ExchangeMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties
index b25a6a7301..b25a6a7301 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
new file mode 100644
index 0000000000..df700b2222
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
@@ -0,0 +1,332 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of ManagementConsole_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ManagementConsoleMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String MANAGEMENTCONSOLE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole";
+ public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.open";
+ public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.listening";
+ public static final String SSL_KEYSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.ssl_keystore";
+ public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.stopped";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.close";
+ public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.shutting_down";
+ public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.startup";
+ public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.ready";
+
+ static
+ {
+ Logger.getLogger(MANAGEMENTCONSOLE_LOG_HIERARCHY);
+ Logger.getLogger(OPEN_LOG_HIERARCHY);
+ Logger.getLogger(LISTENING_LOG_HIERARCHY);
+ Logger.getLogger(SSL_KEYSTORE_LOG_HIERARCHY);
+ Logger.getLogger(STOPPED_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_LOG_HIERARCHY);
+ Logger.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
+ Logger.getLogger(STARTUP_LOG_HIERARCHY);
+ Logger.getLogger(READY_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ManagementConsole_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1007 : Open : User {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OPEN(String param1)
+ {
+ String rawMessage = _messages.getString("OPEN");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OPEN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1002 : Starting : {0} : Listening on port {1,number,#}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage LISTENING(String param1, Number param2)
+ {
+ String rawMessage = _messages.getString("LISTENING");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return LISTENING_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1006 : Using SSL Keystore : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage SSL_KEYSTORE(String param1)
+ {
+ String rawMessage = _messages.getString("SSL_KEYSTORE");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return SSL_KEYSTORE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1005 : {0} Management Stopped</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STOPPED(String param1)
+ {
+ String rawMessage = _messages.getString("STOPPED");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STOPPED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1008 : Close : User {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE(String param1)
+ {
+ String rawMessage = _messages.getString("CLOSE");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1003 : Shutting down : {0} : port {1,number,#}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+ {
+ String rawMessage = _messages.getString("SHUTTING_DOWN");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return SHUTTING_DOWN_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1001 : {0} Management Startup</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STARTUP(String param1)
+ {
+ String rawMessage = _messages.getString("STARTUP");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STARTUP_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a ManagementConsole message of the Format:
+ * <pre>MNG-1004 : {0} Management Ready</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage READY(String param1)
+ {
+ String rawMessage = _messages.getString("READY");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return READY_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private ManagementConsoleMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
index 7924be28d3..7924be28d3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
new file mode 100644
index 0000000000..2c700df31c
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
@@ -0,0 +1,331 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of MessageStore_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class MessageStoreMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String MESSAGESTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore";
+ public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_complete";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.closed";
+ public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.overfull";
+ public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovered";
+ public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.underfull";
+ public static final String PASSIVATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.passivate";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.created";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.store_location";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_start";
+
+ static
+ {
+ Logger.getLogger(MESSAGESTORE_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ Logger.getLogger(CLOSED_LOG_HIERARCHY);
+ Logger.getLogger(OVERFULL_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERED_LOG_HIERARCHY);
+ Logger.getLogger(UNDERFULL_LOG_HIERARCHY);
+ Logger.getLogger(PASSIVATE_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_START_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.MessageStore_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1006 : Recovery Complete</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_COMPLETE()
+ {
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1003 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSED()
+ {
+ String rawMessage = _messages.getString("CLOSED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1008 : Store overfull, flow control will be enforced</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OVERFULL()
+ {
+ String rawMessage = _messages.getString("OVERFULL");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OVERFULL_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1005 : Recovered {0,number} messages</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERED(Number param1)
+ {
+ String rawMessage = _messages.getString("RECOVERED");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1009 : Store overfull condition cleared</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage UNDERFULL()
+ {
+ String rawMessage = _messages.getString("UNDERFULL");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return UNDERFULL_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1007 : Store Passivated</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage PASSIVATE()
+ {
+ String rawMessage = _messages.getString("PASSIVATE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return PASSIVATE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1001 : Created</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED()
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1002 : Store location : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STORE_LOCATION(String param1)
+ {
+ String rawMessage = _messages.getString("STORE_LOCATION");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STORE_LOCATION_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a MessageStore message of the Format:
+ * <pre>MST-1004 : Recovery Start</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_START()
+ {
+ String rawMessage = _messages.getString("RECOVERY_START");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_START_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private MessageStoreMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties
index d3823a71a0..d3823a71a0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
new file mode 100644
index 0000000000..75fa5b533e
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Queue_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class QueueMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue";
+ public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.overfull";
+ public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.underfull";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.created";
+ public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.deleted";
+
+ static
+ {
+ Logger.getLogger(QUEUE_LOG_HIERARCHY);
+ Logger.getLogger(OVERFULL_LOG_HIERARCHY);
+ Logger.getLogger(UNDERFULL_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(DELETED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Queue_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Queue message of the Format:
+ * <pre>QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OVERFULL(Number param1, Number param2)
+ {
+ String rawMessage = _messages.getString("OVERFULL");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OVERFULL_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Queue message of the Format:
+ * <pre>QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage UNDERFULL(Number param1, Number param2)
+ {
+ String rawMessage = _messages.getString("UNDERFULL");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return UNDERFULL_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Queue message of the Format:
+ * <pre>QUE-1001 : Create :[ Owner: {0}][ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED(String param1, Number param2, boolean opt1, boolean opt2, boolean opt3, boolean opt4, boolean opt5)
+ {
+ String rawMessage = _messages.getString("CREATED");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : Owner: {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+
+ // Add Option : AutoDelete.
+ end = parts[2].indexOf(']');
+ if (opt2)
+ {
+ msg.append(parts[2].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[2].substring(end + 1));
+
+ // Add Option : Durable.
+ end = parts[3].indexOf(']');
+ if (opt3)
+ {
+ msg.append(parts[3].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[3].substring(end + 1));
+
+ // Add Option : Transient.
+ end = parts[4].indexOf(']');
+ if (opt4)
+ {
+ msg.append(parts[4].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[4].substring(end + 1));
+
+ // Add Option : Priority: {1,number,#}.
+ end = parts[5].indexOf(']');
+ if (opt5)
+ {
+ msg.append(parts[5].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[5].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Queue message of the Format:
+ * <pre>QUE-1002 : Deleted</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage DELETED()
+ {
+ String rawMessage = _messages.getString("DELETED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return DELETED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private QueueMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
index 538bf994ea..538bf994ea 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
new file mode 100644
index 0000000000..b58b324ece
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of Subscription_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class SubscriptionMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String SUBSCRIPTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription";
+ public static final String STATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.state";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.create";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.close";
+
+ static
+ {
+ Logger.getLogger(SUBSCRIPTION_LOG_HIERARCHY);
+ Logger.getLogger(STATE_LOG_HIERARCHY);
+ Logger.getLogger(CREATE_LOG_HIERARCHY);
+ Logger.getLogger(CLOSE_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Subscription_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a Subscription message of the Format:
+ * <pre>SUB-1003 : State : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATE(String param1)
+ {
+ String rawMessage = _messages.getString("STATE");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Subscription message of the Format:
+ * <pre>SUB-1001 : Create[ : Durable][ : Arguments : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATE(String param1, boolean opt1, boolean opt2)
+ {
+ String rawMessage = _messages.getString("CREATE");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : Durable.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+
+ // Add Option : : Arguments : {0}.
+ end = parts[2].indexOf(']');
+ if (opt2)
+ {
+ msg.append(parts[2].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[2].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a Subscription message of the Format:
+ * <pre>SUB-1002 : Close</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSE()
+ {
+ String rawMessage = _messages.getString("CLOSE");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private SubscriptionMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties
index ef5f885b50..ef5f885b50 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
new file mode 100644
index 0000000000..22c54f0ec7
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
@@ -0,0 +1,368 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of TransactionLog_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class TransactionLogMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String TRANSACTIONLOG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.closed";
+ public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_complete";
+ public static final String XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_message";
+ public static final String XA_INCOMPLETE_QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_queue";
+ public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovered";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.created";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.store_location";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_start";
+
+ static
+ {
+ Logger.getLogger(TRANSACTIONLOG_LOG_HIERARCHY);
+ Logger.getLogger(CLOSED_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ Logger.getLogger(XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY);
+ Logger.getLogger(XA_INCOMPLETE_QUEUE_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERED_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ Logger.getLogger(RECOVERY_START_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.TransactionLog_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1003 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSED()
+ {
+ String rawMessage = _messages.getString("CLOSED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1006 : Recovery Complete[ : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_COMPLETE(String param1, boolean opt1)
+ {
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1008 : XA transaction recover for xid {0} incomplete as it references a message {1} which was not durably retained</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage XA_INCOMPLETE_MESSAGE(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("XA_INCOMPLETE_MESSAGE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1007 : XA transaction recover for xid {0} incomplete as it references a queue {1} which was not durably retained</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage XA_INCOMPLETE_QUEUE(String param1, String param2)
+ {
+ String rawMessage = _messages.getString("XA_INCOMPLETE_QUEUE");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return XA_INCOMPLETE_QUEUE_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1005 : Recovered {0,number} messages for queue {1}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERED(Number param1, String param2)
+ {
+ String rawMessage = _messages.getString("RECOVERED");
+
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1001 : Created</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED()
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1002 : Store location : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STORE_LOCATION(String param1)
+ {
+ String rawMessage = _messages.getString("STORE_LOCATION");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STORE_LOCATION_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a TransactionLog message of the Format:
+ * <pre>TXN-1004 : Recovery Start[ : {0}]</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage RECOVERY_START(String param1, boolean opt1)
+ {
+ String rawMessage = _messages.getString("RECOVERY_START");
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+
+ // Add Option : : {0}.
+ end = parts[1].indexOf(']');
+ if (opt1)
+ {
+ msg.append(parts[1].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[1].substring(end + 1));
+ }
+
+ rawMessage = msg.toString();
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return RECOVERY_START_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private TransactionLogMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties
index b9e87159a6..b9e87159a6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
new file mode 100644
index 0000000000..149d6d2e89
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
@@ -0,0 +1,220 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.logging.messages;
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of VirtualHost_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class VirtualHostMessages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String VIRTUALHOST_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.closed";
+ public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_data";
+ public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_msgs";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.created";
+ public static final String ERRORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.errored";
+
+ static
+ {
+ Logger.getLogger(VIRTUALHOST_LOG_HIERARCHY);
+ Logger.getLogger(CLOSED_LOG_HIERARCHY);
+ Logger.getLogger(STATS_DATA_LOG_HIERARCHY);
+ Logger.getLogger(STATS_MSGS_LOG_HIERARCHY);
+ Logger.getLogger(CREATED_LOG_HIERARCHY);
+ Logger.getLogger(ERRORED_LOG_HIERARCHY);
+
+ _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.VirtualHost_logmessages", _currentLocale);
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1002 : Closed</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CLOSED()
+ {
+ String rawMessage = _messages.getString("CLOSED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CLOSED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1003 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} kB/s peak : {3,number,#} bytes total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_DATA(String param1, Number param2, Number param3, Number param4)
+ {
+ String rawMessage = _messages.getString("STATS_DATA");
+
+ final Object[] messageArguments = {param1, param2, param3, param4};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_DATA_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1004 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} msg/s peak : {3,number,#} msgs total</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage STATS_MSGS(String param1, Number param2, Number param3, Number param4)
+ {
+ String rawMessage = _messages.getString("STATS_MSGS");
+
+ final Object[] messageArguments = {param1, param2, param3, param4};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STATS_MSGS_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1001 : Created : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage CREATED(String param1)
+ {
+ String rawMessage = _messages.getString("CREATED");
+
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return CREATED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+ /**
+ * Log a VirtualHost message of the Format:
+ * <pre>VHT-1005 : Unexpected fatal error</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage ERRORED()
+ {
+ String rawMessage = _messages.getString("ERRORED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return ERRORED_LOG_HIERARCHY;
+ }
+ };
+ }
+
+
+ private VirtualHostMessages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties
index 5695026cbc..5695026cbc 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java
index baccf240ff..baccf240ff 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/AbstractLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java
index a633162e85..a633162e85 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/BindingLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java
index 5b0e34b73e..5b0e34b73e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ChannelLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java
index 87c2377e0f..87c2377e0f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java
index 5affafad75..5affafad75 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java
index 7611ee1a88..7611ee1a88 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/LogSubjectFormat.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java
index ed989d764f..ed989d764f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java
index 53a9ab75d9..53a9ab75d9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/QueueLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java
index 9a23b733dc..9a23b733dc 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java
index 63bd1e45a0..63bd1e45a0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AMQMessageHeader.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
index 8311dbd5ff..8311dbd5ff 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java
index 7be91ad0ca..7be91ad0ca 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/EnqueableMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/InboundMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/InboundMessage.java
index 1b3fdb1870..1b3fdb1870 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/InboundMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/InboundMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageContentSource.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageContentSource.java
index 44741f57bd..44741f57bd 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageContentSource.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageContentSource.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageReference.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageReference.java
index 399f8f9327..399f8f9327 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageReference.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/MessageReference.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/ServerMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
index e1ad2fd0ca..e1ad2fd0ca 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/ServerMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java
index d96bef0463..d96bef0463 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AccessControlProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Attribute.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Attribute.java
index 4fccf47e0e..4fccf47e0e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Attribute.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Attribute.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java
index 7a5927a365..7a5927a365 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationMethod.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java
index f75d0211cb..f75d0211cb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Binding.java
index fdb009386c..fdb009386c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Binding.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Binding.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
index 0c1a6de58b..0c1a6de58b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java
index d20c709e90..d20c709e90 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationChangeListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
index 45e743dbca..45e743dbca 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java
index 6a7d6f8f7b..6a7d6f8f7b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Connection.java
index 3139850892..3139850892 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Connection.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Connection.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Consumer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
index 958177e713..958177e713 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Consumer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Event.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Event.java
index 91b684f06e..91b684f06e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Event.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Event.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/EventType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/EventType.java
index edd5ce4250..edd5ce4250 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/EventType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/EventType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Exchange.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
index e63c71e955..e63c71e955 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Exchange.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Group.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Group.java
index aacd515107..aacd515107 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Group.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Group.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupMember.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupMember.java
index 6832cc6fa6..6832cc6fa6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupMember.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupMember.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupProvider.java
index 9016f97927..9016f97927 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/GroupProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/GroupProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java
index 9cab5e2103..9cab5e2103 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IllegalStateTransitionException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java
index def450640a..def450640a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/IntegrityViolationException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/KeyStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
index ab909390bd..ab909390bd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/KeyStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java
index c9006f4e71..c9006f4e71 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/LifetimePolicy.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
new file mode 100644
index 0000000000..50538a5580
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.model;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Model
+{
+ /*
+ * API version for the broker model
+ *
+ * 1.0 Initial version
+ * 1.1 Addition of mandatory virtual host type / different types of virtual host
+ *
+ */
+ public static final int MODEL_MAJOR_VERSION = 1;
+ public static final int MODEL_MINOR_VERSION = 2;
+ public static final String MODEL_VERSION = MODEL_MAJOR_VERSION + "." + MODEL_MINOR_VERSION;
+
+ private static final Model MODEL_INSTANCE = new Model();
+
+ private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>
+ _parents = new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
+
+ private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>
+ _children = new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
+
+ public static Model getInstance()
+ {
+ return MODEL_INSTANCE;
+ }
+
+ private Model()
+ {
+ addRelationship(Broker.class, VirtualHost.class);
+ addRelationship(Broker.class, Port.class);
+ addRelationship(Broker.class, AccessControlProvider.class);
+ addRelationship(Broker.class, AuthenticationProvider.class);
+ addRelationship(Broker.class, GroupProvider.class);
+ addRelationship(Broker.class, TrustStore.class);
+ addRelationship(Broker.class, KeyStore.class);
+ addRelationship(Broker.class, Plugin.class);
+
+ addRelationship(VirtualHost.class, Exchange.class);
+ addRelationship(VirtualHost.class, Queue.class);
+ addRelationship(VirtualHost.class, Connection.class);
+ addRelationship(VirtualHost.class, VirtualHostAlias.class);
+
+ addRelationship(AuthenticationProvider.class, User.class);
+ addRelationship(AuthenticationProvider.class, PreferencesProvider.class);
+ addRelationship(User.class, GroupMember.class);
+
+ addRelationship(GroupProvider.class, Group.class);
+ addRelationship(Group.class, GroupMember.class);
+
+ addRelationship(Connection.class, Session.class);
+
+ addRelationship(Queue.class, Binding.class);
+ addRelationship(Queue.class, Consumer.class);
+
+ addRelationship(Exchange.class, Binding.class);
+ addRelationship(Exchange.class, Publisher.class);
+
+ addRelationship(Session.class, Consumer.class);
+ addRelationship(Session.class, Publisher.class);
+ }
+
+ public Collection<Class<? extends ConfiguredObject>> getParentTypes(Class<? extends ConfiguredObject> child)
+ {
+ Collection<Class<? extends ConfiguredObject>> parentTypes = _parents.get(child);
+ return parentTypes == null ? Collections.<Class<? extends ConfiguredObject>>emptyList()
+ : Collections.unmodifiableCollection(parentTypes);
+ }
+
+ public Collection<Class<? extends ConfiguredObject>> getChildTypes(Class<? extends ConfiguredObject> parent)
+ {
+ Collection<Class<? extends ConfiguredObject>> childTypes = _children.get(parent);
+ return childTypes == null ? Collections.<Class<? extends ConfiguredObject>>emptyList()
+ : Collections.unmodifiableCollection(childTypes);
+ }
+
+ private void addRelationship(Class<? extends ConfiguredObject> parent, Class<? extends ConfiguredObject> child)
+ {
+ Collection<Class<? extends ConfiguredObject>> parents = _parents.get(child);
+ if(parents == null)
+ {
+ parents = new ArrayList<Class<? extends ConfiguredObject>>();
+ _parents.put(child, parents);
+ }
+ parents.add(parent);
+
+ Collection<Class<? extends ConfiguredObject>> children = _children.get(parent);
+ if(children == null)
+ {
+ children = new ArrayList<Class<? extends ConfiguredObject>>();
+ _children.put(parent, children);
+ }
+ children.add(child);
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java
index 1027e5ce8c..1027e5ce8c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PasswordCredentialManagingAuthenticationProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Plugin.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Plugin.java
index b9503a5841..b9503a5841 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Plugin.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Plugin.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Port.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java
index 60d62e3f27..60d62e3f27 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Port.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java
new file mode 100644
index 0000000000..fadd036a58
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java
@@ -0,0 +1,89 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.model;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+public interface PreferencesProvider extends ConfiguredObject
+{
+ String ID = "id";
+ String NAME = "name";
+ String TYPE = "type";
+ String CREATED = "created";
+ String UPDATED = "updated";
+ String DURABLE = "durable";
+ String LIFETIME_POLICY = "lifetimePolicy";
+ String STATE = "state";
+ String TIME_TO_LIVE = "timeToLive";
+
+ Collection<String> AVAILABLE_ATTRIBUTES =
+ Collections.unmodifiableList(
+ Arrays.asList(
+ ID,
+ NAME,
+ STATE,
+ TYPE,
+ CREATED,
+ UPDATED,
+ DURABLE,
+ LIFETIME_POLICY,
+ TIME_TO_LIVE
+ ));
+
+ /**
+ * Returns preferences {@link Map} for a given user ID
+ * @param userId user ID to retrieve preferences for
+ * @return preferences {@link Map}
+ */
+ Map<String, Object> getPreferences(String userId);
+
+ /**
+ * Set user preferences as specified in a given {@link Map}
+ * @param userId user ID to set preferences for
+ * @param preferences new preferences
+ * @return existing user preferences
+ */
+ Map<String, Object> setPreferences(String userId, Map<String, Object> preferences);
+
+ /**
+ * Delete preferences for given user IDs
+ * @param userIDs user IDs to delete preferences for
+ * @return user an array with user IDs having preferences deleted
+ */
+ String[] deletePreferences(String... userIDs);
+
+ /**
+ * Returns set of the user IDs having preferences set
+ * @return user IDs
+ */
+ Set<String> listUserIDs();
+
+ /**
+ * Returns authentication provider associated with this preferences provider
+ * @return authentication provider
+ */
+ AuthenticationProvider getAuthenticationProvider();
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Protocol.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Protocol.java
index e9d50fbc59..e9d50fbc59 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Protocol.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Protocol.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Publisher.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Publisher.java
index cdb85d8023..cdb85d8023 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Publisher.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Publisher.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Queue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
index ae2031bd71..ae2031bd71 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Queue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java
index ab601f685c..ab601f685c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueNotificationListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueType.java
index 96f2a7e2e5..96f2a7e2e5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/QueueType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/QueueType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Session.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Session.java
index e813d0c129..e813d0c129 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Session.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Session.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/State.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/State.java
index a4287e09b1..a4287e09b1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/State.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/State.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Statistics.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Statistics.java
index 92d6f47741..92d6f47741 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Statistics.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Statistics.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Transport.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Transport.java
index ae6e5ac43a..ae6e5ac43a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Transport.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Transport.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/TrustStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
index d313e1832f..d313e1832f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/TrustStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java
index 7def89025d..7def89025d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/UUIDGenerator.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/User.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/User.java
new file mode 100644
index 0000000000..cf1a688634
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/User.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.model;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+public interface User extends ConfiguredObject
+{
+ String CREATED = "created";
+ String DURABLE = "durable";
+ String ID = "id";
+ String LIFETIME_POLICY = "lifetimePolicy";
+ String NAME = "name";
+ String STATE = "state";
+ String TIME_TO_LIVE = "timeToLive";
+ String UPDATED = "updated";
+ String PASSWORD = "password";
+
+ // Attributes
+ public static final Collection<String> AVAILABLE_ATTRIBUTES =
+ Collections.unmodifiableList(
+ Arrays.asList(
+ ID,
+ NAME,
+ STATE,
+ DURABLE,
+ LIFETIME_POLICY,
+ TIME_TO_LIVE,
+ CREATED,
+ UPDATED,
+ PASSWORD
+ ));
+
+ public void setPassword(String password);
+
+ public Map<String, Object> getPreferences();
+
+ public Object getPreference(String name);
+
+ public Map<String, Object> setPreferences(Map<String, Object> preferences);
+
+ public boolean deletePreferences();
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
index ae07005679..ae07005679 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java
index 31403d78e5..31403d78e5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHostAlias.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
index 9ac2cb00a3..9ac2cb00a3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
index 707cf8076d..707cf8076d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
index 2867a92410..2867a92410 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java
index a6fe191523..a6fe191523 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java
index 6cdf2f2c1a..6cdf2f2c1a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java
index a4ce95e5aa..a4ce95e5aa 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AmqpPortAdapter.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
new file mode 100644
index 0000000000..656bdc9acf
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
@@ -0,0 +1,826 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import java.io.IOException;
+import java.security.AccessControlException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.security.auth.login.AccountNotFoundException;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.IllegalStateTransitionException;
+import org.apache.qpid.server.model.IntegrityViolationException;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.Statistics;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.model.User;
+import org.apache.qpid.server.model.VirtualHostAlias;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.plugin.PreferencesProviderFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.security.access.Operation;
+import org.apache.qpid.server.security.auth.UsernamePrincipal;
+import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
+import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
+import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.util.MapValueConverter;
+
+public abstract class AuthenticationProviderAdapter<T extends AuthenticationManager> extends AbstractAdapter implements AuthenticationProvider
+{
+ private static final Logger LOGGER = Logger.getLogger(AuthenticationProviderAdapter.class);
+
+ protected T _authManager;
+ protected final Broker _broker;
+
+ protected Collection<String> _supportedAttributes;
+ protected Map<String, AuthenticationManagerFactory> _factories;
+ private final AtomicReference<State> _state;
+ private PreferencesProvider _preferencesProvider;
+
+ private AuthenticationProviderAdapter(UUID id, Broker broker, final T authManager, Map<String, Object> attributes, Collection<String> attributeNames)
+ {
+ super(id, null, null, broker.getTaskExecutor());
+ _authManager = authManager;
+ _broker = broker;
+ _supportedAttributes = createSupportedAttributes(attributeNames);
+ _factories = getAuthenticationManagerFactories();
+
+ State state = MapValueConverter.getEnumAttribute(State.class, STATE, attributes, State.INITIALISING);
+ _state = new AtomicReference<State>(state);
+ addParent(Broker.class, broker);
+
+ // set attributes now after all attribute names are known
+ if (attributes != null)
+ {
+ for (String name : _supportedAttributes)
+ {
+ if (attributes.containsKey(name))
+ {
+ changeAttribute(name, null, attributes.get(name));
+ }
+ }
+ }
+ }
+
+ T getAuthManager()
+ {
+ return _authManager;
+ }
+
+ @Override
+ public Collection<VirtualHostAlias> getVirtualHostPortBindings()
+ {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public String getName()
+ {
+ return (String)getAttribute(AuthenticationProvider.NAME);
+ }
+
+ @Override
+ public String setName(String currentName, String desiredName) throws IllegalStateException, AccessControlException
+ {
+ return null;
+ }
+
+ @Override
+ public State getActualState()
+ {
+ return _state.get();
+ }
+
+ @Override
+ public boolean isDurable()
+ {
+ return true;
+ }
+
+ @Override
+ public void setDurable(boolean durable)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ }
+
+ @Override
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+
+ @Override
+ public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ return null;
+ }
+
+ @Override
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ @Override
+ public long setTimeToLive(long expected, long desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ return 0;
+ }
+
+ @Override
+ public Statistics getStatistics()
+ {
+ return NoStatistics.getInstance();
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return _supportedAttributes;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if(CREATED.equals(name))
+ {
+ // TODO
+ }
+ else if(DURABLE.equals(name))
+ {
+ return true;
+ }
+ else if(ID.equals(name))
+ {
+ return getId();
+ }
+ else if(LIFETIME_POLICY.equals(name))
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+ else if(STATE.equals(name))
+ {
+ return getActualState();
+ }
+ else if(TIME_TO_LIVE.equals(name))
+ {
+ // TODO
+ }
+ else if(UPDATED.equals(name))
+ {
+ // TODO
+ }
+ return super.getAttribute(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ if (clazz == PreferencesProvider.class && _preferencesProvider != null)
+ {
+ return (Collection<C>)Collections.<PreferencesProvider>singleton(_preferencesProvider);
+ }
+ return Collections.emptySet();
+ }
+
+ @Override
+ public boolean setState(State currentState, State desiredState)
+ throws IllegalStateTransitionException, AccessControlException
+ {
+ State state = _state.get();
+ if(desiredState == State.DELETED)
+ {
+ String providerName = getName();
+
+ // verify that provider is not in use
+ Collection<Port> ports = new ArrayList<Port>(_broker.getPorts());
+ for (Port port : ports)
+ {
+ if (providerName.equals(port.getAttribute(Port.AUTHENTICATION_PROVIDER)))
+ {
+ throw new IntegrityViolationException("Authentication provider '" + providerName + "' is set on port " + port.getName());
+ }
+ }
+
+ if ((state == State.INITIALISING || state == State.ACTIVE || state == State.STOPPED || state == State.QUIESCED || state == State.ERRORED)
+ && _state.compareAndSet(state, State.DELETED))
+ {
+ _authManager.close();
+ _authManager.onDelete();
+ if (_preferencesProvider != null)
+ {
+ _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.DELETED);
+ }
+ return true;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot delete authentication provider in state: " + state);
+ }
+ }
+ else if(desiredState == State.ACTIVE)
+ {
+ if ((state == State.INITIALISING || state == State.QUIESCED || state == State.STOPPED) && _state.compareAndSet(state, State.ACTIVE))
+ {
+ try
+ {
+ _authManager.initialise();
+ if (_preferencesProvider != null)
+ {
+ _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.ACTIVE);
+ }
+ return true;
+ }
+ catch(RuntimeException e)
+ {
+ _state.compareAndSet(State.ACTIVE, State.ERRORED);
+ if (_broker.isManagementMode())
+ {
+ LOGGER.warn("Failed to activate authentication provider: " + getName(), e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot activate authentication provider in state: " + state);
+ }
+ }
+ else if (desiredState == State.QUIESCED)
+ {
+ if (state == State.INITIALISING && _state.compareAndSet(state, State.QUIESCED))
+ {
+ return true;
+ }
+ }
+ else if(desiredState == State.STOPPED)
+ {
+ if (_state.compareAndSet(state, State.STOPPED))
+ {
+ _authManager.close();
+ if (_preferencesProvider != null)
+ {
+ _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.STOPPED);
+ }
+ return true;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot stop authentication provider in state: " + state);
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public SubjectCreator getSubjectCreator()
+ {
+ return new SubjectCreator(_authManager, _broker.getGroupProviders());
+ }
+
+ @Override
+ protected void changeAttributes(Map<String, Object> attributes)
+ {
+ Map<String, Object> effectiveAttributes = super.generateEffectiveAttributes(attributes);
+ AuthenticationManager manager = validateAttributes(effectiveAttributes);
+ manager.initialise();
+ super.changeAttributes(attributes);
+ _authManager = (T)manager;
+
+ // if provider was previously in ERRORED state then set its state to ACTIVE
+ _state.compareAndSet(State.ERRORED, State.ACTIVE);
+ }
+
+ private Map<String, AuthenticationManagerFactory> getAuthenticationManagerFactories()
+ {
+ QpidServiceLoader<AuthenticationManagerFactory> loader = new QpidServiceLoader<AuthenticationManagerFactory>();
+ Iterable<AuthenticationManagerFactory> factories = loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class);
+ Map<String, AuthenticationManagerFactory> factoryMap = new HashMap<String, AuthenticationManagerFactory>();
+ for (AuthenticationManagerFactory factory : factories)
+ {
+ factoryMap.put(factory.getType(), factory);
+ }
+ return factoryMap;
+ }
+
+ protected Collection<String> createSupportedAttributes(Collection<String> factoryAttributes)
+ {
+ List<String> attributesNames = new ArrayList<String>(AVAILABLE_ATTRIBUTES);
+ if (factoryAttributes != null)
+ {
+ attributesNames.addAll(factoryAttributes);
+ }
+ return Collections.unmodifiableCollection(attributesNames);
+ }
+
+ protected AuthenticationManager validateAttributes(Map<String, Object> attributes)
+ {
+ super.validateChangeAttributes(attributes);
+
+ String newName = (String)attributes.get(NAME);
+ String currentName = getName();
+ if (!currentName.equals(newName))
+ {
+ throw new IllegalConfigurationException("Changing the name of authentication provider is not supported");
+ }
+ String newType = (String)attributes.get(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
+ String currentType = (String)getAttribute(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
+ if (!currentType.equals(newType))
+ {
+ throw new IllegalConfigurationException("Changing the type of authentication provider is not supported");
+ }
+ AuthenticationManagerFactory managerFactory = _factories.get(newType);
+ if (managerFactory == null)
+ {
+ throw new IllegalConfigurationException("Cannot find authentication provider factory for type " + newType);
+ }
+ AuthenticationManager manager = managerFactory.createInstance(_broker, attributes);
+ if (manager == null)
+ {
+ throw new IllegalConfigurationException("Cannot change authentication provider " + newName + " of type " + newType + " with the given attributes");
+ }
+ return manager;
+ }
+
+ @Override
+ protected void authoriseSetDesiredState(State currentState, State desiredState) throws AccessControlException
+ {
+ if(desiredState == State.DELETED)
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.DELETE))
+ {
+ throw new AccessControlException("Deletion of authentication provider is denied");
+ }
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of authentication provider attributes is denied");
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of authentication provider attributes is denied");
+ }
+ }
+
+ public PreferencesProvider getPreferencesProvider()
+ {
+ return _preferencesProvider;
+ }
+
+ public void setPreferencesProvider(PreferencesProvider provider)
+ {
+ if (AnonymousAuthenticationManagerFactory.PROVIDER_TYPE.equals(getAttribute(TYPE)))
+ {
+ throw new IllegalConfigurationException("Cannot set preferences provider for anonymous authentication provider");
+ }
+ _preferencesProvider = provider;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+ {
+ if(childClass == PreferencesProvider.class)
+ {
+ String name = MapValueConverter.getStringAttribute(PreferencesProvider.NAME, attributes);
+ String type = MapValueConverter.getStringAttribute(PreferencesProvider.TYPE, attributes);
+ PreferencesProviderFactory factory = PreferencesProviderFactory.FACTORIES.get(type);
+ UUID id = UUIDGenerator.generatePreferencesProviderUUID(name, getName());
+ PreferencesProvider pp = factory.createInstance(id, attributes, this);
+ pp.setDesiredState(State.INITIALISING, State.ACTIVE);
+ _preferencesProvider = pp;
+ return (C)pp;
+ }
+ throw new IllegalArgumentException("Cannot create child of class " + childClass.getSimpleName());
+ }
+
+ public static class SimpleAuthenticationProviderAdapter extends AuthenticationProviderAdapter<AuthenticationManager>
+ {
+
+ public SimpleAuthenticationProviderAdapter(
+ UUID id, Broker broker, AuthenticationManager authManager, Map<String, Object> attributes, Collection<String> attributeNames)
+ {
+ super(id, broker,authManager, attributes, attributeNames);
+ }
+ }
+
+ public static class PrincipalDatabaseAuthenticationManagerAdapter
+ extends AuthenticationProviderAdapter<PrincipalDatabaseAuthenticationManager>
+ implements PasswordCredentialManagingAuthenticationProvider
+ {
+ public PrincipalDatabaseAuthenticationManagerAdapter(
+ UUID id, Broker broker, PrincipalDatabaseAuthenticationManager authManager, Map<String, Object> attributes, Collection<String> attributeNames)
+ {
+ super(id, broker, authManager, attributes, attributeNames);
+ }
+
+ @Override
+ public boolean createUser(String username, String password, Map<String, String> attributes)
+ {
+ if(getSecurityManager().authoriseUserOperation(Operation.CREATE, username))
+ {
+ return getPrincipalDatabase().createPrincipal(new UsernamePrincipal(username), password.toCharArray());
+ }
+ else
+ {
+ throw new AccessControlException("Do not have permission to create new user");
+ }
+ }
+
+ @Override
+ public void deleteUser(String username) throws AccountNotFoundException
+ {
+ if(getSecurityManager().authoriseUserOperation(Operation.DELETE, username))
+ {
+ getPrincipalDatabase().deletePrincipal(new UsernamePrincipal(username));
+ }
+ else
+ {
+ throw new AccessControlException("Cannot delete user " + username);
+ }
+ }
+
+ private SecurityManager getSecurityManager()
+ {
+ return _broker.getSecurityManager();
+ }
+
+ private PrincipalDatabase getPrincipalDatabase()
+ {
+ return getAuthManager().getPrincipalDatabase();
+ }
+
+ @Override
+ public void setPassword(String username, String password) throws AccountNotFoundException
+ {
+ if(getSecurityManager().authoriseUserOperation(Operation.UPDATE, username))
+ {
+ getPrincipalDatabase().updatePassword(new UsernamePrincipal(username), password.toCharArray());
+ }
+ else
+ {
+ throw new AccessControlException("Do not have permission to set password");
+ }
+ }
+
+ @Override
+ public Map<String, Map<String, String>> getUsers()
+ {
+
+ Map<String, Map<String,String>> users = new HashMap<String, Map<String, String>>();
+ for(Principal principal : getPrincipalDatabase().getUsers())
+ {
+ users.put(principal.getName(), Collections.<String, String>emptyMap());
+ }
+ return users;
+ }
+
+ public void reload() throws IOException
+ {
+ getPrincipalDatabase().reload();
+ }
+
+ @Override
+ public <C extends ConfiguredObject> C addChild(Class<C> childClass,
+ Map<String, Object> attributes,
+ ConfiguredObject... otherParents)
+ {
+ if(childClass == User.class)
+ {
+ String username = (String) attributes.get("name");
+ String password = (String) attributes.get("password");
+ Principal p = new UsernamePrincipal(username);
+
+ if(createUser(username, password,null))
+ {
+ @SuppressWarnings("unchecked")
+ C pricipalAdapter = (C) new PrincipalAdapter(p);
+ return pricipalAdapter;
+ }
+ else
+ {
+ //TODO? Silly interface on the PrincipalDatabase at fault
+ throw new RuntimeException("Failed to create user");
+ }
+ }
+
+ return super.addChild(childClass, attributes, otherParents);
+ }
+
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ if(clazz == User.class)
+ {
+ List<Principal> users = getPrincipalDatabase().getUsers();
+ Collection<User> principals = new ArrayList<User>(users.size());
+ for(Principal user : users)
+ {
+ principals.add(new PrincipalAdapter(user));
+ }
+ @SuppressWarnings("unchecked")
+ Collection<C> unmodifiablePrincipals = (Collection<C>) Collections.unmodifiableCollection(principals);
+ return unmodifiablePrincipals;
+ }
+ else
+ {
+ return super.getChildren(clazz);
+ }
+ }
+
+ @Override
+ protected void childAdded(ConfiguredObject child)
+ {
+ if (child instanceof User)
+ {
+ // no-op, prevent storing users in the broker store
+ return;
+ }
+ super.childAdded(child);
+ }
+
+ @Override
+ protected void childRemoved(ConfiguredObject child)
+ {
+ if (child instanceof User)
+ {
+ // no-op, as per above, users are not in the store
+ return;
+ }
+ super.childRemoved(child);
+ }
+
+ private class PrincipalAdapter extends AbstractAdapter implements User
+ {
+ private final Principal _user;
+
+ public PrincipalAdapter(Principal user)
+ {
+ super(UUIDGenerator.generateUserUUID(PrincipalDatabaseAuthenticationManagerAdapter.this.getName(), user.getName()),
+ PrincipalDatabaseAuthenticationManagerAdapter.this.getTaskExecutor());
+ _user = user;
+
+ }
+
+ @Override
+ public void setPassword(String password)
+ {
+ try
+ {
+ PrincipalDatabaseAuthenticationManagerAdapter.this.setPassword(_user.getName(), password);
+ }
+ catch (AccountNotFoundException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ @Override
+ public String getName()
+ {
+ return _user.getName();
+ }
+
+ @Override
+ public String setName(String currentName, String desiredName)
+ throws IllegalStateException, AccessControlException
+ {
+ throw new IllegalStateException("Names cannot be updated");
+ }
+
+ @Override
+ public State getActualState()
+ {
+ return State.ACTIVE;
+ }
+
+ @Override
+ public boolean isDurable()
+ {
+ return true;
+ }
+
+ @Override
+ public void setDurable(boolean durable)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException("Durability cannot be updated");
+ }
+
+ @Override
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+
+ @Override
+ public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException("LifetimePolicy cannot be updated");
+ }
+
+ @Override
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ @Override
+ public long setTimeToLive(long expected, long desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException("ttl cannot be updated");
+ }
+
+ @Override
+ public Statistics getStatistics()
+ {
+ return NoStatistics.getInstance();
+ }
+
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ return null;
+ }
+
+ @Override
+ public <C extends ConfiguredObject> C createChild(Class<C> childClass,
+ Map<String, Object> attributes,
+ ConfiguredObject... otherParents)
+ {
+ return null;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return User.AVAILABLE_ATTRIBUTES;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if(ID.equals(name))
+ {
+ return getId();
+ }
+ else if(PASSWORD.equals(name))
+ {
+ return null; // for security reasons we don't expose the password
+ }
+ else if(NAME.equals(name))
+ {
+ return getName();
+ }
+ return super.getAttribute(name);
+ }
+
+ @Override
+ public boolean changeAttribute(String name, Object expected, Object desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ if(name.equals(PASSWORD))
+ {
+ setPassword((String)desired);
+ return true;
+ }
+ return super.changeAttribute(name, expected, desired);
+ }
+
+ @Override
+ protected boolean setState(State currentState, State desiredState)
+ throws IllegalStateTransitionException, AccessControlException
+ {
+ if(desiredState == State.DELETED)
+ {
+ try
+ {
+ String userName = _user.getName();
+ deleteUser(userName);
+ PreferencesProvider preferencesProvider = getPreferencesProvider();
+ if (preferencesProvider != null)
+ {
+ preferencesProvider.deletePreferences(userName);
+ }
+ }
+ catch (AccountNotFoundException e)
+ {
+ LOGGER.warn("Failed to delete user " + _user, e);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public Map<String, Object> getPreferences()
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider();
+ if (preferencesProvider == null)
+ {
+ return null;
+ }
+ return preferencesProvider.getPreferences(this.getName());
+ }
+
+ @Override
+ public Object getPreference(String name)
+ {
+ Map<String, Object> preferences = getPreferences();
+ if (preferences == null)
+ {
+ return null;
+ }
+ return preferences.get(name);
+ }
+
+ @Override
+ public Map<String, Object> setPreferences(Map<String, Object> preferences)
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider();
+ if (preferencesProvider == null)
+ {
+ return null;
+ }
+ return preferencesProvider.setPreferences(this.getName(), preferences);
+ }
+
+ @Override
+ public boolean deletePreferences()
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider();
+ if (preferencesProvider == null)
+ {
+ return false;
+ }
+ String[] deleted = preferencesProvider.deletePreferences(this.getName());
+ return deleted.length == 1;
+ }
+
+ private PreferencesProvider getPreferencesProvider()
+ {
+ return PrincipalDatabaseAuthenticationManagerAdapter.this.getPreferencesProvider();
+ }
+
+ }
+
+ }
+
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
new file mode 100644
index 0000000000..322c8a0ea4
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.PrincipalDatabaseAuthenticationManagerAdapter;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.SimpleAuthenticationProviderAdapter;
+
+public class AuthenticationProviderFactory
+{
+ private final Iterable<AuthenticationManagerFactory> _factories;
+ private Collection<String> _supportedAuthenticationProviders;
+
+ public AuthenticationProviderFactory(QpidServiceLoader<AuthenticationManagerFactory> authManagerFactoryServiceLoader)
+ {
+ _factories = authManagerFactoryServiceLoader.atLeastOneInstanceOf(AuthenticationManagerFactory.class);
+ List<String> supportedAuthenticationProviders = new ArrayList<String>();
+ for (AuthenticationManagerFactory factory : _factories)
+ {
+ supportedAuthenticationProviders.add(factory.getType());
+ }
+ _supportedAuthenticationProviders = Collections.unmodifiableCollection(supportedAuthenticationProviders);
+ }
+
+ /**
+ * Creates {@link AuthenticationProvider} for given ID, {@link Broker} and attributes.
+ * <p>
+ * The configured {@link AuthenticationManagerFactory}'s are used to try to create the {@link AuthenticationProvider}.
+ * The first non-null instance is returned. The factories are used in non-deterministic order.
+ */
+ public AuthenticationProvider create(UUID id, Broker broker, Map<String, Object> attributes)
+ {
+ AuthenticationProviderAdapter<?> provider = createAuthenticationProvider(id, broker, attributes);
+ provider.getAuthManager().onCreate();
+ return provider;
+ }
+
+ /**
+ * Recovers {@link AuthenticationProvider} for given ID, attributes and {@link Broker}.
+ * <p>
+ * The configured {@link AuthenticationManagerFactory}'s are used to try to create the {@link AuthenticationProvider}.
+ * The first non-null instance is returned. The factories are used in non-deterministic order.
+ */
+ public AuthenticationProvider recover(UUID id, Map<String, Object> attributes, Broker broker)
+ {
+ return createAuthenticationProvider(id, broker, attributes);
+ }
+
+ private AuthenticationProviderAdapter<?> createAuthenticationProvider(UUID id, Broker broker, Map<String, Object> attributes)
+ {
+ for (AuthenticationManagerFactory factory : _factories)
+ {
+ AuthenticationManager manager = factory.createInstance(broker, attributes);
+ if (manager != null)
+ {
+ AuthenticationProviderAdapter<?> authenticationProvider;
+ if (manager instanceof PrincipalDatabaseAuthenticationManager)
+ {
+ authenticationProvider = new PrincipalDatabaseAuthenticationManagerAdapter(id, broker,
+ (PrincipalDatabaseAuthenticationManager) manager, attributes, factory.getAttributeNames());
+ }
+ else
+ {
+ authenticationProvider = new SimpleAuthenticationProviderAdapter(id, broker, manager, attributes, factory.getAttributeNames());
+ }
+ return authenticationProvider;
+ }
+ }
+
+ throw new IllegalArgumentException("No authentication provider factory found for configuration attributes " + attributes);
+ }
+
+ public Collection<String> getSupportedAuthenticationProviders()
+ {
+ return _supportedAuthenticationProviders;
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
index 92b8f55f23..92b8f55f23 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
new file mode 100644
index 0000000000..2fa185ce98
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
@@ -0,0 +1,1266 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import java.lang.reflect.Type;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.security.AccessControlException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.common.QpidProperties;
+import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.BrokerConfigurationStoreCreator;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.logging.actors.BrokerActor;
+import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.logging.messages.BrokerMessages;
+import org.apache.qpid.server.model.AccessControlProvider;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfigurationChangeListener;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.GroupProvider;
+import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.Plugin;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.Statistics;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.SimpleAuthenticationProviderAdapter;
+import org.apache.qpid.server.plugin.PreferencesProviderFactory;
+import org.apache.qpid.server.plugin.VirtualHostFactory;
+import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.security.access.Operation;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.security.auth.manager.SimpleAuthenticationManager;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.store.MessageStoreCreator;
+import org.apache.qpid.server.util.MapValueConverter;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+
+public class BrokerAdapter extends AbstractAdapter implements Broker, ConfigurationChangeListener
+{
+ private static final Logger LOGGER = Logger.getLogger(BrokerAdapter.class);
+
+ @SuppressWarnings("serial")
+ public static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>(){{
+ put(QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, Long.class);
+ put(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, Long.class);
+ put(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, Long.class);
+ put(QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, Long.class);
+ put(QUEUE_ALERT_REPEAT_GAP, Long.class);
+ put(QUEUE_FLOW_CONTROL_SIZE_BYTES, Long.class);
+ put(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, Long.class);
+ put(VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, Long.class);
+
+ put(QUEUE_DEAD_LETTER_QUEUE_ENABLED, Boolean.class);
+ put(STATISTICS_REPORTING_RESET_ENABLED, Boolean.class);
+
+ put(QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, Integer.class);
+ put(CONNECTION_SESSION_COUNT_LIMIT, Integer.class);
+ put(CONNECTION_HEART_BEAT_DELAY, Integer.class);
+ put(CONNECTION_CLOSE_WHEN_NO_ROUTE, Boolean.class);
+ put(STATISTICS_REPORTING_PERIOD, Integer.class);
+
+ put(NAME, String.class);
+ put(DEFAULT_VIRTUAL_HOST, String.class);
+
+ put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, Long.class);
+ put(MODEL_VERSION, String.class);
+ put(STORE_VERSION, String.class);
+ }});
+
+ public static final int DEFAULT_STATISTICS_REPORTING_PERIOD = 0;
+ public static final boolean DEFAULT_STATISTICS_REPORTING_RESET_ENABLED = false;
+ public static final long DEFAULT_ALERT_REPEAT_GAP = 30000l;
+ public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE = 0l;
+ public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT = 0l;
+ public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE = 0l;
+ public static final long DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH = 0l;
+ public static final boolean DEFAULT_DEAD_LETTER_QUEUE_ENABLED = false;
+ public static final int DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS = 0;
+ public static final long DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES = 0l;
+ public static final long DEFAULT_FLOW_CONTROL_SIZE_BYTES = 0l;
+ public static final long DEFAULT_HOUSEKEEPING_CHECK_PERIOD = 30000l;
+ public static final int DEFAULT_HEART_BEAT_DELAY = 0;
+ public static final int DEFAULT_SESSION_COUNT_LIMIT = 256;
+ public static final String DEFAULT_NAME = "QpidBroker";
+ public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN = 0l;
+ public static final boolean DEFAULT_CONNECTION_CLOSE_WHEN_NO_ROUTE = true;
+
+ @SuppressWarnings("serial")
+ private static final Map<String, Object> DEFAULTS = Collections.unmodifiableMap(new HashMap<String, Object>(){{
+ put(Broker.STATISTICS_REPORTING_PERIOD, DEFAULT_STATISTICS_REPORTING_PERIOD);
+ put(Broker.STATISTICS_REPORTING_RESET_ENABLED, DEFAULT_STATISTICS_REPORTING_RESET_ENABLED);
+ put(Broker.QUEUE_ALERT_REPEAT_GAP, DEFAULT_ALERT_REPEAT_GAP);
+ put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE);
+ put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT);
+ put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE);
+ put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH);
+ put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, DEFAULT_DEAD_LETTER_QUEUE_ENABLED);
+ put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS);
+ put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES);
+ put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, DEFAULT_FLOW_CONTROL_SIZE_BYTES);
+ put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, DEFAULT_HOUSEKEEPING_CHECK_PERIOD);
+ put(Broker.CONNECTION_HEART_BEAT_DELAY, DEFAULT_HEART_BEAT_DELAY);
+ put(Broker.CONNECTION_SESSION_COUNT_LIMIT, DEFAULT_SESSION_COUNT_LIMIT);
+ put(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE, DEFAULT_CONNECTION_CLOSE_WHEN_NO_ROUTE);
+ put(Broker.NAME, DEFAULT_NAME);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN);
+ }});
+
+ private String[] POSITIVE_NUMERIC_ATTRIBUTES = { QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES,
+ QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, QUEUE_ALERT_REPEAT_GAP, QUEUE_FLOW_CONTROL_SIZE_BYTES,
+ QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, CONNECTION_SESSION_COUNT_LIMIT,
+ CONNECTION_HEART_BEAT_DELAY, STATISTICS_REPORTING_PERIOD, VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN};
+
+
+ private final StatisticsGatherer _statisticsGatherer;
+ private final VirtualHostRegistry _virtualHostRegistry;
+ private final LogRecorder _logRecorder;
+ private final RootMessageLogger _rootMessageLogger;
+ private StatisticsAdapter _statistics;
+
+ private final Map<String, VirtualHost> _vhostAdapters = new HashMap<String, VirtualHost>();
+ private final Map<UUID, Port> _portAdapters = new HashMap<UUID, Port>();
+ private final Map<Port, Integer> _stillInUsePortNumbers = new HashMap<Port, Integer>();
+ private final Map<UUID, AuthenticationProvider> _authenticationProviders = new HashMap<UUID, AuthenticationProvider>();
+ private final Map<String, GroupProvider> _groupProviders = new HashMap<String, GroupProvider>();
+ private final Map<UUID, ConfiguredObject> _plugins = new HashMap<UUID, ConfiguredObject>();
+ private final Map<String, KeyStore> _keyStores = new HashMap<String, KeyStore>();
+ private final Map<String, TrustStore> _trustStores = new HashMap<String, TrustStore>();
+ private final Map<UUID, AccessControlProvider> _accessControlProviders = new HashMap<UUID, AccessControlProvider>();
+
+ private final GroupProviderFactory _groupProviderFactory;
+ private final AuthenticationProviderFactory _authenticationProviderFactory;
+ private final AccessControlProviderFactory _accessControlProviderFactory;
+ private final PortFactory _portFactory;
+ private final SecurityManager _securityManager;
+
+ private final Collection<String> _supportedVirtualHostStoreTypes;
+ private Collection<String> _supportedBrokerStoreTypes;
+ private final ConfigurationEntryStore _brokerStore;
+
+ private AuthenticationProvider _managementAuthenticationProvider;
+ private BrokerOptions _brokerOptions;
+
+ public BrokerAdapter(UUID id, Map<String, Object> attributes, StatisticsGatherer statisticsGatherer, VirtualHostRegistry virtualHostRegistry,
+ LogRecorder logRecorder, RootMessageLogger rootMessageLogger, AuthenticationProviderFactory authenticationProviderFactory,
+ GroupProviderFactory groupProviderFactory, AccessControlProviderFactory accessControlProviderFactory, PortFactory portFactory,
+ TaskExecutor taskExecutor, ConfigurationEntryStore brokerStore, BrokerOptions brokerOptions)
+ {
+ super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), taskExecutor);
+ _statisticsGatherer = statisticsGatherer;
+ _virtualHostRegistry = virtualHostRegistry;
+ _logRecorder = logRecorder;
+ _rootMessageLogger = rootMessageLogger;
+ _statistics = new StatisticsAdapter(statisticsGatherer);
+ _authenticationProviderFactory = authenticationProviderFactory;
+ _groupProviderFactory = groupProviderFactory;
+ _accessControlProviderFactory = accessControlProviderFactory;
+ _portFactory = portFactory;
+ _brokerOptions = brokerOptions;
+ _securityManager = new SecurityManager(this, _brokerOptions.isManagementMode());
+ _supportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
+ _supportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
+ _brokerStore = brokerStore;
+ if (_brokerOptions.isManagementMode())
+ {
+ AuthenticationManager authManager = new SimpleAuthenticationManager(BrokerOptions.MANAGEMENT_MODE_USER_NAME, _brokerOptions.getManagementModePassword());
+ AuthenticationProvider authenticationProvider = new SimpleAuthenticationProviderAdapter(UUID.randomUUID(), this,
+ authManager, Collections.<String, Object> emptyMap(), Collections.<String> emptySet());
+ _managementAuthenticationProvider = authenticationProvider;
+ }
+ }
+
+ public Collection<VirtualHost> getVirtualHosts()
+ {
+ synchronized(_vhostAdapters)
+ {
+ return new ArrayList<VirtualHost>(_vhostAdapters.values());
+ }
+ }
+
+ public Collection<Port> getPorts()
+ {
+ synchronized (_portAdapters)
+ {
+ final ArrayList<Port> ports = new ArrayList<Port>(_portAdapters.values());
+ return ports;
+ }
+ }
+
+ public Collection<AuthenticationProvider> getAuthenticationProviders()
+ {
+ synchronized (_authenticationProviders)
+ {
+ return new ArrayList<AuthenticationProvider>(_authenticationProviders.values());
+ }
+ }
+
+ public AuthenticationProvider findAuthenticationProviderByName(String authenticationProviderName)
+ {
+ if (isManagementMode())
+ {
+ return _managementAuthenticationProvider;
+ }
+ Collection<AuthenticationProvider> providers = getAuthenticationProviders();
+ for (AuthenticationProvider authenticationProvider : providers)
+ {
+ if (authenticationProvider.getName().equals(authenticationProviderName))
+ {
+ return authenticationProvider;
+ }
+ }
+ return null;
+ }
+
+ public KeyStore findKeyStoreByName(String keyStoreName)
+ {
+ synchronized(_keyStores)
+ {
+ return _keyStores.get(keyStoreName);
+ }
+ }
+
+ public TrustStore findTrustStoreByName(String trustStoreName)
+ {
+ synchronized(_trustStores)
+ {
+ return _trustStores.get(trustStoreName);
+ }
+ }
+
+ @Override
+ public Collection<GroupProvider> getGroupProviders()
+ {
+ synchronized (_groupProviders)
+ {
+ final ArrayList<GroupProvider> groupManagers =
+ new ArrayList<GroupProvider>(_groupProviders.values());
+ return groupManagers;
+ }
+ }
+
+ private VirtualHost createVirtualHost(final Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException
+ {
+ final VirtualHostAdapter virtualHostAdapter = new VirtualHostAdapter(UUID.randomUUID(), attributes, this,
+ _statisticsGatherer, getTaskExecutor());
+ addVirtualHost(virtualHostAdapter);
+
+ // permission has already been granted to create the virtual host
+ // disable further access check on other operations, e.g. create exchange
+ SecurityManager.setAccessChecksDisabled(true);
+ try
+ {
+ virtualHostAdapter.setDesiredState(State.INITIALISING, State.ACTIVE);
+ }
+ finally
+ {
+ SecurityManager.setAccessChecksDisabled(false);
+ }
+ return virtualHostAdapter;
+ }
+
+ private boolean deleteVirtualHost(final VirtualHost vhost) throws AccessControlException, IllegalStateException
+ {
+ synchronized (_vhostAdapters)
+ {
+ _vhostAdapters.remove(vhost.getName());
+ }
+ vhost.removeChangeListener(this);
+ return true;
+ }
+
+ public String getName()
+ {
+ return (String)getAttribute(NAME);
+ }
+
+ public String setName(final String currentName, final String desiredName)
+ throws IllegalStateException, AccessControlException
+ {
+ return null; //TODO
+ }
+
+
+ public State getActualState()
+ {
+ return null; //TODO
+ }
+
+
+ public boolean isDurable()
+ {
+ return true;
+ }
+
+ public void setDurable(final boolean durable)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+
+ public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ public long setTimeToLive(final long expected, final long desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public Statistics getStatistics()
+ {
+ return _statistics;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ if(clazz == VirtualHost.class)
+ {
+ return (Collection<C>) getVirtualHosts();
+ }
+ else if(clazz == Port.class)
+ {
+ return (Collection<C>) getPorts();
+ }
+ else if(clazz == AccessControlProvider.class)
+ {
+ return (Collection<C>) getAccessControlProviders();
+ }
+ else if(clazz == AuthenticationProvider.class)
+ {
+ return (Collection<C>) getAuthenticationProviders();
+ }
+ else if(clazz == GroupProvider.class)
+ {
+ return (Collection<C>) getGroupProviders();
+ }
+ else if(clazz == KeyStore.class)
+ {
+ return (Collection<C>) getKeyStores();
+ }
+ else if(clazz == TrustStore.class)
+ {
+ return (Collection<C>) getTrustStores();
+ }
+ else if(clazz == Plugin.class)
+ {
+ return (Collection<C>) getPlugins();
+ }
+
+ return Collections.emptySet();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+ {
+ if(childClass == VirtualHost.class)
+ {
+ return (C) createVirtualHost(attributes);
+ }
+ else if(childClass == Port.class)
+ {
+ return (C) createPort(attributes);
+ }
+ else if(childClass == AccessControlProvider.class)
+ {
+ return (C) createAccessControlProvider(attributes);
+ }
+ else if(childClass == AuthenticationProvider.class)
+ {
+ return (C) createAuthenticationProvider(attributes);
+ }
+ else if(childClass == KeyStore.class)
+ {
+ return (C) createKeyStore(attributes);
+ }
+ else if(childClass == TrustStore.class)
+ {
+ return (C) createTrustStore(attributes);
+ }
+ else if(childClass == GroupProvider.class)
+ {
+ return (C) createGroupProvider(attributes);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot create child of class " + childClass.getSimpleName());
+ }
+ }
+
+ /**
+ * Called when adding a new port via the management interface
+ */
+ private Port createPort(Map<String, Object> attributes)
+ {
+ Port port = _portFactory.createPort(UUID.randomUUID(), this, attributes);
+ addPort(port);
+
+ //1. AMQP ports are disabled during ManagementMode.
+ //2. The management plugins can currently only start ports at broker startup and
+ // not when they are newly created via the management interfaces.
+ //3. When active ports are deleted, or their port numbers updated, the broker must be
+ // restarted for it to take effect so we can't reuse port numbers until it is.
+ boolean quiesce = isManagementMode() || !(port instanceof AmqpPortAdapter) || isPreviouslyUsedPortNumber(port);
+
+ port.setDesiredState(State.INITIALISING, quiesce ? State.QUIESCED : State.ACTIVE);
+
+ return port;
+ }
+
+ private void addPort(Port port)
+ {
+ synchronized (_portAdapters)
+ {
+ int portNumber = port.getPort();
+ String portName = port.getName();
+ UUID portId = port.getId();
+
+ for(Port p : _portAdapters.values())
+ {
+ if(portNumber == p.getPort())
+ {
+ throw new IllegalConfigurationException("Can't add port " + portName + " because port number " + portNumber + " is already configured for port " + p.getName());
+ }
+
+ if(portName == p.getName())
+ {
+ throw new IllegalConfigurationException("Can't add Port because one with name " + portName + " already exists");
+ }
+
+ if(portId == p.getId())
+ {
+ throw new IllegalConfigurationException("Can't add Port because one with id " + portId + " already exists");
+ }
+ }
+
+ _portAdapters.put(port.getId(), port);
+ }
+ port.addChangeListener(this);
+ }
+
+ private AccessControlProvider createAccessControlProvider(Map<String, Object> attributes)
+ {
+ AccessControlProvider accessControlProvider = null;
+ synchronized (_accessControlProviders)
+ {
+ accessControlProvider = _accessControlProviderFactory.create(UUID.randomUUID(), this, attributes);
+ addAccessControlProvider(accessControlProvider);
+ }
+
+ boolean quiesce = isManagementMode() ;
+ accessControlProvider.setDesiredState(State.INITIALISING, quiesce ? State.QUIESCED : State.ACTIVE);
+
+ return accessControlProvider;
+ }
+
+ /**
+ * @throws IllegalConfigurationException if an AuthenticationProvider with the same name already exists
+ */
+ private void addAccessControlProvider(AccessControlProvider accessControlProvider)
+ {
+ String name = accessControlProvider.getName();
+ synchronized (_authenticationProviders)
+ {
+ if (_accessControlProviders.containsKey(accessControlProvider.getId()))
+ {
+ throw new IllegalConfigurationException("Can't add AccessControlProvider because one with id " + accessControlProvider.getId() + " already exists");
+ }
+ for (AccessControlProvider provider : _accessControlProviders.values())
+ {
+ if (provider.getName().equals(name))
+ {
+ throw new IllegalConfigurationException("Can't add AccessControlProvider because one with name " + name + " already exists");
+ }
+ }
+ _accessControlProviders.put(accessControlProvider.getId(), accessControlProvider);
+ }
+
+ accessControlProvider.addChangeListener(this);
+ accessControlProvider.addChangeListener(_securityManager);
+ }
+
+ private boolean deleteAccessControlProvider(AccessControlProvider accessControlProvider)
+ {
+ AccessControlProvider removedAccessControlProvider = null;
+ synchronized (_accessControlProviders)
+ {
+ removedAccessControlProvider = _accessControlProviders.remove(accessControlProvider.getId());
+ }
+
+ if(removedAccessControlProvider != null)
+ {
+ removedAccessControlProvider.removeChangeListener(this);
+ removedAccessControlProvider.removeChangeListener(_securityManager);
+ }
+
+ return removedAccessControlProvider != null;
+ }
+
+ private AuthenticationProvider createAuthenticationProvider(Map<String, Object> attributes)
+ {
+ AuthenticationProvider authenticationProvider = _authenticationProviderFactory.create(UUID.randomUUID(), this, attributes);
+ authenticationProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+ addAuthenticationProvider(authenticationProvider);
+ return authenticationProvider;
+ }
+
+ /**
+ * @throws IllegalConfigurationException if an AuthenticationProvider with the same name already exists
+ */
+ private void addAuthenticationProvider(AuthenticationProvider authenticationProvider)
+ {
+ String name = authenticationProvider.getName();
+ synchronized (_authenticationProviders)
+ {
+ if (_authenticationProviders.containsKey(authenticationProvider.getId()))
+ {
+ throw new IllegalConfigurationException("Cannot add AuthenticationProvider because one with id " + authenticationProvider.getId() + " already exists");
+ }
+ for (AuthenticationProvider provider : _authenticationProviders.values())
+ {
+ if (provider.getName().equals(name))
+ {
+ throw new IllegalConfigurationException("Cannot add AuthenticationProvider because one with name " + name + " already exists");
+ }
+ }
+ _authenticationProviders.put(authenticationProvider.getId(), authenticationProvider);
+ }
+ authenticationProvider.addChangeListener(this);
+ }
+
+ private GroupProvider createGroupProvider(Map<String, Object> attributes)
+ {
+ GroupProvider groupProvider = _groupProviderFactory.create(UUID.randomUUID(), this, attributes);
+ groupProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+ addGroupProvider(groupProvider);
+ return groupProvider;
+ }
+
+ private void addGroupProvider(GroupProvider groupProvider)
+ {
+ synchronized (_groupProviders)
+ {
+ String name = groupProvider.getName();
+ if(_groupProviders.containsKey(name))
+ {
+ throw new IllegalConfigurationException("Cannot add GroupProvider because one with name " + name + " already exists");
+ }
+ _groupProviders.put(name, groupProvider);
+ }
+ groupProvider.addChangeListener(this);
+ }
+
+ private boolean deleteGroupProvider(GroupProvider groupProvider)
+ {
+ GroupProvider removedGroupProvider = null;
+ synchronized (_groupProviders)
+ {
+ removedGroupProvider = _groupProviders.remove(groupProvider.getName());
+ }
+
+ if(removedGroupProvider != null)
+ {
+ removedGroupProvider.removeChangeListener(this);
+ }
+
+ return removedGroupProvider != null;
+ }
+
+ private KeyStore createKeyStore(Map<String, Object> attributes)
+ {
+ KeyStore keyStore = new KeyStoreAdapter(UUIDGenerator.generateRandomUUID(), this, attributes);
+ addKeyStore(keyStore);
+
+ return keyStore;
+ }
+
+ private TrustStore createTrustStore(Map<String, Object> attributes)
+ {
+ TrustStore trustStore = new TrustStoreAdapter(UUIDGenerator.generateRandomUUID(), this, attributes);
+ addTrustStore(trustStore);
+
+ return trustStore;
+ }
+
+ private void addKeyStore(KeyStore keyStore)
+ {
+ synchronized (_keyStores)
+ {
+ if(_keyStores.containsKey(keyStore.getName()))
+ {
+ throw new IllegalConfigurationException("Can't add KeyStore because one with name " + keyStore.getName() + " already exists");
+ }
+ _keyStores.put(keyStore.getName(), keyStore);
+ }
+ keyStore.addChangeListener(this);
+ }
+
+ private boolean deleteKeyStore(KeyStore object)
+ {
+ synchronized(_keyStores)
+ {
+ String name = object.getName();
+ KeyStore removedKeyStore = _keyStores.remove(name);
+ if(removedKeyStore != null)
+ {
+ removedKeyStore.removeChangeListener(this);
+ }
+
+ return removedKeyStore != null;
+ }
+ }
+
+ private void addTrustStore(TrustStore trustStore)
+ {
+ synchronized (_trustStores)
+ {
+ if(_trustStores.containsKey(trustStore.getName()))
+ {
+ throw new IllegalConfigurationException("Can't add TrustStore because one with name " + trustStore.getName() + " already exists");
+ }
+ _trustStores.put(trustStore.getName(), trustStore);
+ }
+ trustStore.addChangeListener(this);
+ }
+
+ private boolean deleteTrustStore(TrustStore object)
+ {
+ synchronized(_trustStores)
+ {
+ String name = object.getName();
+ TrustStore removedTrustStore = _trustStores.remove(name);
+ if(removedTrustStore != null)
+ {
+ removedTrustStore.removeChangeListener(this);
+ }
+
+ return removedTrustStore != null;
+ }
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return AVAILABLE_ATTRIBUTES;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if(ID.equals(name))
+ {
+ return getId();
+ }
+ else if(STATE.equals(name))
+ {
+ return State.ACTIVE;
+ }
+ else if(DURABLE.equals(name))
+ {
+ return isDurable();
+ }
+ else if(LIFETIME_POLICY.equals(name))
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+ else if(TIME_TO_LIVE.equals(name))
+ {
+ // TODO
+ }
+ else if(CREATED.equals(name))
+ {
+ // TODO
+ }
+ else if(UPDATED.equals(name))
+ {
+ // TODO
+ }
+ else if(BUILD_VERSION.equals(name))
+ {
+ return QpidProperties.getBuildVersion();
+ }
+ else if(BYTES_RETAINED.equals(name))
+ {
+ // TODO
+ }
+ else if(OPERATING_SYSTEM.equals(name))
+ {
+ return System.getProperty("os.name") + " "
+ + System.getProperty("os.version") + " "
+ + System.getProperty("os.arch");
+ }
+ else if(PLATFORM.equals(name))
+ {
+ return System.getProperty("java.vendor") + " "
+ + System.getProperty("java.runtime.version", System.getProperty("java.version"));
+ }
+ else if(PROCESS_PID.equals(name))
+ {
+ // TODO
+ }
+ else if(PRODUCT_VERSION.equals(name))
+ {
+ return QpidProperties.getReleaseVersion();
+ }
+ else if(SUPPORTED_BROKER_STORE_TYPES.equals(name))
+ {
+ return _supportedBrokerStoreTypes;
+ }
+ else if(SUPPORTED_VIRTUALHOST_STORE_TYPES.equals(name))
+ {
+ return _supportedVirtualHostStoreTypes;
+ }
+ else if(SUPPORTED_VIRTUALHOST_TYPES.equals(name))
+ {
+ return VirtualHostFactory.TYPES.get();
+ }
+ else if(SUPPORTED_AUTHENTICATION_PROVIDERS.equals(name))
+ {
+ return _authenticationProviderFactory.getSupportedAuthenticationProviders();
+ }
+ else if (SUPPORTED_PREFERENCES_PROVIDERS_TYPES.equals(name))
+ {
+ return PreferencesProviderFactory.TYPES.get();
+ }
+ else if (MODEL_VERSION.equals(name))
+ {
+ return Model.MODEL_VERSION;
+ }
+ else if (STORE_VERSION.equals(name))
+ {
+ return _brokerStore.getVersion();
+ }
+ else if (STORE_TYPE.equals(name))
+ {
+ return _brokerStore.getType();
+ }
+ else if (STORE_PATH.equals(name))
+ {
+ return _brokerStore.getStoreLocation();
+ }
+ return super.getAttribute(name);
+ }
+
+ private boolean deletePort(State oldState, Port portAdapter)
+ {
+ Port removedPort = null;
+ synchronized (_portAdapters)
+ {
+ removedPort = _portAdapters.remove(portAdapter.getId());
+ }
+
+ if (removedPort != null)
+ {
+ removedPort.removeChangeListener(this);
+
+ if(oldState == State.ACTIVE)
+ {
+ //Record the originally used port numbers of previously-active ports being deleted, to ensure
+ //when creating new ports we don't try to re-bind a port number that we are currently still using
+ recordPreviouslyUsedPortNumberIfNecessary(removedPort, removedPort.getPort());
+ }
+ }
+
+ return removedPort != null;
+ }
+
+ private boolean deleteAuthenticationProvider(AuthenticationProvider authenticationProvider)
+ {
+ AuthenticationProvider removedAuthenticationProvider = null;
+ synchronized (_authenticationProviders)
+ {
+ removedAuthenticationProvider = _authenticationProviders.remove(authenticationProvider.getId());
+ }
+
+ if(removedAuthenticationProvider != null)
+ {
+ removedAuthenticationProvider.removeChangeListener(this);
+ }
+
+ return removedAuthenticationProvider != null;
+ }
+
+ private void addVirtualHost(VirtualHost virtualHost)
+ {
+ synchronized (_vhostAdapters)
+ {
+ String name = virtualHost.getName();
+ if (_vhostAdapters.containsKey(name))
+ {
+ throw new IllegalConfigurationException("Virtual host with name " + name + " is already specified!");
+ }
+ _vhostAdapters.put(name, virtualHost);
+ }
+ virtualHost.addChangeListener(this);
+ }
+
+ @Override
+ public boolean setState(State currentState, State desiredState)
+ {
+ if (desiredState == State.ACTIVE)
+ {
+ changeState(_groupProviders, currentState, State.ACTIVE, false);
+ changeState(_authenticationProviders, currentState, State.ACTIVE, false);
+ changeState(_accessControlProviders, currentState, State.ACTIVE, false);
+
+ CurrentActor.set(new BrokerActor(getRootMessageLogger()));
+ try
+ {
+ changeState(_vhostAdapters, currentState, State.ACTIVE, false);
+ }
+ finally
+ {
+ CurrentActor.remove();
+ }
+
+ changeState(_portAdapters, currentState,State.ACTIVE, false);
+ changeState(_plugins, currentState,State.ACTIVE, false);
+
+ if (isManagementMode())
+ {
+ CurrentActor.get().message(BrokerMessages.MANAGEMENT_MODE(BrokerOptions.MANAGEMENT_MODE_USER_NAME, _brokerOptions.getManagementModePassword()));
+ }
+ return true;
+ }
+ else if (desiredState == State.STOPPED)
+ {
+ changeState(_plugins, currentState,State.STOPPED, true);
+ changeState(_portAdapters, currentState, State.STOPPED, true);
+ changeState(_vhostAdapters,currentState, State.STOPPED, true);
+ changeState(_authenticationProviders, currentState, State.STOPPED, true);
+ changeState(_groupProviders, currentState, State.STOPPED, true);
+ return true;
+ }
+ return false;
+ }
+
+ private void changeState(Map<?, ? extends ConfiguredObject> configuredObjectMap, State currentState, State desiredState, boolean swallowException)
+ {
+ synchronized(configuredObjectMap)
+ {
+ Collection<? extends ConfiguredObject> adapters = configuredObjectMap.values();
+ for (ConfiguredObject configuredObject : adapters)
+ {
+ if (State.ACTIVE.equals(desiredState) && State.QUIESCED.equals(configuredObject.getActualState()))
+ {
+ if (LOGGER.isDebugEnabled())
+ {
+ LOGGER.debug(configuredObject + " cannot be activated as it is " +State.QUIESCED);
+ }
+ continue;
+ }
+ try
+ {
+ configuredObject.setDesiredState(currentState, desiredState);
+ }
+ catch(RuntimeException e)
+ {
+ if (swallowException)
+ {
+ LOGGER.error("Failed to stop " + configuredObject, e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void stateChanged(ConfiguredObject object, State oldState, State newState)
+ {
+ if(newState == State.DELETED)
+ {
+ boolean childDeleted = false;
+ if(object instanceof AuthenticationProvider)
+ {
+ childDeleted = deleteAuthenticationProvider((AuthenticationProvider)object);
+ }
+ else if(object instanceof AccessControlProvider)
+ {
+ childDeleted = deleteAccessControlProvider((AccessControlProvider)object);
+ }
+ else if(object instanceof Port)
+ {
+ childDeleted = deletePort(oldState, (Port)object);
+ }
+ else if(object instanceof VirtualHost)
+ {
+ childDeleted = deleteVirtualHost((VirtualHost)object);
+ }
+ else if(object instanceof GroupProvider)
+ {
+ childDeleted = deleteGroupProvider((GroupProvider)object);
+ }
+ else if(object instanceof KeyStore)
+ {
+ childDeleted = deleteKeyStore((KeyStore)object);
+ }
+ else if(object instanceof TrustStore)
+ {
+ childDeleted = deleteTrustStore((TrustStore)object);
+ }
+
+ if(childDeleted)
+ {
+ childRemoved(object);
+ }
+ }
+ }
+
+ @Override
+ public void childAdded(ConfiguredObject object, ConfiguredObject child)
+ {
+ // no-op
+ }
+
+ @Override
+ public void childRemoved(ConfiguredObject object, ConfiguredObject child)
+ {
+ // no-op
+ }
+
+ @Override
+ public void attributeSet(ConfiguredObject object, String attributeName, Object oldAttributeValue, Object newAttributeValue)
+ {
+ if(object instanceof Port)
+ {
+ //Record all the originally used port numbers of active ports, to ensure that when
+ //creating new ports we don't try to re-bind a port number that we are still using
+ if(attributeName == Port.PORT && object.getActualState() == State.ACTIVE)
+ {
+ recordPreviouslyUsedPortNumberIfNecessary((Port) object, (Integer)oldAttributeValue);
+ }
+ }
+ }
+
+ private void addPlugin(ConfiguredObject plugin)
+ {
+ synchronized(_plugins)
+ {
+ if (_plugins.containsKey(plugin.getId()))
+ {
+ throw new IllegalConfigurationException("Plugin with id '" + plugin.getId() + "' is already registered!");
+ }
+ _plugins.put(plugin.getId(), plugin);
+ }
+ plugin.addChangeListener(this);
+ }
+
+
+ private Collection<ConfiguredObject> getPlugins()
+ {
+ synchronized(_plugins)
+ {
+ return Collections.unmodifiableCollection(_plugins.values());
+ }
+ }
+
+ public void recoverChild(ConfiguredObject object)
+ {
+ if(object instanceof AuthenticationProvider)
+ {
+ addAuthenticationProvider((AuthenticationProvider)object);
+ }
+ else if(object instanceof AccessControlProvider)
+ {
+ addAccessControlProvider((AccessControlProvider)object);
+ }
+ else if(object instanceof Port)
+ {
+ addPort((Port)object);
+ }
+ else if(object instanceof VirtualHost)
+ {
+ addVirtualHost((VirtualHost)object);
+ }
+ else if(object instanceof GroupProvider)
+ {
+ addGroupProvider((GroupProvider)object);
+ }
+ else if(object instanceof KeyStore)
+ {
+ addKeyStore((KeyStore)object);
+ }
+ else if(object instanceof TrustStore)
+ {
+ addTrustStore((TrustStore)object);
+ }
+ else if(object instanceof Plugin)
+ {
+ addPlugin(object);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Attempted to recover unexpected type of configured object: " + object.getClass().getName());
+ }
+ }
+
+ @Override
+ public RootMessageLogger getRootMessageLogger()
+ {
+ return _rootMessageLogger;
+ }
+
+ @Override
+ public SecurityManager getSecurityManager()
+ {
+ return _securityManager;
+ }
+
+ @Override
+ public LogRecorder getLogRecorder()
+ {
+ return _logRecorder;
+ }
+
+ @Override
+ public VirtualHost findVirtualHostByName(String name)
+ {
+ return _vhostAdapters.get(name);
+ }
+
+ @Override
+ public SubjectCreator getSubjectCreator(SocketAddress localAddress)
+ {
+ AuthenticationProvider provider = getAuthenticationProvider(localAddress);
+
+ if(provider == null)
+ {
+ throw new IllegalConfigurationException("Unable to determine authentication provider for address: " + localAddress);
+ }
+
+ return provider.getSubjectCreator();
+ }
+
+ @Override
+ public AuthenticationProvider getAuthenticationProvider(SocketAddress localAddress)
+ {
+ InetSocketAddress inetSocketAddress = (InetSocketAddress)localAddress;
+ AuthenticationProvider provider = null;
+ Collection<Port> ports = getPorts();
+ for (Port p : ports)
+ {
+ if (inetSocketAddress.getPort() == p.getPort())
+ {
+ provider = p.getAuthenticationProvider();
+ break;
+ }
+ }
+ return provider;
+ }
+
+ @Override
+ public Collection<KeyStore> getKeyStores()
+ {
+ synchronized(_keyStores)
+ {
+ return Collections.unmodifiableCollection(_keyStores.values());
+ }
+ }
+
+ @Override
+ public Collection<TrustStore> getTrustStores()
+ {
+ synchronized(_trustStores)
+ {
+ return Collections.unmodifiableCollection(_trustStores.values());
+ }
+ }
+
+ @Override
+ public VirtualHostRegistry getVirtualHostRegistry()
+ {
+ return _virtualHostRegistry;
+ }
+
+ @Override
+ public TaskExecutor getTaskExecutor()
+ {
+ return super.getTaskExecutor();
+ }
+
+ @Override
+ protected void changeAttributes(Map<String, Object> attributes)
+ {
+ Map<String, Object> convertedAttributes = MapValueConverter.convert(attributes, ATTRIBUTE_TYPES);
+ validateAttributes(convertedAttributes);
+
+ super.changeAttributes(convertedAttributes);
+ }
+
+ private void validateAttributes(Map<String, Object> convertedAttributes)
+ {
+ if (convertedAttributes.containsKey(MODEL_VERSION) && !Model.MODEL_VERSION.equals(convertedAttributes.get(MODEL_VERSION)))
+ {
+ throw new IllegalConfigurationException("Cannot change the model version");
+ }
+
+ if (convertedAttributes.containsKey(STORE_VERSION)
+ && !new Integer(_brokerStore.getVersion()).equals(convertedAttributes.get(STORE_VERSION)))
+ {
+ throw new IllegalConfigurationException("Cannot change the store version");
+ }
+
+ String defaultVirtualHost = (String) convertedAttributes.get(DEFAULT_VIRTUAL_HOST);
+ if (defaultVirtualHost != null)
+ {
+ VirtualHost foundHost = findVirtualHostByName(defaultVirtualHost);
+ if (foundHost == null)
+ {
+ throw new IllegalConfigurationException("Virtual host with name " + defaultVirtualHost
+ + " cannot be set as a default as it does not exist");
+ }
+ }
+ Long queueFlowControlSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_SIZE_BYTES);
+ Long queueFlowControlResumeSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
+ if (queueFlowControlSize != null || queueFlowControlResumeSize != null )
+ {
+ if (queueFlowControlSize == null)
+ {
+ queueFlowControlSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_SIZE_BYTES);
+ }
+ if (queueFlowControlResumeSize == null)
+ {
+ queueFlowControlResumeSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
+ }
+ if (queueFlowControlResumeSize > queueFlowControlSize)
+ {
+ throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size");
+ }
+ }
+ for (String attributeName : POSITIVE_NUMERIC_ATTRIBUTES)
+ {
+ Number value = (Number) convertedAttributes.get(attributeName);
+ if (value != null && value.longValue() < 0)
+ {
+ throw new IllegalConfigurationException("Only positive integer value can be specified for the attribute "
+ + attributeName);
+ }
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
+ {
+ if (!_securityManager.authoriseConfiguringBroker(getName(), Broker.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of broker attributes is denied");
+ }
+ }
+
+ @Override
+ protected <C extends ConfiguredObject> void authoriseCreateChild(Class<C> childClass, Map<String, Object> attributes,
+ ConfiguredObject... otherParents) throws AccessControlException
+ {
+ if (!_securityManager.authoriseConfiguringBroker(String.valueOf(attributes.get(NAME)), childClass, Operation.CREATE))
+ {
+ throw new AccessControlException("Creation of new broker level entity is denied");
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
+ {
+ if (!_securityManager.authoriseConfiguringBroker(getName(), Broker.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of broker attributes is denied");
+ }
+ }
+
+ @Override
+ public boolean isManagementMode()
+ {
+ return _brokerOptions.isManagementMode();
+ }
+
+ @Override
+ public Collection<AccessControlProvider> getAccessControlProviders()
+ {
+ synchronized (_accessControlProviders)
+ {
+ return new ArrayList<AccessControlProvider>(_accessControlProviders.values());
+ }
+ }
+
+ private void recordPreviouslyUsedPortNumberIfNecessary(Port port, Integer portNumber)
+ {
+ //If we haven't previously recorded its original port number, record it now
+ if(!_stillInUsePortNumbers.containsKey(port))
+ {
+ _stillInUsePortNumbers.put(port, portNumber);
+ }
+ }
+
+ private boolean isPreviouslyUsedPortNumber(Port port)
+ {
+ return _stillInUsePortNumbers.containsValue(port.getPort());
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
index e8bacb2712..e8bacb2712 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
index 696c59783e..696c59783e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
new file mode 100644
index 0000000000..0963f01522
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
@@ -0,0 +1,444 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import java.security.AccessControlException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.AMQInternalException;
+import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.binding.Binding;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.ConfiguredObjectFinder;
+import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.Publisher;
+import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.Statistics;
+import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.util.MapValueConverter;
+import org.apache.qpid.server.virtualhost.RequiredExchangeException;
+
+final class ExchangeAdapter extends AbstractAdapter implements Exchange, org.apache.qpid.server.exchange.Exchange.BindingListener
+{
+
+ private final org.apache.qpid.server.exchange.Exchange _exchange;
+ private final Map<Binding, BindingAdapter> _bindingAdapters =
+ new HashMap<Binding, BindingAdapter>();
+ private VirtualHostAdapter _vhost;
+ private final ExchangeStatistics _statistics;
+
+ public ExchangeAdapter(final VirtualHostAdapter virtualHostAdapter,
+ final org.apache.qpid.server.exchange.Exchange exchange)
+ {
+ super(exchange.getId(), virtualHostAdapter.getTaskExecutor());
+ _statistics = new ExchangeStatistics();
+ _vhost = virtualHostAdapter;
+ _exchange = exchange;
+ addParent(org.apache.qpid.server.model.VirtualHost.class, virtualHostAdapter);
+
+ exchange.addBindingListener(this);
+ populateBindings();
+ }
+
+ private void populateBindings()
+ {
+ Collection<Binding> actualBindings = _exchange.getBindings();
+ synchronized (_bindingAdapters)
+ {
+ for(Binding binding : actualBindings)
+ {
+ if(!_bindingAdapters.containsKey(binding))
+ {
+ QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
+ BindingAdapter adapter = new BindingAdapter(binding, this, queueAdapter);
+ _bindingAdapters.put(binding, adapter);
+
+ queueAdapter.bindingRegistered(binding, adapter);
+ }
+ }
+ }
+
+ }
+
+ public String getExchangeType()
+ {
+ return _exchange.getType().getType();
+ }
+
+ public Collection<org.apache.qpid.server.model.Binding> getBindings()
+ {
+ synchronized (_bindingAdapters)
+ {
+ return new ArrayList<org.apache.qpid.server.model.Binding>(_bindingAdapters.values());
+ }
+
+ }
+
+ public Collection<Publisher> getPublishers()
+ {
+ // TODO
+ return Collections.emptyList();
+ }
+
+
+ public org.apache.qpid.server.model.Binding createBinding(Queue queue,
+ Map<String, Object> attributes)
+ throws AccessControlException, IllegalStateException
+ {
+ attributes = new HashMap<String, Object>(attributes);
+ String bindingKey = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Binding.NAME, attributes, "");
+ Map<String, Object> bindingArgs = MapValueConverter.getMapAttribute(org.apache.qpid.server.model.Binding.ARGUMENTS, attributes, Collections.<String,Object>emptyMap());
+
+ attributes.remove(org.apache.qpid.server.model.Binding.NAME);
+ attributes.remove(org.apache.qpid.server.model.Binding.ARGUMENTS);
+
+ return createBinding(bindingKey, queue, bindingArgs, attributes);
+
+ }
+
+ public org.apache.qpid.server.model.Binding createBinding(String bindingKey, Queue queue,
+ Map<String, Object> bindingArguments,
+ Map<String, Object> attributes)
+ throws AccessControlException, IllegalStateException
+ {
+ AMQQueue amqQueue = ((QueueAdapter)queue).getAMQQueue();
+
+ try
+ {
+ if(!_exchange.addBinding(bindingKey, amqQueue, bindingArguments))
+ {
+ Binding oldBinding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);
+
+ Map<String, Object> oldArgs = oldBinding.getArguments();
+ if((oldArgs == null && !bindingArguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(bindingArguments)))
+ {
+ _exchange.replaceBinding(oldBinding.getId(), bindingKey, amqQueue, bindingArguments);
+ }
+ }
+ Binding binding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);
+
+ synchronized (_bindingAdapters)
+ {
+ return binding == null ? null : _bindingAdapters.get(binding);
+ }
+ }
+ catch(AMQSecurityException e)
+ {
+ throw new AccessControlException(e.toString());
+ }
+ catch(AMQInternalException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void delete()
+ {
+ try
+ {
+ _vhost.getVirtualHost().removeExchange(_exchange, true);
+ }
+ catch(RequiredExchangeException e)
+ {
+ throw new UnsupportedOperationException("'" + getName() + "' is a reserved exchange and can't be deleted");
+ }
+ catch(AMQException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public String getName()
+ {
+ return _exchange.getName();
+ }
+
+ public String setName(final String currentName, final String desiredName)
+ throws IllegalStateException, AccessControlException
+ {
+ return null; //TODO
+ }
+
+ public State getActualState()
+ {
+ return null; //TODO
+ }
+
+ public boolean isDurable()
+ {
+ return _exchange.isDurable();
+ }
+
+ public void setDurable(final boolean durable)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ //TODO
+ }
+
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return _exchange.isAutoDelete() ? LifetimePolicy.AUTO_DELETE : LifetimePolicy.PERMANENT;
+ }
+
+ public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ return null; //TODO
+ }
+
+ public long getTimeToLive()
+ {
+ return 0; //TODO
+ }
+
+ public long setTimeToLive(final long expected, final long desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ return 0; //TODO
+ }
+
+ public Statistics getStatistics()
+ {
+ return _statistics;
+ }
+
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ if(clazz == org.apache.qpid.server.model.Binding.class)
+ {
+ return (Collection<C>) getBindings();
+ }
+ else
+ {
+ return Collections.emptySet();
+ }
+ }
+
+ @Override
+ public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+ {
+ if(childClass == org.apache.qpid.server.model.Binding.class)
+ {
+ if(otherParents != null && otherParents.length == 1 && otherParents[0] instanceof Queue)
+ {
+ Queue queue = (Queue) otherParents[0];
+ if(queue.getParent(org.apache.qpid.server.model.VirtualHost.class) == getParent(org.apache.qpid.server.model.VirtualHost.class))
+ {
+ return (C) createBinding(queue, attributes);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Queue and Exchange parents of a binding must be on same virtual host");
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Other parent must be a queue");
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public void bindingAdded(org.apache.qpid.server.exchange.Exchange exchange, Binding binding)
+ {
+ BindingAdapter adapter = null;
+ synchronized (_bindingAdapters)
+ {
+ if(!_bindingAdapters.containsKey(binding))
+ {
+ QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
+ adapter = new BindingAdapter(binding, this, queueAdapter);
+ _bindingAdapters.put(binding,adapter);
+ queueAdapter.bindingRegistered(binding,adapter);
+ }
+ }
+ if(adapter != null)
+ {
+ childAdded(adapter);
+ }
+ }
+
+ public void bindingRemoved(org.apache.qpid.server.exchange.Exchange exchange, Binding binding)
+ {
+ BindingAdapter adapter = null;
+ synchronized (_bindingAdapters)
+ {
+ adapter = _bindingAdapters.remove(binding);
+ }
+ if(adapter != null)
+ {
+ QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
+ if(queueAdapter != null)
+ {
+ queueAdapter.bindingUnregistered(binding);
+ childRemoved(adapter);
+ }
+ }
+ }
+
+ org.apache.qpid.server.exchange.Exchange getExchange()
+ {
+ return _exchange;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if(ID.equals(name))
+ {
+ return getId();
+ }
+ else if(NAME.equals(name))
+ {
+ return getName();
+ }
+ else if(STATE.equals(name))
+ {
+ return State.ACTIVE;
+ }
+ else if(DURABLE.equals(name))
+ {
+ return isDurable();
+ }
+ else if(LIFETIME_POLICY.equals(name))
+ {
+ return _exchange.isAutoDelete() ? LifetimePolicy.AUTO_DELETE : LifetimePolicy.PERMANENT;
+ }
+ else if(TIME_TO_LIVE.equals(name))
+ {
+
+ }
+ else if(CREATED.equals(name))
+ {
+
+ }
+ else if(UPDATED.equals(name))
+ {
+
+ }
+ else if(ALTERNATE_EXCHANGE.equals(name))
+ {
+ org.apache.qpid.server.exchange.Exchange alternateExchange = _exchange.getAlternateExchange();
+ return alternateExchange == null ? null :
+ ConfiguredObjectFinder.findConfiguredObjectByName(_vhost.getExchanges(),
+ alternateExchange.getName());
+ }
+ else if(TYPE.equals(name))
+ {
+ return _exchange.getTypeName();
+ }
+ return super.getAttribute(name);
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return AVAILABLE_ATTRIBUTES;
+ }
+
+ @Override
+ protected boolean setState(State currentState, State desiredState)
+ {
+ if (desiredState == State.DELETED)
+ {
+ delete();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected void changeAttributes(Map<String, Object> attributes)
+ {
+ throw new UnsupportedOperationException("Changing attributes on exchange is not supported.");
+ }
+
+ @Override
+ protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
+ {
+ if (!_vhost.getSecurityManager().authoriseUpdate(_exchange))
+ {
+ throw new AccessControlException("Setting of exchange attribute is denied");
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
+ {
+ if (!_vhost.getSecurityManager().authoriseUpdate(_exchange))
+ {
+ throw new AccessControlException("Setting of exchange attributes is denied");
+ }
+ }
+
+ private class ExchangeStatistics implements Statistics
+ {
+
+ public Collection<String> getStatisticNames()
+ {
+ return AVAILABLE_STATISTICS;
+ }
+
+ public Object getStatistic(String name)
+ {
+ if(BINDING_COUNT.equals(name))
+ {
+ return _exchange.getBindingCount();
+ }
+ else if(BYTES_DROPPED.equals(name))
+ {
+ return _exchange.getByteDrops();
+ }
+ else if(BYTES_IN.equals(name))
+ {
+ return _exchange.getByteReceives();
+ }
+ else if(MESSAGES_DROPPED.equals(name))
+ {
+ return _exchange.getMsgDrops();
+ }
+ else if(MESSAGES_IN.equals(name))
+ {
+ return _exchange.getMsgReceives();
+ }
+ else if(PRODUCER_COUNT.equals(name))
+ {
+
+ }
+ else if(STATE_CHANGED.equals(name))
+ {
+
+ }
+ return null; // TODO - Implement
+ }
+ }
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java
new file mode 100644
index 0000000000..39f0017fc3
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java
@@ -0,0 +1,632 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.model.adapter;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.nio.channels.OverlappingFileLockException;
+import java.security.AccessControlException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.IllegalStateTransitionException;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.Statistics;
+import org.apache.qpid.server.util.MapValueConverter;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+import org.codehaus.jackson.type.TypeReference;
+
+public class FileSystemPreferencesProvider extends AbstractAdapter implements PreferencesProvider
+{
+ private static final Logger LOGGER = Logger.getLogger(FileSystemPreferencesProvider.class);
+ public static String PATH = "path";
+ public static final String PROVIDER_TYPE = "FileSystemPreferences";
+
+ @SuppressWarnings("serial")
+ private static final Map<String, Object> DEFAULTS = Collections.unmodifiableMap(new HashMap<String, Object>()
+ {{
+ put(TYPE, FileSystemPreferencesProvider.class.getSimpleName());
+ }});
+
+ @SuppressWarnings("serial")
+ private static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>()
+ {{
+ put(NAME, String.class);
+ put(PATH, String.class);
+ put(TYPE, String.class);
+ }});
+
+ @SuppressWarnings("serial")
+ private static Collection<String> AVAILABLE_ATTRIBUTES = Collections.unmodifiableList(new ArrayList<String>(
+ PreferencesProvider.AVAILABLE_ATTRIBUTES)
+ {{
+ add(PATH);
+ }});
+
+ private final AuthenticationProvider _authenticationProvider;
+ private AtomicReference<State> _state;
+
+ private FileSystemPreferencesStore _store;
+
+ protected FileSystemPreferencesProvider(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider,
+ TaskExecutor taskExecutor)
+ {
+ super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), taskExecutor);
+ State state = MapValueConverter.getEnumAttribute(State.class, STATE, attributes, State.INITIALISING);
+ _state = new AtomicReference<State>(state);
+ addParent(AuthenticationProvider.class, authenticationProvider);
+ _authenticationProvider = authenticationProvider;
+ _store = new FileSystemPreferencesStore(new File(MapValueConverter.getStringAttribute(PATH, attributes)));
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return AVAILABLE_ATTRIBUTES;
+ }
+
+ @Override
+ public String getName()
+ {
+ return (String) getAttribute(AuthenticationProvider.NAME);
+ }
+
+ @Override
+ public String setName(String currentName, String desiredName) throws IllegalStateException, AccessControlException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public State getActualState()
+ {
+ return _state.get();
+ }
+
+ @Override
+ public boolean isDurable()
+ {
+ return true;
+ }
+
+ @Override
+ public void setDurable(boolean durable) throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+
+ @Override
+ public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired) throws IllegalStateException,
+ AccessControlException, IllegalArgumentException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ @Override
+ public long setTimeToLive(long expected, long desired) throws IllegalStateException, AccessControlException,
+ IllegalArgumentException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Statistics getStatistics()
+ {
+ return NoStatistics.getInstance();
+ }
+
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if (CREATED.equals(name))
+ {
+ // TODO
+ }
+ else if (DURABLE.equals(name))
+ {
+ return true;
+ }
+ else if (ID.equals(name))
+ {
+ return getId();
+ }
+ else if (LIFETIME_POLICY.equals(name))
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+ else if (STATE.equals(name))
+ {
+ return getActualState();
+ }
+ else if (TIME_TO_LIVE.equals(name))
+ {
+ // TODO
+ }
+ else if (UPDATED.equals(name))
+ {
+ // TODO
+ }
+ return super.getAttribute(name);
+ }
+
+ @Override
+ public boolean setState(State currentState, State desiredState) throws IllegalStateTransitionException, AccessControlException
+ {
+ State state = _state.get();
+ if (desiredState == State.DELETED)
+ {
+ if ((state == State.INITIALISING || state == State.ACTIVE || state == State.STOPPED || state == State.QUIESCED || state == State.ERRORED)
+ && _state.compareAndSet(state, State.DELETED))
+ {
+ try
+ {
+ _store.close();
+ }
+ finally
+ {
+ _store.delete();
+ _authenticationProvider.setPreferencesProvider(null);
+ }
+ return true;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot delete preferences provider in state: " + state);
+ }
+ }
+ else if (desiredState == State.ACTIVE)
+ {
+ if ((state == State.INITIALISING || state == State.QUIESCED || state == State.STOPPED)
+ && _state.compareAndSet(state, State.ACTIVE))
+ {
+ try
+ {
+ _store.open();
+ return true;
+ }
+ catch (Exception e)
+ {
+ _state.compareAndSet(State.ACTIVE, State.ERRORED);
+ Broker broker = getAuthenticationProvider().getParent(Broker.class);
+ if (broker != null && broker.isManagementMode())
+ {
+ LOGGER.warn("Failed to activate preferences provider: " + getName(), e);
+ }
+ else
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot activate preferences provider in state: " + state);
+ }
+ }
+ else if (desiredState == State.QUIESCED)
+ {
+ if (state == State.INITIALISING && _state.compareAndSet(state, State.QUIESCED))
+ {
+ _store.close();
+ return true;
+ }
+ }
+ else if (desiredState == State.STOPPED)
+ {
+ if (_state.compareAndSet(state, State.STOPPED))
+ {
+ _store.close();
+ return true;
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot stop preferences preferences in state: " + state);
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public Map<String, Object> getPreferences(String userId)
+ {
+ return _store.getPreferences(userId);
+ }
+
+ @Override
+ public Map<String, Object> setPreferences(String userId, Map<String, Object> preferences)
+ {
+ return _store.setPreferences(userId, preferences);
+ }
+
+ @Override
+ public String[] deletePreferences(String... userIDs)
+ {
+ return _store.deletePreferences(userIDs);
+ }
+
+ @Override
+ public Set<String> listUserIDs()
+ {
+ return _store.listUserIDs();
+ }
+
+ public AuthenticationProvider getAuthenticationProvider()
+ {
+ return _authenticationProvider;
+ }
+
+ @Override
+ protected void changeAttributes(Map<String, Object> attributes)
+ {
+ Map<String, Object> effectiveAttributes = MapValueConverter.convert(super.generateEffectiveAttributes(attributes),
+ ATTRIBUTE_TYPES);
+ validateAttributes(effectiveAttributes);
+ String effectivePath = (String) effectiveAttributes.get(PATH);
+ String currentPath = (String) getAttribute(PATH);
+
+ File storeFile = new File(effectivePath);
+ FileSystemPreferencesStore newStore = null;
+ if (!effectivePath.equals(currentPath))
+ {
+ if (!storeFile.exists())
+ {
+ throw new IllegalConfigurationException("Path to preferences file does not exist!");
+ }
+ newStore = new FileSystemPreferencesStore(storeFile);
+ newStore.open();
+ }
+
+ try
+ {
+ super.changeAttributes(attributes);
+
+ if (newStore != null)
+ {
+ _store.close();
+ _store = newStore;
+ newStore = null;
+ }
+ }
+ finally
+ {
+ if (newStore != null)
+ {
+ newStore.close();
+ }
+ }
+ // if provider was previously in ERRORED state then set its state to ACTIVE
+ _state.compareAndSet(State.ERRORED, State.ACTIVE);
+ }
+
+ private void validateAttributes(Map<String, Object> attributes)
+ {
+ super.validateChangeAttributes(attributes);
+
+ String newName = (String) attributes.get(NAME);
+ String currentName = getName();
+ if (!currentName.equals(newName))
+ {
+ throw new IllegalConfigurationException("Changing the name of preferences provider is not supported");
+ }
+ String newType = (String) attributes.get(TYPE);
+ String currentType = (String) getAttribute(TYPE);
+ if (!currentType.equals(newType))
+ {
+ throw new IllegalConfigurationException("Changing the type of preferences provider is not supported");
+ }
+ String path = (String) attributes.get(PATH);
+ if (path == null || path.equals("") || !(path instanceof String))
+ {
+ throw new IllegalConfigurationException("Path to preferences file is not specified");
+ }
+ }
+
+ public void createStoreIfNotExist()
+ {
+ _store.createIfNotExist();
+ }
+
+ public static class FileSystemPreferencesStore
+ {
+ private final ObjectMapper _objectMapper;
+ private final Map<String, Map<String, Object>> _preferences;
+ private File _storeFile;
+ private FileLock _storeLock;
+ private RandomAccessFile _storeRAF;
+
+ public FileSystemPreferencesStore(File preferencesFile)
+ {
+ _storeFile = preferencesFile;
+ _objectMapper = new ObjectMapper();
+ _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+ _objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
+ _preferences = new TreeMap<String, Map<String, Object>>();
+ }
+
+ public void createIfNotExist()
+ {
+ if (!_storeFile.exists())
+ {
+ File parent = _storeFile.getParentFile();
+ if (!parent.exists() && !parent.mkdirs())
+ {
+ throw new IllegalConfigurationException("Cannot create preferences store folders");
+ }
+ try
+ {
+ if (_storeFile.createNewFile() && !_storeFile.exists())
+ {
+ throw new IllegalConfigurationException("Preferences store file was not created:" + _storeFile.getAbsolutePath());
+ }
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot create preferences store file");
+ }
+ }
+ }
+
+ public void delete()
+ {
+ if (_storeFile.exists() && !_storeFile.delete())
+ {
+ LOGGER.warn("Failed to delete preferences provider file '" + _storeFile.getName() + "'");
+ }
+ }
+
+ public void open()
+ {
+ if (!_storeFile.exists())
+ {
+ throw new IllegalConfigurationException("Preferences file does not exist");
+ }
+
+ if (_storeLock != null)
+ {
+ throw new IllegalStateException("Preferences store is already opened");
+ }
+ try
+ {
+ _storeRAF = new RandomAccessFile(_storeFile, "rw");
+ FileChannel fileChannel = _storeRAF.getChannel();
+ try
+ {
+ _storeLock = fileChannel.tryLock();
+ }
+ catch (OverlappingFileLockException e)
+ {
+ _storeLock = null;
+ }
+ if (_storeLock == null)
+ {
+ throw new IllegalConfigurationException("Cannot get lock on store file " + _storeFile.getName()
+ + " is another instance running?");
+ }
+ long fileSize = fileChannel.size();
+ if (fileSize > 0)
+ {
+ ByteBuffer buffer = ByteBuffer.allocate((int) fileSize);
+ fileChannel.read(buffer);
+ buffer.rewind();
+ buffer.flip();
+ byte[] data = buffer.array();
+ try
+ {
+ Map<String, Map<String, Object>> preferencesMap = _objectMapper.readValue(data,
+ new TypeReference<Map<String, Map<String, Object>>>()
+ {
+ });
+ _preferences.putAll(preferencesMap);
+ }
+ catch (JsonProcessingException e)
+ {
+ throw new IllegalConfigurationException("Cannot parse preferences json in " + _storeFile.getName(), e);
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot load preferences from " + _storeFile.getName(), e);
+ }
+ }
+
+ public void close()
+ {
+ synchronized (_preferences)
+ {
+ try
+ {
+ if (_storeLock != null)
+ {
+ _storeLock.release();
+ }
+ }
+ catch (IOException e)
+ {
+ LOGGER.error("Cannot release file lock for preferences file store", e);
+ }
+ finally
+ {
+ _storeLock = null;
+ try
+ {
+ if (_storeRAF != null)
+ {
+ _storeRAF.close();
+ }
+ }
+ catch (IOException e)
+ {
+ LOGGER.error("Cannot close preferences file", e);
+ }
+ finally
+ {
+ _storeRAF = null;
+ _preferences.clear();
+ }
+ }
+ }
+ }
+
+ public Map<String, Object> getPreferences(String userId)
+ {
+ checkStoreOpened();
+ Map<String, Object> userPreferences = null;
+ synchronized (_preferences)
+ {
+ userPreferences = _preferences.get(userId);
+ }
+ if (userPreferences != null)
+ {
+ return new HashMap<String, Object>(userPreferences);
+ }
+ return Collections.emptyMap();
+ }
+
+ public Map<String, Object> setPreferences(String userId, Map<String, Object> preferences)
+ {
+ checkStoreOpened();
+ Map<String, Object> userPreferences = null;
+ synchronized (_preferences)
+ {
+ userPreferences = _preferences.get(userId);
+ if (userPreferences == null)
+ {
+ userPreferences = new HashMap<String, Object>(preferences);
+ _preferences.put(userId, userPreferences);
+ }
+ else
+ {
+ userPreferences.putAll(preferences);
+ }
+ save();
+ }
+ return userPreferences;
+ }
+
+ public String[] deletePreferences(String... userIDs)
+ {
+ checkStoreOpened();
+ Set<String> deletedUsers = new HashSet<String>();
+ synchronized (_preferences)
+ {
+ for (String id : userIDs)
+ {
+ if (_preferences.containsKey(id))
+ {
+ _preferences.remove(id);
+ deletedUsers.add(id);
+ }
+ }
+ if (!deletedUsers.isEmpty())
+ {
+ save();
+ }
+ }
+ return deletedUsers.toArray(new String[deletedUsers.size()]);
+ }
+
+ public Set<String> listUserIDs()
+ {
+ checkStoreOpened();
+ synchronized (_preferences)
+ {
+ return Collections.unmodifiableSet(_preferences.keySet());
+ }
+ }
+
+ private void save()
+ {
+ checkStoreOpened();
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ _objectMapper.writeValue(baos, _preferences);
+ FileChannel channel = _storeRAF.getChannel();
+ long currentSize = channel.size();
+ channel.position(0);
+ channel.write(ByteBuffer.wrap(baos.toByteArray()));
+ if (currentSize > baos.size())
+ {
+ channel.truncate(baos.size());
+ }
+ }
+ catch (IOException e)
+ {
+ throw new IllegalConfigurationException("Cannot store preferences", e);
+ }
+ }
+
+ private void checkStoreOpened()
+ {
+ if (_storeLock == null)
+ {
+ throw new IllegalStateException("Preferences store is not opened");
+ }
+ }
+
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java
index 32ee910973..32ee910973 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
index 9323606c83..9323606c83 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java
index 1d3ccd81b3..1d3ccd81b3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java
index 1101232c96..1101232c96 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java
index 03fdbd1e85..03fdbd1e85 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/NoStatistics.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
index 0547f961d0..0547f961d0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
index 8dc446e5b2..8dc446e5b2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
index 074f7c243b..074f7c243b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
index 31ce7e56fd..31ce7e56fd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java
index 28c46a0339..28c46a0339 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/StatisticsAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java
index 5e7bfff4de..5e7bfff4de 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/TrustStoreAdapter.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
new file mode 100644
index 0000000000..16151dbb63
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
@@ -0,0 +1,1255 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import java.io.File;
+import java.lang.reflect.Type;
+import java.security.AccessControlException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.commons.configuration.CompositeConfiguration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.configuration.SystemConfiguration;
+import org.apache.log4j.Logger;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
+import org.apache.qpid.server.configuration.XmlConfigurationUtilities.MyConfiguration;
+import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Connection;
+import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.IntegrityViolationException;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.QueueType;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.Statistics;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.VirtualHostAlias;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.plugin.ExchangeType;
+import org.apache.qpid.server.protocol.AMQConnectionModel;
+import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.queue.QueueEntry;
+import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.security.access.Operation;
+import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.txn.LocalTransaction;
+import org.apache.qpid.server.txn.ServerTransaction;
+import org.apache.qpid.server.util.MapValueConverter;
+import org.apache.qpid.server.plugin.VirtualHostFactory;
+import org.apache.qpid.server.virtualhost.ExchangeExistsException;
+import org.apache.qpid.server.virtualhost.ReservedExchangeNameException;
+import org.apache.qpid.server.virtualhost.UnknownExchangeException;
+import org.apache.qpid.server.virtualhost.VirtualHostListener;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.apache.qpid.server.virtualhost.plugins.QueueExistsException;
+
+public final class VirtualHostAdapter extends AbstractAdapter implements VirtualHost, VirtualHostListener
+{
+ private static final Logger LOGGER = Logger.getLogger(VirtualHostAdapter.class);
+
+ @SuppressWarnings("serial")
+ public static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>(){{
+ put(NAME, String.class);
+ put(TYPE, String.class);
+ put(STORE_PATH, String.class);
+ put(STORE_TYPE, String.class);
+ put(CONFIG_PATH, String.class);
+ put(STATE, State.class);
+ }});
+
+ private org.apache.qpid.server.virtualhost.VirtualHost _virtualHost;
+
+ private final Map<AMQConnectionModel, ConnectionAdapter> _connectionAdapters =
+ new HashMap<AMQConnectionModel, ConnectionAdapter>();
+
+ private final Map<AMQQueue, QueueAdapter> _queueAdapters =
+ new HashMap<AMQQueue, QueueAdapter>();
+
+ private final Map<org.apache.qpid.server.exchange.Exchange, ExchangeAdapter> _exchangeAdapters =
+ new HashMap<org.apache.qpid.server.exchange.Exchange, ExchangeAdapter>();
+ private StatisticsAdapter _statistics;
+ private final Broker _broker;
+ private final List<VirtualHostAlias> _aliases = new ArrayList<VirtualHostAlias>();
+ private StatisticsGatherer _brokerStatisticsGatherer;
+
+ public VirtualHostAdapter(UUID id, Map<String, Object> attributes, Broker broker, StatisticsGatherer brokerStatisticsGatherer, TaskExecutor taskExecutor)
+ {
+ super(id, null, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES, false), taskExecutor, false);
+ _broker = broker;
+ _brokerStatisticsGatherer = brokerStatisticsGatherer;
+ validateAttributes();
+ addParent(Broker.class, broker);
+ }
+
+ private void validateAttributes()
+ {
+ String name = getName();
+ if (name == null || "".equals(name.trim()))
+ {
+ throw new IllegalConfigurationException("Virtual host name must be specified");
+ }
+
+ String configurationFile = (String) getAttribute(CONFIG_PATH);
+ String type = (String) getAttribute(TYPE);
+
+ boolean invalidAttributes = false;
+ if (configurationFile == null)
+ {
+ if (type == null)
+ {
+ invalidAttributes = true;
+ }
+ else
+ {
+ validateAttributes(type);
+ }
+ }/*
+ else
+ {
+ if (type != null)
+ {
+ invalidAttributes = true;
+ }
+
+ }*/
+ if (invalidAttributes)
+ {
+ throw new IllegalConfigurationException("Please specify either the 'configPath' attribute or 'type' attributes");
+ }
+
+ // pre-load the configuration in order to validate
+ try
+ {
+ createVirtualHostConfiguration(name);
+ }
+ catch(ConfigurationException e)
+ {
+ throw new IllegalConfigurationException("Failed to validate configuration", e);
+ }
+ }
+
+ private void validateAttributes(String type)
+ {
+ final VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
+ if(factory == null)
+ {
+ throw new IllegalArgumentException("Unknown virtual host type '"+ type +"'. Valid types are: " + VirtualHostFactory.TYPES.get());
+ }
+ factory.validateAttributes(getActualAttributes());
+
+ }
+
+ private void populateExchanges()
+ {
+ Collection<org.apache.qpid.server.exchange.Exchange> actualExchanges =
+ _virtualHost.getExchanges();
+
+ synchronized (_exchangeAdapters)
+ {
+ for(org.apache.qpid.server.exchange.Exchange exchange : actualExchanges)
+ {
+ if(!_exchangeAdapters.containsKey(exchange))
+ {
+ _exchangeAdapters.put(exchange, new ExchangeAdapter(this,exchange));
+ }
+ }
+ }
+ }
+
+
+ private void populateQueues()
+ {
+ Collection<AMQQueue> actualQueues = _virtualHost.getQueues();
+ if ( actualQueues != null )
+ {
+ synchronized(_queueAdapters)
+ {
+ for(AMQQueue queue : actualQueues)
+ {
+ if(!_queueAdapters.containsKey(queue))
+ {
+ _queueAdapters.put(queue, new QueueAdapter(this, queue));
+ }
+ }
+ }
+ }
+ }
+
+ public Collection<VirtualHostAlias> getAliases()
+ {
+ return Collections.unmodifiableCollection(_aliases);
+ }
+
+ public Collection<Connection> getConnections()
+ {
+ synchronized(_connectionAdapters)
+ {
+ return new ArrayList<Connection>(_connectionAdapters.values());
+ }
+
+ }
+
+ /**
+ * Retrieve the ConnectionAdapter instance keyed by the AMQConnectionModel from this VirtualHost.
+ * @param connection the AMQConnectionModel used to index the ConnectionAdapter.
+ * @return the requested ConnectionAdapter.
+ */
+ ConnectionAdapter getConnectionAdapter(AMQConnectionModel connection)
+ {
+ synchronized (_connectionAdapters)
+ {
+ return _connectionAdapters.get(connection);
+ }
+ }
+
+ public Collection<Queue> getQueues()
+ {
+ synchronized(_queueAdapters)
+ {
+ return new ArrayList<Queue>(_queueAdapters.values());
+ }
+ }
+
+ public Collection<Exchange> getExchanges()
+ {
+ synchronized (_exchangeAdapters)
+ {
+ return new ArrayList<Exchange>(_exchangeAdapters.values());
+ }
+ }
+
+
+ public Exchange createExchange(Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException
+ {
+ attributes = new HashMap<String, Object>(attributes);
+
+ String name = MapValueConverter.getStringAttribute(Exchange.NAME, attributes, null);
+ State state = MapValueConverter.getEnumAttribute(State.class, Exchange.STATE, attributes, State.ACTIVE);
+ boolean durable = MapValueConverter.getBooleanAttribute(Exchange.DURABLE, attributes, false);
+ LifetimePolicy lifetime = MapValueConverter.getEnumAttribute(LifetimePolicy.class, Exchange.LIFETIME_POLICY, attributes, LifetimePolicy.PERMANENT);
+ String type = MapValueConverter.getStringAttribute(Exchange.TYPE, attributes, null);
+ long ttl = MapValueConverter.getLongAttribute(Exchange.TIME_TO_LIVE, attributes, 0l);
+
+ attributes.remove(Exchange.NAME);
+ attributes.remove(Exchange.STATE);
+ attributes.remove(Exchange.DURABLE);
+ attributes.remove(Exchange.LIFETIME_POLICY);
+ attributes.remove(Exchange.TYPE);
+ attributes.remove(Exchange.TIME_TO_LIVE);
+
+ return createExchange(name, state, durable, lifetime, ttl, type, attributes);
+ }
+
+ public Exchange createExchange(final String name,
+ final State initialState,
+ final boolean durable,
+ final LifetimePolicy lifetime,
+ final long ttl,
+ final String type,
+ final Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException
+ {
+ checkVHostStateIsActive();
+
+ try
+ {
+ String alternateExchange = null;
+ if(attributes.containsKey(Exchange.ALTERNATE_EXCHANGE))
+ {
+ Object altExchangeObject = attributes.get(Exchange.ALTERNATE_EXCHANGE);
+ if(altExchangeObject instanceof Exchange)
+ {
+ alternateExchange = ((Exchange) altExchangeObject).getName();
+ }
+ else if(altExchangeObject instanceof UUID)
+ {
+ for(Exchange ex : getExchanges())
+ {
+ if(altExchangeObject.equals(ex.getId()))
+ {
+ alternateExchange = ex.getName();
+ break;
+ }
+ }
+ }
+ else if(altExchangeObject instanceof String)
+ {
+
+ for(Exchange ex : getExchanges())
+ {
+ if(altExchangeObject.equals(ex.getName()))
+ {
+ alternateExchange = ex.getName();
+ break;
+ }
+ }
+ if(alternateExchange == null)
+ {
+ try
+ {
+ UUID id = UUID.fromString(altExchangeObject.toString());
+ for(Exchange ex : getExchanges())
+ {
+ if(id.equals(ex.getId()))
+ {
+ alternateExchange = ex.getName();
+ break;
+ }
+ }
+ }
+ catch(IllegalArgumentException e)
+ {
+ // ignore
+ }
+
+ }
+ }
+ }
+ org.apache.qpid.server.exchange.Exchange exchange = _virtualHost.createExchange(null,
+ name,
+ type,
+ durable,
+ lifetime == LifetimePolicy.AUTO_DELETE,
+ alternateExchange);
+ synchronized (_exchangeAdapters)
+ {
+ return _exchangeAdapters.get(exchange);
+ }
+
+ }
+ catch(ExchangeExistsException e)
+ {
+ throw new IllegalArgumentException("Exchange with name '" + name + "' already exists");
+ }
+ catch(ReservedExchangeNameException e)
+ {
+ throw new UnsupportedOperationException("'" + name + "' is a reserved exchange name");
+ }
+ catch(UnknownExchangeException e)
+ {
+ throw new IllegalArgumentException("Alternate Exchange with name '" + e.getExchangeName() + "' does not exist");
+ }
+ catch(AMQException e)
+ {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ public Queue createQueue(Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException
+ {
+ attributes = new HashMap<String, Object>(attributes);
+
+ if (attributes.containsKey(Queue.TYPE))
+ {
+ String typeAttribute = MapValueConverter.getStringAttribute(Queue.TYPE, attributes, null);
+ QueueType queueType = null;
+ try
+ {
+ queueType = QueueType.valueOf(typeAttribute.toUpperCase());
+ }
+ catch(Exception e)
+ {
+ throw new IllegalArgumentException("Unsupported queue type :" + typeAttribute);
+ }
+ if (queueType == QueueType.LVQ && attributes.get(Queue.LVQ_KEY) == null)
+ {
+ attributes.put(Queue.LVQ_KEY, AMQQueueFactory.QPID_DEFAULT_LVQ_KEY);
+ }
+ else if (queueType == QueueType.PRIORITY && attributes.get(Queue.PRIORITIES) == null)
+ {
+ attributes.put(Queue.PRIORITIES, 10);
+ }
+ else if (queueType == QueueType.SORTED && attributes.get(Queue.SORT_KEY) == null)
+ {
+ throw new IllegalArgumentException("Sort key is not specified for sorted queue");
+ }
+ }
+
+ String name = MapValueConverter.getStringAttribute(Queue.NAME, attributes, null);
+ State state = MapValueConverter.getEnumAttribute(State.class, Queue.STATE, attributes, State.ACTIVE);
+ boolean durable = MapValueConverter.getBooleanAttribute(Queue.DURABLE, attributes, false);
+ LifetimePolicy lifetime = MapValueConverter.getEnumAttribute(LifetimePolicy.class, Queue.LIFETIME_POLICY, attributes, LifetimePolicy.PERMANENT);
+ long ttl = MapValueConverter.getLongAttribute(Queue.TIME_TO_LIVE, attributes, 0l);
+ boolean exclusive= MapValueConverter.getBooleanAttribute(Queue.EXCLUSIVE, attributes, false);
+
+ attributes.remove(Queue.NAME);
+ attributes.remove(Queue.STATE);
+ attributes.remove(Queue.DURABLE);
+ attributes.remove(Queue.LIFETIME_POLICY);
+ attributes.remove(Queue.TIME_TO_LIVE);
+
+ return createQueue(name, state, durable, exclusive, lifetime, ttl, attributes);
+ }
+
+ public Queue createQueue(final String name,
+ final State initialState,
+ final boolean durable,
+ boolean exclusive,
+ final LifetimePolicy lifetime,
+ final long ttl,
+ final Map<String, Object> attributes)
+ throws AccessControlException, IllegalArgumentException
+ {
+ checkVHostStateIsActive();
+
+ String owner = null;
+ if(exclusive)
+ {
+ Principal authenticatedPrincipal = AuthenticatedPrincipal.getOptionalAuthenticatedPrincipalFromSubject(SecurityManager.getThreadSubject());
+ if(authenticatedPrincipal != null)
+ {
+ owner = authenticatedPrincipal.getName();
+ }
+ }
+
+ final boolean autoDelete = lifetime == LifetimePolicy.AUTO_DELETE;
+
+ try
+ {
+
+ AMQQueue queue =
+ _virtualHost.createQueue(UUIDGenerator.generateQueueUUID(name, _virtualHost.getName()), name,
+ durable, owner, autoDelete, exclusive, autoDelete && exclusive, attributes);
+
+ synchronized (_queueAdapters)
+ {
+ return _queueAdapters.get(queue);
+ }
+
+ }
+ catch(QueueExistsException qe)
+ {
+ throw new IllegalArgumentException("Queue with name "+name+" already exists");
+ }
+ catch(AMQException e)
+ {
+ throw new IllegalArgumentException(e);
+ }
+
+ }
+
+ public String getName()
+ {
+ return (String)getAttribute(NAME);
+ }
+
+ public String setName(final String currentName, final String desiredName)
+ throws IllegalStateException, AccessControlException
+ {
+ throw new IllegalStateException();
+ }
+
+
+ public String getType()
+ {
+ return (String)getAttribute(TYPE);
+ }
+
+ public String setType(final String currentType, final String desiredType)
+ throws IllegalStateException, AccessControlException
+ {
+ throw new IllegalStateException();
+ }
+
+
+ @Override
+ public State getActualState()
+ {
+ if (_virtualHost == null)
+ {
+ State state = (State)super.getAttribute(STATE);
+ if (state == null)
+ {
+ return State.INITIALISING;
+ }
+ return state;
+ }
+ else
+ {
+ org.apache.qpid.server.virtualhost.State implementationState = _virtualHost.getState();
+ switch(implementationState)
+ {
+ case INITIALISING:
+ return State.INITIALISING;
+ case ACTIVE:
+ return State.ACTIVE;
+ case PASSIVE:
+ return State.REPLICA;
+ case STOPPED:
+ return State.STOPPED;
+ case ERRORED:
+ return State.ERRORED;
+ default:
+ throw new IllegalStateException("Unsupported state:" + implementationState);
+ }
+ }
+ }
+
+ public boolean isDurable()
+ {
+ return true;
+ }
+
+ public void setDurable(final boolean durable)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public LifetimePolicy getLifetimePolicy()
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+
+ public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ public long setTimeToLive(final long expected, final long desired)
+ throws IllegalStateException, AccessControlException, IllegalArgumentException
+ {
+ throw new IllegalStateException();
+ }
+
+ public Statistics getStatistics()
+ {
+ return _statistics;
+ }
+
+ @Override
+ public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
+ {
+ if(clazz == Exchange.class)
+ {
+ return (Collection<C>) getExchanges();
+ }
+ else if(clazz == Queue.class)
+ {
+ return (Collection<C>) getQueues();
+ }
+ else if(clazz == Connection.class)
+ {
+ return (Collection<C>) getConnections();
+ }
+ else if(clazz == VirtualHostAlias.class)
+ {
+ return (Collection<C>) getAliases();
+ }
+ else
+ {
+ return Collections.emptySet();
+ }
+ }
+
+ @Override
+ public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+ {
+ if(childClass == Exchange.class)
+ {
+ createExchange(attributes);
+
+ // return null to avoid double notification of VirtualHostMBean
+ // as we already notify it in the exchangeRegistered
+ return null;
+ }
+ else if(childClass == Queue.class)
+ {
+ createQueue(attributes);
+
+ // return null to avoid double notification of VirtualHostMBean
+ // as we already notify it in the queueRegistered
+ return null;
+ }
+ else if(childClass == VirtualHostAlias.class)
+ {
+ throw new UnsupportedOperationException();
+ }
+ else if(childClass == Connection.class)
+ {
+ throw new UnsupportedOperationException();
+ }
+ throw new IllegalArgumentException("Cannot create a child of class " + childClass.getSimpleName());
+ }
+
+ public void exchangeRegistered(org.apache.qpid.server.exchange.Exchange exchange)
+ {
+ ExchangeAdapter adapter = null;
+ synchronized (_exchangeAdapters)
+ {
+ if(!_exchangeAdapters.containsKey(exchange))
+ {
+ adapter = new ExchangeAdapter(this, exchange);
+ _exchangeAdapters.put(exchange, adapter);
+
+ }
+
+ }
+ if(adapter != null)
+ {
+ childAdded(adapter);
+ }
+
+ }
+
+
+ public void exchangeUnregistered(org.apache.qpid.server.exchange.Exchange exchange)
+ {
+ ExchangeAdapter adapter;
+ synchronized (_exchangeAdapters)
+ {
+ adapter = _exchangeAdapters.remove(exchange);
+
+ }
+
+ if(adapter != null)
+ {
+ childRemoved(adapter);
+ }
+ }
+
+ public void queueRegistered(AMQQueue queue)
+ {
+ QueueAdapter adapter = null;
+ synchronized (_queueAdapters)
+ {
+ if(!_queueAdapters.containsKey(queue))
+ {
+ adapter = new QueueAdapter(this, queue);
+ _queueAdapters.put(queue, adapter);
+
+ }
+
+ }
+ if(adapter != null)
+ {
+ childAdded(adapter);
+ }
+
+ }
+
+ public void queueUnregistered(AMQQueue queue)
+ {
+
+ QueueAdapter adapter;
+ synchronized (_queueAdapters)
+ {
+ adapter = _queueAdapters.remove(queue);
+
+ }
+
+ if(adapter != null)
+ {
+ childRemoved(adapter);
+ }
+ }
+
+ public void connectionRegistered(AMQConnectionModel connection)
+ {
+ ConnectionAdapter adapter = null;
+ synchronized (_connectionAdapters)
+ {
+ if(!_connectionAdapters.containsKey(connection))
+ {
+ adapter = new ConnectionAdapter(connection, getTaskExecutor());
+ _connectionAdapters.put(connection, adapter);
+
+ }
+
+ }
+ if(adapter != null)
+ {
+ childAdded(adapter);
+ }
+ }
+
+ public void connectionUnregistered(AMQConnectionModel connection)
+ {
+
+ ConnectionAdapter adapter;
+ synchronized (_connectionAdapters)
+ {
+ adapter = _connectionAdapters.remove(connection);
+
+ }
+
+ if(adapter != null)
+ {
+ // Call getSessions() first to ensure that any SessionAdapter children are cleanly removed and any
+ // corresponding ConfigurationChangeListener childRemoved() callback is called for child SessionAdapters.
+ adapter.getSessions();
+
+ childRemoved(adapter);
+ }
+ }
+
+ QueueAdapter getQueueAdapter(AMQQueue queue)
+ {
+ synchronized (_queueAdapters)
+ {
+ return _queueAdapters.get(queue);
+ }
+ }
+
+ public Collection<String> getExchangeTypes()
+ {
+ Collection<ExchangeType<? extends org.apache.qpid.server.exchange.Exchange>> types =
+ _virtualHost.getExchangeTypes();
+
+ Collection<String> exchangeTypes = new ArrayList<String>();
+
+ for(ExchangeType<? extends org.apache.qpid.server.exchange.Exchange> type : types)
+ {
+ exchangeTypes.add(type.getType());
+ }
+ return Collections.unmodifiableCollection(exchangeTypes);
+ }
+
+ public void executeTransaction(TransactionalOperation op)
+ {
+ MessageStore store = _virtualHost.getMessageStore();
+ final LocalTransaction txn = new LocalTransaction(store);
+
+ op.withinTransaction(new Transaction()
+ {
+ public void dequeue(final QueueEntry entry)
+ {
+ if(entry.acquire())
+ {
+ txn.dequeue(entry.getQueue(), entry.getMessage(), new ServerTransaction.Action()
+ {
+ public void postCommit()
+ {
+ entry.discard();
+ }
+
+ public void onRollback()
+ {
+ }
+ });
+ }
+ }
+
+ public void copy(QueueEntry entry, Queue queue)
+ {
+ final ServerMessage message = entry.getMessage();
+ final AMQQueue toQueue = ((QueueAdapter)queue).getAMQQueue();
+
+ txn.enqueue(toQueue, message, new ServerTransaction.Action()
+ {
+ public void postCommit()
+ {
+ try
+ {
+ toQueue.enqueue(message);
+ }
+ catch(AMQException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void onRollback()
+ {
+ }
+ });
+
+ }
+
+ public void move(final QueueEntry entry, Queue queue)
+ {
+ final ServerMessage message = entry.getMessage();
+ final AMQQueue toQueue = ((QueueAdapter)queue).getAMQQueue();
+ if(entry.acquire())
+ {
+ txn.enqueue(toQueue, message,
+ new ServerTransaction.Action()
+ {
+
+ public void postCommit()
+ {
+ try
+ {
+ toQueue.enqueue(message);
+ }
+ catch (AMQException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void onRollback()
+ {
+ entry.release();
+ }
+ });
+ txn.dequeue(entry.getQueue(), message,
+ new ServerTransaction.Action()
+ {
+
+ public void postCommit()
+ {
+ entry.discard();
+ }
+
+ public void onRollback()
+ {
+
+ }
+ });
+ }
+ }
+
+ });
+ txn.commit();
+ }
+
+ org.apache.qpid.server.virtualhost.VirtualHost getVirtualHost()
+ {
+ return _virtualHost;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ if(ID.equals(name))
+ {
+ return getId();
+ }
+ else if(STATE.equals(name))
+ {
+ return getActualState();
+ }
+ else if(DURABLE.equals(name))
+ {
+ return isDurable();
+ }
+ else if(LIFETIME_POLICY.equals(name))
+ {
+ return LifetimePolicy.PERMANENT;
+ }
+ else if(TIME_TO_LIVE.equals(name))
+ {
+ // TODO
+ }
+ else if(CREATED.equals(name))
+ {
+ // TODO
+ }
+ else if(UPDATED.equals(name))
+ {
+ // TODO
+ }
+ else if (_virtualHost != null)
+ {
+ return getAttributeFromVirtualHostImplementation(name);
+ }
+ return super.getAttribute(name);
+ }
+
+ private Object getAttributeFromVirtualHostImplementation(String name)
+ {
+ if(SUPPORTED_EXCHANGE_TYPES.equals(name))
+ {
+ List<String> types = new ArrayList<String>();
+ for(@SuppressWarnings("rawtypes") ExchangeType type : _virtualHost.getExchangeTypes())
+ {
+ types.add(type.getType());
+ }
+ return Collections.unmodifiableCollection(types);
+ }
+ else if(SUPPORTED_QUEUE_TYPES.equals(name))
+ {
+ // TODO
+ }
+ else if(QUEUE_DEAD_LETTER_QUEUE_ENABLED.equals(name))
+ {
+ return _virtualHost.getConfiguration().isDeadLetterQueueEnabled();
+ }
+ else if(HOUSEKEEPING_CHECK_PERIOD.equals(name))
+ {
+ return _virtualHost.getConfiguration().getHousekeepingCheckPeriod();
+ }
+ else if(QUEUE_MAXIMUM_DELIVERY_ATTEMPTS.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMaxDeliveryCount();
+ }
+ else if(QUEUE_FLOW_CONTROL_SIZE_BYTES.equals(name))
+ {
+ return _virtualHost.getConfiguration().getCapacity();
+ }
+ else if(QUEUE_FLOW_RESUME_SIZE_BYTES.equals(name))
+ {
+ return _virtualHost.getConfiguration().getFlowResumeCapacity();
+ }
+ else if(STORE_TYPE.equals(name))
+ {
+ return _virtualHost.getMessageStore().getStoreType();
+ }
+ else if(STORE_PATH.equals(name))
+ {
+ return _virtualHost.getMessageStore().getStoreLocation();
+ }
+ else if(STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE.equals(name))
+ {
+ return _virtualHost.getConfiguration().getTransactionTimeoutIdleClose();
+ }
+ else if(STORE_TRANSACTION_IDLE_TIMEOUT_WARN.equals(name))
+ {
+ return _virtualHost.getConfiguration().getTransactionTimeoutIdleWarn();
+ }
+ else if(STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE.equals(name))
+ {
+ return _virtualHost.getConfiguration().getTransactionTimeoutOpenClose();
+ }
+ else if(STORE_TRANSACTION_OPEN_TIMEOUT_WARN.equals(name))
+ {
+ return _virtualHost.getConfiguration().getTransactionTimeoutOpenWarn();
+ }
+ else if(QUEUE_ALERT_REPEAT_GAP.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMinimumAlertRepeatGap();
+ }
+ else if(QUEUE_ALERT_THRESHOLD_MESSAGE_AGE.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMaximumMessageAge();
+ }
+ else if(QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMaximumMessageSize();
+ }
+ else if(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMaximumQueueDepth();
+ }
+ else if(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES.equals(name))
+ {
+ return _virtualHost.getConfiguration().getMaximumMessageCount();
+ }
+ return super.getAttribute(name);
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return AVAILABLE_ATTRIBUTES;
+ }
+
+ private void checkVHostStateIsActive()
+ {
+ if (!org.apache.qpid.server.virtualhost.State.ACTIVE.equals(_virtualHost.getState()))
+ {
+ throw new IllegalStateException("The virtual hosts state of " + _virtualHost.getState()
+ + " does not permit this operation.");
+ }
+ }
+
+
+ private static class VirtualHostStatisticsAdapter extends StatisticsAdapter
+ {
+ private final org.apache.qpid.server.virtualhost.VirtualHost _vhost;
+
+ private static final Collection<String> VHOST_STATS = Arrays.asList(
+ VirtualHost.QUEUE_COUNT,
+ VirtualHost.EXCHANGE_COUNT,
+ VirtualHost.CONNECTION_COUNT);
+
+ public VirtualHostStatisticsAdapter(org.apache.qpid.server.virtualhost.VirtualHost virtualHost)
+ {
+ super(virtualHost);
+ _vhost = virtualHost;
+ }
+
+ @Override
+ public Collection<String> getStatisticNames()
+ {
+ Set<String> stats = new HashSet<String>(super.getStatisticNames());
+ stats.addAll(VHOST_STATS);
+ return stats;
+ }
+
+ @Override
+ public Object getStatistic(String name)
+ {
+ if(VirtualHost.QUEUE_COUNT.equals(name))
+ {
+ return _vhost.getQueues().size();
+ }
+ else if(VirtualHost.EXCHANGE_COUNT.equals(name))
+ {
+ return _vhost.getExchanges().size();
+ }
+ else if(VirtualHost.CONNECTION_COUNT.equals(name))
+ {
+ return _vhost.getConnectionRegistry().getConnections().size();
+ }
+ else
+ {
+ return super.getStatistic(name);
+ }
+ }
+ }
+
+
+ @Override
+ protected boolean setState(State currentState, State desiredState)
+ {
+ if (desiredState == State.ACTIVE)
+ {
+ try
+ {
+ activate();
+ }
+ catch(RuntimeException e)
+ {
+ changeAttribute(STATE, State.INITIALISING, State.ERRORED);
+ if (_broker.isManagementMode())
+ {
+ LOGGER.warn("Failed to activate virtual host: " + getName(), e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ return true;
+ }
+ else if (desiredState == State.STOPPED)
+ {
+ if (_virtualHost != null)
+ {
+ try
+ {
+ _virtualHost.close();
+ }
+ finally
+ {
+ _broker.getVirtualHostRegistry().unregisterVirtualHost(_virtualHost);
+ }
+ }
+ return true;
+ }
+ else if (desiredState == State.DELETED)
+ {
+ String hostName = getName();
+
+ if (hostName.equals(_broker.getAttribute(Broker.DEFAULT_VIRTUAL_HOST)))
+ {
+ throw new IntegrityViolationException("Cannot delete default virtual host '" + hostName + "'");
+ }
+ if (_virtualHost != null)
+ {
+ if (_virtualHost.getState() == org.apache.qpid.server.virtualhost.State.ACTIVE)
+ {
+ setDesiredState(currentState, State.STOPPED);
+ }
+
+ MessageStore ms = _virtualHost.getMessageStore();
+ if (ms != null)
+ {
+ try
+ {
+ ms.onDelete();
+ }
+ catch(Exception e)
+ {
+ LOGGER.warn("Exception occured on store deletion", e);
+ }
+ }
+
+ _virtualHost = null;
+ }
+ setAttribute(VirtualHost.STATE, getActualState(), State.DELETED);
+ return true;
+ }
+ return false;
+ }
+
+ private void activate()
+ {
+ VirtualHostRegistry virtualHostRegistry = _broker.getVirtualHostRegistry();
+ String virtualHostName = getName();
+ try
+ {
+ VirtualHostConfiguration configuration = createVirtualHostConfiguration(virtualHostName);
+ String type = configuration.getType();
+ final VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
+ if(factory == null)
+ {
+ throw new IllegalArgumentException("Unknown virtual host type: " + type);
+ }
+ else
+ {
+ _virtualHost = factory.createVirtualHost(_broker.getVirtualHostRegistry(),
+ _brokerStatisticsGatherer,
+ _broker.getSecurityManager(),
+ configuration,
+ this);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to create virtual host " + virtualHostName, e);
+ }
+
+ virtualHostRegistry.registerVirtualHost(_virtualHost);
+
+ _statistics = new VirtualHostStatisticsAdapter(_virtualHost);
+ _virtualHost.addVirtualHostListener(this);
+ populateQueues();
+ populateExchanges();
+
+ synchronized(_aliases)
+ {
+ for(Port port :_broker.getPorts())
+ {
+ if (Protocol.hasAmqpProtocol(port.getProtocols()))
+ {
+ _aliases.add(new VirtualHostAliasAdapter(this, port));
+ }
+ }
+ }
+ }
+
+ private VirtualHostConfiguration createVirtualHostConfiguration(String virtualHostName) throws ConfigurationException
+ {
+ VirtualHostConfiguration configuration;
+ String configurationFile = (String)getAttribute(CONFIG_PATH);
+ if (configurationFile == null)
+ {
+ final MyConfiguration basicConfiguration = new MyConfiguration();
+ PropertiesConfiguration config = new PropertiesConfiguration();
+ final String type = (String) getAttribute(TYPE);
+ config.addProperty("type", type);
+ VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
+ if(factory != null)
+ {
+ for(Map.Entry<String,Object> entry : factory.createVirtualHostConfiguration(this).entrySet())
+ {
+ config.addProperty(entry.getKey(), entry.getValue());
+ }
+ }
+ basicConfiguration.addConfiguration(config);
+
+ CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
+ compositeConfiguration.addConfiguration(new SystemConfiguration());
+ compositeConfiguration.addConfiguration(basicConfiguration);
+ configuration = new VirtualHostConfiguration(virtualHostName, compositeConfiguration , _broker);
+ }
+ else
+ {
+ if (!new File(configurationFile).exists())
+ {
+ throw new IllegalConfigurationException("Configuration file '" + configurationFile + "' does not exist");
+ }
+ configuration = new VirtualHostConfiguration(virtualHostName, new File(configurationFile) , _broker);
+ String type = configuration.getType();
+ changeAttribute(TYPE,null,type);
+ VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
+ if(factory != null)
+ {
+ for(Map.Entry<String,Object> entry : factory.convertVirtualHostConfiguration(configuration.getConfig()).entrySet())
+ {
+ changeAttribute(entry.getKey(), getAttribute(entry.getKey()), entry.getValue());
+ }
+ }
+
+ }
+ return configuration;
+ }
+
+ @Override
+ public SecurityManager getSecurityManager()
+ {
+ return _virtualHost.getSecurityManager();
+ }
+
+ @Override
+ public MessageStore getMessageStore()
+ {
+ return _virtualHost.getMessageStore();
+ }
+
+ @Override
+ protected void changeAttributes(Map<String, Object> attributes)
+ {
+ throw new UnsupportedOperationException("Changing attributes on virtualhosts is not supported.");
+ }
+
+ @Override
+ protected void authoriseSetDesiredState(State currentState, State desiredState) throws AccessControlException
+ {
+ if(desiredState == State.DELETED)
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.DELETE))
+ {
+ throw new AccessControlException("Deletion of virtual host is denied");
+ }
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of virtual host attributes is denied");
+ }
+ }
+
+ @Override
+ protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
+ {
+ if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.UPDATE))
+ {
+ throw new AccessControlException("Setting of virtual host attributes is denied");
+ }
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
index 91b705b004..91b705b004 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java
index 0298789672..0298789672 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java
new file mode 100644
index 0000000000..4805f06760
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.server.plugin;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+
+public interface AuthenticationManagerFactory extends Pluggable
+{
+ public static final String ATTRIBUTE_TYPE = AuthenticationProvider.TYPE;
+
+ /**
+ * Returns the authentication provider type
+ * @return authentication provider type
+ */
+ String getType();
+
+ /**
+ * Creates authentication manager from the provided attributes
+ * @param broker
+ * broker model object
+ * @param attributes
+ * attributes to create authentication manager
+ *
+ * @return authentication manager instance
+ */
+ AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes);
+
+ /**
+ * Get the names of attributes the authentication manager which can be passed into {@link #createInstance(Broker, Map)} to create the
+ * authentication manager
+ *
+ * @return the collection of attribute names
+ */
+ Collection<String> getAttributeNames();
+
+ /**
+ * @return returns human readable descriptions for the attributes
+ */
+ Map<String, String> getAttributeDescriptions();
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java
index 382c742161..382c742161 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ConfigurationStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java
index 94a029ced3..94a029ced3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java
index ab19fa196e..ab19fa196e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java
index 3d7a6323eb..3d7a6323eb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/GroupManagerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java
index 12fb9224bb..12fb9224bb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java
index cf3860ba92..cf3860ba92 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageConverter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java
index ee89782307..ee89782307 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageMetaDataType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
index 81404dcba8..81404dcba8 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/Pluggable.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/Pluggable.java
index cc18e83f8e..cc18e83f8e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/Pluggable.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/Pluggable.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java
index 7f804781a5..7f804781a5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PluginFactory.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java
new file mode 100644
index 0000000000..24f3a0bc85
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.qpid.server.plugin;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.PreferencesProvider;
+
+public interface PreferencesProviderFactory extends Pluggable
+{
+ PreferencesProvider createInstance(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider);
+
+ static final class TYPES
+ {
+ private TYPES()
+ {
+ }
+
+ public static Collection<String> get()
+ {
+ QpidServiceLoader<PreferencesProviderFactory> qpidServiceLoader = new QpidServiceLoader<PreferencesProviderFactory>();
+ Iterable<PreferencesProviderFactory> factories = qpidServiceLoader.atLeastOneInstanceOf(PreferencesProviderFactory.class);
+ List<String> names = new ArrayList<String>();
+ for(PreferencesProviderFactory factory : factories)
+ {
+ names.add(factory.getType());
+ }
+ return Collections.unmodifiableCollection(names);
+ }
+ }
+
+
+ static final class FACTORIES
+ {
+ private FACTORIES()
+ {
+ }
+
+ public static PreferencesProviderFactory get(String type)
+ {
+ QpidServiceLoader<PreferencesProviderFactory> qpidServiceLoader = new QpidServiceLoader<PreferencesProviderFactory>();
+ Iterable<PreferencesProviderFactory> factories = qpidServiceLoader.atLeastOneInstanceOf(PreferencesProviderFactory.class);
+ for(PreferencesProviderFactory factory : factories)
+ {
+ if(factory.getType().equals(type))
+ {
+ return factory;
+ }
+ }
+ return null;
+ }
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java
index 2fa9084b8b..2fa9084b8b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ProtocolEngineCreator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java
index 148a306b27..148a306b27 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/QpidServiceLoader.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java
index 9549b70c83..9549b70c83 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java
index 19c5d03e0c..19c5d03e0c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQConnectionModel.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java
index a3833eebb9..a3833eebb9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AMQSessionModel.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java
index 0a71fe257a..0a71fe257a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/AmqpProtocolVersion.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkModel.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkModel.java
index 16120a3523..16120a3523 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkModel.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkModel.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java
index 67d6e9f8d1..67d6e9f8d1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/LinkRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java
index 81e5af179d..81e5af179d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MessageConverterRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java
index 47b578c4ef..47b578c4ef 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngine.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java
index 3ce9383ee0..3ce9383ee0 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
index 46c2a635b7..46c2a635b7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
index ceebe4f965..ceebe4f965 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
index 029c7e4f86..029c7e4f86 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/BaseQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/BaseQueue.java
index 6145570b0c..6145570b0c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/BaseQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/BaseQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java
index c2813bb7a5..c2813bb7a5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java
index 53420ded9b..53420ded9b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/ConflationQueueList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
index 7d091dbf73..7d091dbf73 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/Filterable.java
index 50d8f4166d..50d8f4166d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/Filterable.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java
index 2a78ee430c..2a78ee430c 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/InboundMessageAdapter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
index 566cdd0ea5..566cdd0ea5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java
index daa5db393a..daa5db393a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/OutOfOrderQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java
index 66315af9fb..66315af9fb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java
index 589f385d22..589f385d22 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueArgumentsConverter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueContext.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueContext.java
index 79279b44c7..79279b44c7 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueContext.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueContext.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
index c44961c457..c44961c457 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
index 36feb27d86..36feb27d86 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java
index 73ebb0f300..73ebb0f300 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java
index 641aaa0a08..641aaa0a08 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java
index 4dbce45f67..4dbce45f67 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java
index 9ecaf6dafd..9ecaf6dafd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryVisitor.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueFactory.java
index 3e4e1df5a2..3e4e1df5a2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
index bc1d5942bd..bc1d5942bd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRunner.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRunner.java
index 22a2029494..22a2029494 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRunner.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueRunner.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
index fb36433799..fb36433799 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java
index 4a10d31d37..4a10d31d37 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryImpl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java
index b8d8ec19f4..b8d8ec19f4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueue.java
index b3566df0c4..b3566df0c4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueue.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueue.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java
index 1052adbe67..1052adbe67 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryImpl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java
index 7f742d455d..7f742d455d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java
index 87c79178f0..87c79178f0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SortedQueueEntryListFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java
index 47a7d733dd..47a7d733dd 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SubFlushRunner.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
index 9d16f4b927..9d16f4b927 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
index 7341922bd0..7341922bd0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/AccessControl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AccessControl.java
index 61e928a38c..61e928a38c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/AccessControl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AccessControl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java
index 8243fc3f75..8243fc3f75 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/AuthorizationHolder.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/Result.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/Result.java
index f79721799e..f79721799e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/Result.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/Result.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SecurityManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java
index ff45add206..ff45add206 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SecurityManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
index 244ab0dd94..244ab0dd94 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java
index 3a98a947df..3a98a947df 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/FileAccessControlProviderConstants.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java
index a379f85bbb..a379f85bbb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectProperties.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectType.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectType.java
index 9016205d1c..9016205d1c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ObjectType.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/ObjectType.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Operation.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Operation.java
index db5b8fba11..db5b8fba11 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Operation.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Operation.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java
index a683199abc..a683199abc 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/OperationLoggingDetails.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Permission.java
index 49b3a331f9..49b3a331f9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/access/Permission.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java
index fb31132514..fb31132514 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipal.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
index 09bf6cf3b1..09bf6cf3b1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java
index 3be96b87eb..3be96b87eb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/SubjectAuthenticationResult.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java
index 5b3c1d59cf..5b3c1d59cf 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/UsernamePrincipal.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java
index cb5bc54cd2..cb5bc54cd2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/AbstractPasswordFilePrincipalDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
index 4f3892c2c6..4f3892c2c6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java
index b9de1587b5..b9de1587b5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java
index 8e12d5f0a3..8e12d5f0a3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PasswordPrincipal.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
index 34d2710472..34d2710472 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java
index bf9bfc6c99..bf9bfc6c99 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PlainUser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
index 7e3e28e4f8..7e3e28e4f8 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java
index bf8d489e61..bf8d489e61 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticator.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java
new file mode 100644
index 0000000000..86d012cc96
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
+
+/**
+ * Factory for {@link PrincipalDatabaseAuthenticationManager} objects configured
+ * with either the Plain or Base64MD5 digest {@link PrincipalDatabase}
+ * implementation.
+ */
+public abstract class AbstractPrincipalDatabaseAuthManagerFactory implements AuthenticationManagerFactory
+{
+ public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.PasswordFileAuthenticationProviderAttributeDescriptions";
+ public static final String ATTRIBUTE_PATH = "path";
+
+ private static final Logger LOGGER = Logger.getLogger(AbstractPrincipalDatabaseAuthManagerFactory.class);
+
+ public static final Collection<String> ATTRIBUTES = Collections.unmodifiableList(Arrays.asList(
+ ATTRIBUTE_TYPE,
+ ATTRIBUTE_PATH));
+
+
+ @Override
+ public AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes)
+ {
+ if (attributes == null || !getType().equals(attributes.get(ATTRIBUTE_TYPE)))
+ {
+ return null;
+ }
+
+ String passwordFile = (String) attributes.get(ATTRIBUTE_PATH);
+ if (passwordFile == null)
+ {
+ LOGGER.warn("Password file path must not be null");
+ return null;
+ }
+
+ PrincipalDatabase principalDatabase = createPrincipalDatabase();
+ return new PrincipalDatabaseAuthenticationManager(principalDatabase, passwordFile);
+ }
+
+ abstract PrincipalDatabase createPrincipalDatabase();
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return ATTRIBUTES;
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
index 30626ce98c..30626ce98c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java
new file mode 100644
index 0000000000..2160a082f4
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+
+public class AnonymousAuthenticationManagerFactory implements AuthenticationManagerFactory
+{
+ public static final String PROVIDER_TYPE = "Anonymous";
+
+ @Override
+ public AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes)
+ {
+ if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
+ {
+ return new AnonymousAuthenticationManager();
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return Collections.<String>singletonList(ATTRIBUTE_TYPE);
+ }
+
+ @Override
+ public String getType()
+ {
+ return PROVIDER_TYPE;
+ }
+
+ @Override
+ public Map<String, String> getAttributeDescriptions()
+ {
+ return null;
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
index 67a4f348b1..67a4f348b1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java
index 8b979c324d..8b979c324d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java
index c503549bf2..c503549bf2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManager.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java
new file mode 100644
index 0000000000..3f8449c529
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.util.ResourceBundleLoader;
+
+public class ExternalAuthenticationManagerFactory implements AuthenticationManagerFactory
+{
+ public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.ExternalAuthenticationProviderAttributeDescriptions";
+ public static final String PROVIDER_TYPE = "External";
+ public static final String ATTRIBUTE_USE_FULL_DN = "useFullDN";
+
+ public static final Collection<String> ATTRIBUTES = Collections.<String> unmodifiableList(Arrays.asList(
+ ATTRIBUTE_TYPE,
+ ATTRIBUTE_USE_FULL_DN));
+
+ @Override
+ public AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes)
+ {
+ if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
+ {
+ boolean useFullDN = Boolean.valueOf(String.valueOf(attributes.get(ATTRIBUTE_USE_FULL_DN)));
+
+ return new ExternalAuthenticationManager(useFullDN);
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return ATTRIBUTES;
+ }
+
+ @Override
+ public String getType()
+ {
+ return PROVIDER_TYPE;
+ }
+
+ @Override
+ public Map<String, String> getAttributeDescriptions()
+ {
+ return ResourceBundleLoader.getResources(RESOURCE_BUNDLE);
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties
index 263254e9fe..263254e9fe 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationProviderAttributeDescriptions.properties
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
index 6bbf3ca6f5..6bbf3ca6f5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java
new file mode 100644
index 0000000000..8b86a783a9
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+
+public class KerberosAuthenticationManagerFactory implements AuthenticationManagerFactory
+{
+ public static final String PROVIDER_TYPE = "Kerberos";
+
+ @Override
+ public AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes)
+ {
+ if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
+ {
+ return new KerberosAuthenticationManager();
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return Collections.<String>singletonList(ATTRIBUTE_TYPE);
+ }
+
+ @Override
+ public String getType()
+ {
+ return PROVIDER_TYPE;
+ }
+
+ @Override
+ public Map<String, String> getAttributeDescriptions()
+ {
+ return null;
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties
index e847e90f57..e847e90f57 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PasswordFileAuthenticationProviderAttributeDescriptions.properties
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java
index 5e077cfe79..5e077cfe79 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
index da6464a57e..da6464a57e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
index 903f54dd8e..903f54dd8e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java
new file mode 100644
index 0000000000..0fb8579eff
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java
@@ -0,0 +1,405 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.server.security.auth.manager;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Hashtable;
+
+import javax.naming.AuthenticationException;
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.sasl.AuthorizeCallback;
+import javax.security.sasl.SaslException;
+import javax.security.sasl.SaslServer;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.security.auth.AuthenticationResult;
+import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
+import org.apache.qpid.server.security.auth.UsernamePrincipal;
+import org.apache.qpid.server.security.auth.manager.ldap.AbstractLDAPSSLSocketFactory;
+import org.apache.qpid.server.security.auth.manager.ldap.LDAPSSLSocketFactoryGenerator;
+import org.apache.qpid.server.security.auth.sasl.plain.PlainPasswordCallback;
+import org.apache.qpid.server.security.auth.sasl.plain.PlainSaslServer;
+import org.apache.qpid.server.util.StringUtil;
+import org.apache.qpid.ssl.SSLContextFactory;
+
+public class SimpleLDAPAuthenticationManager implements AuthenticationManager
+{
+ private static final Logger _logger = Logger.getLogger(SimpleLDAPAuthenticationManager.class);
+
+ /**
+ * Environment key to instruct {@link InitialDirContext} to override the socket factory.
+ */
+ private static final String JAVA_NAMING_LDAP_FACTORY_SOCKET = "java.naming.ldap.factory.socket";
+
+ private final String _authManagerName;
+ private final String _providerSearchURL;
+ private final String _providerAuthURL;
+ private final String _searchContext;
+ private final String _searchFilter;
+ private final String _ldapContextFactory;
+
+ /**
+ * Trust store - typically used when the Directory has been secured with a certificate signed by a
+ * private CA (or self-signed certificate).
+ */
+ private final TrustStore _trustStore;
+
+ /**
+ * Dynamically created SSL Socket Factory implementation used in the case where user has specified a trust store.
+ */
+ private Class<? extends SocketFactory> _sslSocketFactoryOverride;
+
+
+ SimpleLDAPAuthenticationManager(String authManagerName, String providerSearchUrl, String providerAuthUrl, String searchContext, String searchFilter, String ldapContextFactory, TrustStore trustStore)
+ {
+ _authManagerName = authManagerName;
+ _providerSearchURL = providerSearchUrl;
+ _providerAuthURL = providerAuthUrl;
+ _searchContext = searchContext;
+ _searchFilter = searchFilter;
+ _ldapContextFactory = ldapContextFactory;
+ _trustStore = trustStore;
+ }
+
+ @Override
+ public void initialise()
+ {
+ _sslSocketFactoryOverride = createSslSocketFactoryOverride();
+
+ validateInitialDirContext();
+ }
+
+ @Override
+ public String getMechanisms()
+ {
+ return PlainSaslServer.MECHANISM;
+ }
+
+ @Override
+ public SaslServer createSaslServer(String mechanism, String localFQDN, Principal externalPrincipal) throws SaslException
+ {
+ if(PlainSaslServer.MECHANISM.equals(mechanism))
+ {
+ return new PlainSaslServer(new SimpleLDAPPlainCallbackHandler());
+ }
+ else
+ {
+ throw new SaslException("Unknown mechanism: " + mechanism);
+ }
+ }
+
+ @Override
+ public AuthenticationResult authenticate(SaslServer server, byte[] response)
+ {
+ try
+ {
+ // Process response from the client
+ byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);
+
+ if (server.isComplete())
+ {
+ String authorizationID = server.getAuthorizationID();
+ _logger.debug("Authenticated as " + authorizationID);
+
+ return new AuthenticationResult(new UsernamePrincipal(authorizationID));
+ }
+ else
+ {
+ return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
+ }
+ }
+ catch (SaslException e)
+ {
+ return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
+ }
+ }
+
+ @Override
+ public AuthenticationResult authenticate(String username, String password)
+ {
+ try
+ {
+ AuthenticationResult result = doLDAPNameAuthentication(getNameFromId(username), password);
+ if(result.getStatus() == AuthenticationStatus.SUCCESS)
+ {
+ //Return a result based on the supplied username rather than the search name
+ return new AuthenticationResult(new UsernamePrincipal(username));
+ }
+ else
+ {
+ return result;
+ }
+ }
+ catch (NamingException e)
+ {
+ return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
+ }
+ }
+
+ private AuthenticationResult doLDAPNameAuthentication(String name, String password)
+ {
+ if(name == null)
+ {
+ //The search didn't return anything, class as not-authenticated before it NPEs below
+ return new AuthenticationResult(AuthenticationStatus.CONTINUE);
+ }
+
+ Hashtable<String, Object> env = createInitialDirContentEnvironment(_providerAuthURL);
+
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, name);
+ env.put(Context.SECURITY_CREDENTIALS, password);
+
+ InitialDirContext ctx = null;
+ try
+ {
+ ctx = createInitialDirContext(env);
+
+ //Authentication succeeded
+ return new AuthenticationResult(new UsernamePrincipal(name));
+ }
+ catch(AuthenticationException ae)
+ {
+ //Authentication failed
+ return new AuthenticationResult(AuthenticationStatus.CONTINUE);
+ }
+ catch (NamingException e)
+ {
+ //Some other failure
+ return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
+ }
+ finally
+ {
+ if(ctx != null)
+ {
+ closeSafely(ctx);
+ }
+ }
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ private Hashtable<String, Object> createInitialDirContentEnvironment(String providerUrl)
+ {
+ Hashtable<String,Object> env = new Hashtable<String,Object>();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, _ldapContextFactory);
+ env.put(Context.PROVIDER_URL, providerUrl);
+ return env;
+ }
+
+ private InitialDirContext createInitialDirContext(Hashtable<String, Object> env) throws NamingException
+ {
+ ClassLoader existingContextClassloader = null;
+
+ boolean isLdaps = ((String)env.get(Context.PROVIDER_URL)).startsWith("ldaps:");
+
+ boolean revertContentClassLoader = false;
+ try
+ {
+ if (isLdaps && _sslSocketFactoryOverride != null)
+ {
+ existingContextClassloader = Thread.currentThread().getContextClassLoader();
+ env.put(JAVA_NAMING_LDAP_FACTORY_SOCKET, _sslSocketFactoryOverride.getName());
+ Thread.currentThread().setContextClassLoader(_sslSocketFactoryOverride.getClassLoader());
+ revertContentClassLoader = true;
+ }
+ return new InitialDirContext(env);
+ }
+ finally
+ {
+ if (revertContentClassLoader)
+ {
+ Thread.currentThread().setContextClassLoader(existingContextClassloader);
+ }
+ }
+ }
+
+ /**
+ * If a trust store has been specified, create a {@link SSLContextFactory} class that is
+ * associated with the {@link SSLContext} generated from that trust store.
+ *
+ * @return generated socket factory class
+ */
+ private Class<? extends SocketFactory> createSslSocketFactoryOverride()
+ {
+ if (_trustStore != null)
+ {
+ String clazzName = new StringUtil().createUniqueJavaName(_authManagerName);
+ SSLContext sslContext = null;
+ try
+ {
+ sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(null, _trustStore.getTrustManagers(), null);
+ }
+ catch (Exception e)
+ {
+ _logger.error("Exception creating SSLContext", e);
+ throw new RuntimeException(e);
+ }
+ Class<? extends AbstractLDAPSSLSocketFactory> clazz = LDAPSSLSocketFactoryGenerator.createSubClass(clazzName, sslContext.getSocketFactory());
+ _logger.debug("Connection to Directory will use custom SSL socket factory : " + clazz);
+ return clazz;
+ }
+
+ return null;
+ }
+
+ private void validateInitialDirContext()
+ {
+ Hashtable<String,Object> env = createInitialDirContentEnvironment(_providerSearchURL);
+ env.put(Context.SECURITY_AUTHENTICATION, "none");
+
+ InitialDirContext ctx = null;
+ try
+ {
+ ctx = createInitialDirContext(env);
+ }
+ catch (NamingException e)
+ {
+ throw new RuntimeException("Unable to establish anonymous connection to the ldap server at " + _providerSearchURL, e);
+ }
+ finally
+ {
+ closeSafely(ctx);
+ }
+ }
+
+
+ private class SimpleLDAPPlainCallbackHandler implements CallbackHandler
+ {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ String name = null;
+ String password = null;
+ AuthenticationResult authenticated = null;
+ for(Callback callback : callbacks)
+ {
+ if (callback instanceof NameCallback)
+ {
+ String id = ((NameCallback) callback).getDefaultName();
+ try
+ {
+ name = getNameFromId(id);
+ }
+ catch (NamingException e)
+ {
+ _logger.warn("SASL Authentication Exception", e);
+ }
+ if(password != null)
+ {
+ authenticated = doLDAPNameAuthentication(name, password);
+ }
+ }
+ else if (callback instanceof PlainPasswordCallback)
+ {
+ password = ((PlainPasswordCallback)callback).getPlainPassword();
+ if(name != null)
+ {
+ authenticated = doLDAPNameAuthentication(name, password);
+ if(authenticated.getStatus()== AuthenticationResult.AuthenticationStatus.SUCCESS)
+ {
+ ((PlainPasswordCallback)callback).setAuthenticated(true);
+ }
+ }
+ }
+ else if (callback instanceof AuthorizeCallback)
+ {
+ ((AuthorizeCallback) callback).setAuthorized(authenticated != null && authenticated.getStatus() == AuthenticationResult.AuthenticationStatus.SUCCESS);
+ }
+ else
+ {
+ throw new UnsupportedCallbackException(callback);
+ }
+ }
+ }
+ }
+
+ private String getNameFromId(String id) throws NamingException
+ {
+ Hashtable<String,Object> env = createInitialDirContentEnvironment(_providerSearchURL);
+
+ env.put(Context.SECURITY_AUTHENTICATION, "none");
+ InitialDirContext ctx = createInitialDirContext(env);
+
+ try
+ {
+ SearchControls searchControls = new SearchControls();
+ searchControls.setReturningAttributes(new String[] {});
+ searchControls.setCountLimit(1l);
+ searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ NamingEnumeration<?> namingEnum = null;
+ String name = null;
+
+ namingEnum = ctx.search(_searchContext, _searchFilter, new String[] { id }, searchControls);
+ if(namingEnum.hasMore())
+ {
+ SearchResult result = (SearchResult) namingEnum.next();
+ name = result.getNameInNamespace();
+ }
+ return name;
+ }
+ finally
+ {
+ closeSafely(ctx);
+ }
+
+ }
+
+ private void closeSafely(InitialDirContext ctx)
+ {
+ try
+ {
+ ctx.close();
+ }
+ catch (Exception e)
+ {
+ _logger.warn("Exception closing InitialDirContext", e);
+ }
+ }
+
+ @Override
+ public void onCreate()
+ {
+ // nothing to do, no external resource is required
+ }
+
+ @Override
+ public void onDelete()
+ {
+ // nothing to do, no external resource is used
+ }
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java
new file mode 100644
index 0000000000..767e675125
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.util.ResourceBundleLoader;
+
+public class SimpleLDAPAuthenticationManagerFactory implements AuthenticationManagerFactory
+{
+ public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationProviderAttributeDescriptions";
+ private static final String DEFAULT_LDAP_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory";
+
+ public static final String PROVIDER_TYPE = "SimpleLDAP";
+
+ public static final String ATTRIBUTE_NAME = "name";
+ public static final String ATTRIBUTE_LDAP_CONTEXT_FACTORY = "ldapContextFactory";
+ public static final String ATTRIBUTE_SEARCH_FILTER = "searchFilter";
+ public static final String ATTRIBUTE_SEARCH_CONTEXT = "searchContext";
+ public static final String ATTRIBUTE_TRUST_STORE = "trustStore";
+ public static final String ATTRIBUTE_PROVIDER_AUTH_URL = "providerAuthUrl";
+ public static final String ATTRIBUTE_PROVIDER_URL = "providerUrl";
+
+ public static final Collection<String> ATTRIBUTES = Collections.<String> unmodifiableList(Arrays.asList(
+ ATTRIBUTE_TYPE,
+ ATTRIBUTE_PROVIDER_URL,
+ ATTRIBUTE_SEARCH_CONTEXT,
+ ATTRIBUTE_SEARCH_FILTER,
+ ATTRIBUTE_TRUST_STORE,
+ ATTRIBUTE_PROVIDER_AUTH_URL,
+ ATTRIBUTE_LDAP_CONTEXT_FACTORY
+ ));
+
+ @Override
+ public AuthenticationManager createInstance(Broker broker, Map<String, Object> attributes)
+ {
+ if (attributes == null || !PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
+ {
+ return null;
+ }
+
+ String name = (String) attributes.get(ATTRIBUTE_NAME);
+ String providerUrl = (String) attributes.get(ATTRIBUTE_PROVIDER_URL);
+ String providerAuthUrl = (String) attributes.get(ATTRIBUTE_PROVIDER_AUTH_URL);
+
+ if (providerAuthUrl == null)
+ {
+ providerAuthUrl = providerUrl;
+ }
+ String searchContext = (String) attributes.get(ATTRIBUTE_SEARCH_CONTEXT);
+ String searchFilter = (String) attributes.get(ATTRIBUTE_SEARCH_FILTER);
+ String ldapContextFactory = (String) attributes.get(ATTRIBUTE_LDAP_CONTEXT_FACTORY);
+ String trustStoreName = (String) attributes.get(ATTRIBUTE_TRUST_STORE);
+ if (ldapContextFactory == null)
+ {
+ ldapContextFactory = DEFAULT_LDAP_CONTEXT_FACTORY;
+ }
+
+ TrustStore trustStore = null;
+ if (trustStoreName != null)
+ {
+ trustStore = broker.findTrustStoreByName(trustStoreName);
+ if (trustStore == null)
+ {
+ throw new IllegalConfigurationException("Can't find truststore with name '" + trustStoreName + "'");
+ }
+ }
+
+ return new SimpleLDAPAuthenticationManager(name, providerUrl, providerAuthUrl, searchContext,
+ searchFilter, ldapContextFactory, trustStore);
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return ATTRIBUTES;
+ }
+
+ @Override
+ public String getType()
+ {
+ return PROVIDER_TYPE;
+ }
+
+ @Override
+ public Map<String, String> getAttributeDescriptions()
+ {
+ return ResourceBundleLoader.getResources(RESOURCE_BUNDLE);
+ }
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties
new file mode 100644
index 0000000000..18e6fb8a4c
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties
@@ -0,0 +1,24 @@
+#
+# 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.
+
+ldapContextFactory= LDAP context factory
+searchFilter=Search filter*
+searchContext=Search context*
+providerAuthUrl=LDAP authentication URL
+providerUrl=LDAP server URL*
+trustStore=Truststore name
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/AbstractLDAPSSLSocketFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/AbstractLDAPSSLSocketFactory.java
new file mode 100644
index 0000000000..3e8b2e210e
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/AbstractLDAPSSLSocketFactory.java
@@ -0,0 +1,117 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager.ldap;
+
+import static org.apache.qpid.server.security.auth.manager.ldap.LDAPSSLSocketFactoryGenerator.getStaticFieldByReflection;
+import static org.apache.qpid.server.security.auth.manager.ldap.LDAPSSLSocketFactoryGenerator.SSL_SOCKET_FACTORY_FIELD;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import javax.net.ssl.SSLSocketFactory;
+
+/**
+ * Abstract base class for all LDAPSSLSocketFactory implementations.
+ * <p>
+ * Concrete implementations of this class are <b>generated dynamically</b> at runtime by
+ * the {@link LDAPSSLSocketFactoryGenerator#createSubClass(String, SSLSocketFactory)} method.
+ * </p>
+ * <p>
+ * Callers will create new instances of the concrete implementations by using the static
+ * <code>#getDefault()</code> method. This will return an instance of the sub-class that is
+ * associated with the {@link SSLSocketFactory}.
+ * </p>
+ * <p>
+ * If callers are passing the sub-class to an API via class-name (i.e. String), the caller
+ * <b>must</b> ensure that the context classloader of the thread to set to the classloader
+ * of sub-class for the duration of the API call(s).
+ * </p>
+ * For more details see {@link LDAPSSLSocketFactoryGenerator}.
+ * </p>
+ */
+public abstract class AbstractLDAPSSLSocketFactory extends SSLSocketFactory
+{
+ /** Socket factory to which this factory will delegate */
+ private final SSLSocketFactory _delegate;
+
+ protected AbstractLDAPSSLSocketFactory()
+ {
+ super();
+ _delegate = getStaticFieldByReflection(getClass(), SSL_SOCKET_FACTORY_FIELD);
+ if (_delegate == null)
+ {
+ throw new IllegalStateException("Delegate cannot be null - static field initialisation problem?");
+ }
+ }
+
+ @Override
+ public String[] getDefaultCipherSuites()
+ {
+ return _delegate.getDefaultCipherSuites();
+ }
+
+ @Override
+ public String[] getSupportedCipherSuites()
+ {
+ return _delegate.getSupportedCipherSuites();
+ }
+
+ @Override
+ public Socket createSocket() throws IOException
+ {
+ return _delegate.createSocket();
+ }
+
+ @Override
+ public Socket createSocket(String host, int port) throws IOException, UnknownHostException
+ {
+ return _delegate.createSocket(host, port);
+ }
+
+ @Override
+ public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException
+ {
+ return _delegate.createSocket(socket, host, port, autoClose);
+ }
+
+ @Override
+ public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
+ throws IOException, UnknownHostException
+ {
+ return _delegate.createSocket(host, port, localHost, localPort);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress host, int port) throws IOException
+ {
+ return _delegate.createSocket(host, port);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
+ {
+ return _delegate.createSocket(address, port, localAddress, localPort);
+ }
+
+
+}
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGenerator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGenerator.java
new file mode 100644
index 0000000000..5cfc8b7a0b
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGenerator.java
@@ -0,0 +1,298 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager.ldap;
+
+import static org.apache.bcel.Constants.ACC_PRIVATE;
+import static org.apache.bcel.Constants.ACC_PUBLIC;
+import static org.apache.bcel.Constants.ACC_STATIC;
+import static org.apache.bcel.Constants.ACC_SUPER;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+
+import org.apache.bcel.Constants;
+import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.generic.ClassGen;
+import org.apache.bcel.generic.ConstantPoolGen;
+import org.apache.bcel.generic.FieldGen;
+import org.apache.bcel.generic.InstructionConstants;
+import org.apache.bcel.generic.InstructionFactory;
+import org.apache.bcel.generic.InstructionList;
+import org.apache.bcel.generic.MethodGen;
+import org.apache.bcel.generic.Type;
+
+/**
+ * This class provides a single method, {@link #createSubClass(String, SSLSocketFactory)}. This creates a
+ * sub-class of {@link AbstractLDAPSSLSocketFactory} and associates it with the {@link SSLSocketFactory} instance..
+ * <p>
+ * The sub-classes are <b>generated dynamically</b>.
+ * </p>
+ * <p>This approach is required in order to overcome a limitation in the javax.naming.directory API. It offers
+ * {@link SSLSocketFactory} customization only at the class level only (via the <code>java.naming.ldap.factory.socket</code>
+ * directory context environment parameter). For this reason, a mechanism that can produce distinct
+ * {@link AbstractLDAPSSLSocketFactory} classes each associated with a different SSLSocketFactory instance is required.
+ * </p>
+ * @see <a href="http://docs.oracle.com/javase/jndi/tutorial/ldap/security/ssl.html">Java LDAP SSL and Custom Sockets</a>
+ */
+public class LDAPSSLSocketFactoryGenerator
+{
+ /**
+ * The name of field used to hold the delegate {@link SSLSocketFactory}. A field with
+ * this name is created on each generated sub-class.
+ */
+ static final String SSL_SOCKET_FACTORY_FIELD = "_sslSocketFactory";
+
+ /** Target package names used for the subclass - needs to exist */
+ static final String TARGET_PACKAGE_NAME = LDAPSSLSocketFactoryGenerator.class.getPackage().getName();
+
+ public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory)
+ {
+ final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName;
+ final byte[] classBytes = createSubClassByteCode(fqcn);
+
+ try
+ {
+ final ClassLoader classLoader = new LDAPSSLSocketFactoryAwareDelegatingClassloader(fqcn, classBytes, sslSocketFactory);
+ Class<? extends AbstractLDAPSSLSocketFactory> clazz = (Class<? extends AbstractLDAPSSLSocketFactory>) classLoader.loadClass(fqcn);
+ return clazz;
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new IllegalArgumentException("Could not resolve dynamically generated class " + fqcn, cnfe);
+ }
+ }
+
+ /**
+ * Creates the LDAPSocketFactoryImpl class (subclass of {@link AbstractLDAPSSLSocketFactory}.
+ * A static method #getDefaulta, a static field _sslContent and no-arg constructor are added
+ * to the class.
+ *
+ * @param className
+ *
+ * @return byte code
+ */
+ private static byte[] createSubClassByteCode(final String className)
+ {
+ ClassGen classGen = new ClassGen(className,
+ AbstractLDAPSSLSocketFactory.class.getName(),
+ "<generated>",
+ ACC_PUBLIC | ACC_SUPER,
+ null);
+ ConstantPoolGen constantPoolGen = classGen.getConstantPool();
+ InstructionFactory factory = new InstructionFactory(classGen);
+
+ createSslContextStaticField(classGen, constantPoolGen);
+ createGetDefaultStaticMethod(classGen, constantPoolGen, factory);
+
+ classGen.addEmptyConstructor(Constants.ACC_PROTECTED);
+
+ JavaClass javaClass = classGen.getJavaClass();
+ ByteArrayOutputStream out = null;
+ try
+ {
+ out = new ByteArrayOutputStream();
+ javaClass.dump(out);
+ return out.toByteArray();
+ }
+ catch (IOException ioex)
+ {
+ throw new IllegalStateException("Could not write to a ByteArrayOutputStream - should not happen", ioex);
+ }
+ finally
+ {
+ closeSafely(out);
+ }
+ }
+
+ /**
+ * Creates a static field _sslContext of type {@link SSLSocketFactory}.
+ *
+ * @param classGen
+ * @param constantPoolGen
+ */
+ private static void createSslContextStaticField(ClassGen classGen, ConstantPoolGen constantPoolGen)
+ {
+ FieldGen fieldGen = new FieldGen(ACC_PRIVATE | ACC_STATIC,
+ Type.getType(SSLSocketFactory.class),
+ SSL_SOCKET_FACTORY_FIELD,
+ constantPoolGen);
+ classGen.addField(fieldGen.getField());
+ }
+
+ /**
+ * Create a static method 'getDefault' returning {@link SocketFactory}
+ * that creates a new instance of the sub-class and calls its no-argument
+ * constructor, the newly created is returned to the caller.
+ *
+ * @param classGen
+ * @param constantPoolGen
+ * @param instructionFactory
+ */
+ private static void createGetDefaultStaticMethod(ClassGen classGen,
+ ConstantPoolGen constantPoolGen, InstructionFactory instructionFactory)
+ {
+ InstructionList il = new InstructionList();
+
+ String methodName = "getDefault";
+ MethodGen mg = new MethodGen(ACC_STATIC | ACC_PUBLIC, // access flags
+ Type.getType(SSLSocketFactory.class), // return type
+ new Type[0], // argument types - no args
+ new String[0], // arg names - no args
+ methodName,
+ classGen.getClassName(), // method, class
+ il,
+ constantPoolGen);
+
+ il.append(instructionFactory.createNew(classGen.getClassName()));
+ il.append(InstructionConstants.DUP);
+
+ il.append(instructionFactory.createInvoke(classGen.getClassName(), "<init>", Type.VOID,
+ new Type[] {},
+ Constants.INVOKESPECIAL));
+
+ il.append(InstructionConstants.ARETURN);
+
+ mg.setMaxStack();
+ classGen.addMethod(mg.getMethod());
+ il.dispose();
+ }
+
+ private static void closeSafely(ByteArrayOutputStream out)
+ {
+ if (out != null)
+ {
+ try
+ {
+ out.close();
+ }
+ catch (IOException e)
+ {
+ // Ignore
+ }
+ }
+ }
+
+ private static void setSslSocketFactoryFieldByReflection(Class<? extends AbstractLDAPSSLSocketFactory> clazz, String fieldName, SSLSocketFactory sslSocketFactory)
+ {
+ String exceptionMessage = "Unexpected error setting generated static field "
+ + fieldName + "on generated class " + clazz.getName();
+ try
+ {
+ Field declaredField = clazz.getDeclaredField(fieldName);
+ boolean accessible = declaredField.isAccessible();
+ try
+ {
+ declaredField.setAccessible(true);
+ declaredField.set(null, sslSocketFactory);
+ }
+ finally
+ {
+ declaredField.setAccessible(accessible);
+ }
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (SecurityException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ }
+
+ static SSLSocketFactory getStaticFieldByReflection(Class<? extends AbstractLDAPSSLSocketFactory> clazz, String fieldName)
+ {
+ String exceptionMessage = "Unexpected error getting generated static field "
+ + fieldName + "on generated class " + clazz.getName();
+
+ Field declaredField;
+ try
+ {
+ declaredField = clazz.getDeclaredField(fieldName);
+ boolean accessible = declaredField.isAccessible();
+ try
+ {
+ declaredField.setAccessible(true);
+ return (SSLSocketFactory) declaredField.get(null);
+ }
+ finally
+ {
+ declaredField.setAccessible(accessible);
+ }
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (SecurityException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(exceptionMessage, e);
+ }
+ }
+
+ private static final class LDAPSSLSocketFactoryAwareDelegatingClassloader extends ClassLoader
+ {
+ private final String _className;
+ private final Class<? extends AbstractLDAPSSLSocketFactory> _clazz;
+
+ private LDAPSSLSocketFactoryAwareDelegatingClassloader(String className,
+ byte[] classBytes, SSLSocketFactory sslSocketFactory)
+ {
+ super(LDAPSSLSocketFactoryGenerator.class.getClassLoader());
+ _className = className;
+ _clazz = (Class<? extends AbstractLDAPSSLSocketFactory>) defineClass(className, classBytes, 0, classBytes.length);
+ setSslSocketFactoryFieldByReflection(_clazz, SSL_SOCKET_FACTORY_FIELD, sslSocketFactory);
+ }
+
+ @Override
+ protected Class<?> findClass(String fqcn) throws ClassNotFoundException
+ {
+ if (fqcn.equals(_className))
+ {
+ return _clazz;
+ }
+ else
+ {
+ return getParent().loadClass(fqcn);
+ }
+ }
+ }
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
index 4cbf5096df..4cbf5096df 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
index f36ef1516c..f36ef1516c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
index 8f8686db88..8f8686db88 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
index a4c4fff42f..a4c4fff42f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
index 3a73f577fe..3a73f577fe 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java
index d10193e743..d10193e743 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java
index 4650234972..4650234972 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/anonymous/AnonymousSaslServerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
index fc324b686a..fc324b686a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
index a2d9fa5e3e..a2d9fa5e3e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
index 4e82940439..4e82940439 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java
index c4c4b4e0cf..c4c4b4e0cf 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java
index e19baaa7c6..e19baaa7c6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java
index 06c9108a73..06c9108a73 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HexServerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
index 70c13233b0..70c13233b0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java
index e1007d91e0..e1007d91e0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/external/ExternalSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
index 05acd3b27f..05acd3b27f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java
index 0ea2f3c92e..0ea2f3c92e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainPasswordCallback.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
index a811806c00..a811806c00 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
index 445e5ef812..445e5ef812 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java
index c66e7fd4e4..c66e7fd4e4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java
index e11a4f83db..e11a4f83db 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java
index 50f08623cd..50f08623cd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupManagerFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties
index 2c2d2ab9e3..2c2d2ab9e3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/FileGroupProviderAttributeDescriptions.properties
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java
index 98c12782d8..98c12782d8 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupDatabase.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupManager.java
index 3fd6dd2800..3fd6dd2800 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java
index a9590bb964..a9590bb964 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupPrincipal.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java
index f382f90010..f382f90010 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java
index 37d87bb628..37d87bb628 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsGatherer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java
index dbe8bf22a0..dbe8bf22a0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractDurableConfiguredObjectRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
index 4a1452d86c..4a1452d86c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java
index 3abf083026..3abf083026 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java
index a3534d3fa5..a3534d3fa5 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfigurationRecoveryHandler.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java
index 44490385d9..44490385d9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecord.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DependencyListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DependencyListener.java
index 120c904cf7..120c904cf7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DependencyListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DependencyListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java
index 7fb80bde96..7fb80bde96 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java
index 6b0748b0c3..6b0748b0c3 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java
index 3a69f802f0..3a69f802f0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreCreator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java
index d311685375..d311685375 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreHelper.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java
index 1d3e4cc672..1d3e4cc672 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStoreUpgrader.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java
index e065728bd3..e065728bd3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfiguredObjectRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/Event.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Event.java
index c681126c11..c681126c11 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/Event.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Event.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventListener.java
index 33ae7b5b24..33ae7b5b24 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventManager.java
index bf3de2611d..bf3de2611d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/EventManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/EventManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/HAMessageStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/HAMessageStore.java
index 59483751ca..59483751ca 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/HAMessageStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/HAMessageStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
index 8eed1fa5a4..8eed1fa5a4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java
index 374a35d10d..374a35d10d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java
index 64f3ab15ee..64f3ab15ee 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageMetaDataTypeRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStore.java
index 996d71d51d..996d71d51d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java
index b0a736c66c..b0a736c66c 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java
index 93b669e6e4..93b669e6e4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java
index a8013b8e9b..a8013b8e9b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java
index ba65b8e1ec..ba65b8e1ec 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreRecoveryHandler.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java
index a671e93b26..a671e93b26 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NonNullUpgrader.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullMessageStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullMessageStore.java
index 57dbfabaa4..57dbfabaa4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullMessageStore.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullMessageStore.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullUpgrader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullUpgrader.java
index c8a812fa89..c8a812fa89 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/NullUpgrader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullUpgrader.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java
index 4ab1a3ab05..4ab1a3ab05 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/State.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/State.java
index 1d0936cec4..1d0936cec4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/State.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/State.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StateManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StateManager.java
index 613b329beb..613b329beb 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StateManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StateManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java
index 9ae6cca8e6..9ae6cca8e6 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StorableMessageMetaData.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreContext.java
index 88cc68bc71..88cc68bc71 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreContext.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreFuture.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreFuture.java
index 7d3bf90a75..7d3bf90a75 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreFuture.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoreFuture.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
index e7302270bb..e7302270bb 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMessage.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMessage.java
index 7909003855..7909003855 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMessage.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StoredMessage.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/Transaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Transaction.java
index ed6b89e373..ed6b89e373 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/Transaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Transaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLog.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLog.java
index da7f8d18b2..da7f8d18b2 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLog.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLog.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java
index bd4da648f9..bd4da648f9 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogRecoveryHandler.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java
index 576dca847d..576dca847d 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/TransactionLogResource.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java
index 98348efbd2..98348efbd2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedDependency.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java
index 7ebebadae7..7ebebadae7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedObject.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java
index c2ea0745ff..c2ea0745ff 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java
index 54978776e7..54978776e7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/jdbc/ConnectionProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java
index efedad1181..efedad1181 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/AssignedSubscriptionMessageGroupManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java
index 632b59d3fa..632b59d3fa 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java
index f38e23b342..f38e23b342 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/DefinedGroupMessageGroupManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java
index 8ce4ce3344..8ce4ce3344 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/MessageGroupManager.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java
index e2ed4104de..e2ed4104de 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/Subscription.java
index 36d49d8279..36d49d8279 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/Subscription.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java
index bf5ce31bd9..bf5ce31bd9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java
index faa4ec592f..faa4ec592f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AlreadyKnownDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java
index 31e4dc6def..31e4dc6def 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AsyncAutoCommitTransaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java
index b081641f47..b081641f47 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/AutoCommitTransaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java
index ab987f0fb9..ab987f0fb9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DistributedTransaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxBranch.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxBranch.java
index fb32b654ce..fb32b654ce 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxBranch.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxBranch.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxException.java
index d18d0cb68b..d18d0cb68b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java
index c1289b1fdd..c1289b1fdd 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxNotSelectedException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java
index 117beb82ef..117beb82ef 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/DtxRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java
index 45f094e4b9..45f094e4b9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/IncorrectDtxStateException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java
index a25e5a4ed6..a25e5a4ed6 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/JoinAndResumeDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java
index 23265199c7..23265199c7 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java
index de070546a7..de070546a7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/NotAssociatedDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java
index 6cf12d8631..6cf12d8631 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/RollbackOnlyDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java
index 8acac00479..8acac00479 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/ServerTransaction.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java
index 228844fd63..228844fd63 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/SuspendAndFailDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java
index 50f7708d8a..50f7708d8a 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/TimeoutDtxException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java
index c23e518365..c23e518365 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/UnknownDtxBranchException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java
index ca9a41bc32..ca9a41bc32 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ByteBufferOutputStream.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java
index 2d9ba38555..2d9ba38555 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapValueConverter.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java
index 37e0177b00..37e0177b00 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/MapValueConverter.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java
index 29bc81caab..29bc81caab 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ParameterizedTypeImpl.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java
index a0ed4e27f4..a0ed4e27f4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/ResourceBundleLoader.java
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java
new file mode 100644
index 0000000000..97e3573fff
--- /dev/null
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/StringUtil.java
@@ -0,0 +1,75 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.util;
+
+import java.util.Random;
+
+import org.apache.commons.codec.digest.DigestUtils;
+
+public class StringUtil
+{
+ private static final String NUMBERS = "0123456789";
+ private static final String LETTERS = "abcdefghijklmnopqrstuvwxwy";
+ private static final String OTHERS = "_-";
+ private static final char[] CHARACTERS = (NUMBERS + LETTERS + LETTERS.toUpperCase() + OTHERS).toCharArray();
+
+ private Random _random = new Random();
+
+ public String randomAlphaNumericString(int maxLength)
+ {
+ char[] result = new char[maxLength];
+ for (int i = 0; i < maxLength; i++)
+ {
+ result[i] = (char) CHARACTERS[_random.nextInt(CHARACTERS.length)];
+ }
+ return new String(result);
+ }
+
+ /**
+ * Builds a legal java name, based on manager name if possible,
+ * this is unique for the given input.
+ *
+ * @param managerName
+ * @return unique java name
+ */
+ public String createUniqueJavaName(String managerName)
+ {
+ StringBuilder builder = new StringBuilder();
+ boolean initialChar = true;
+ for (int i = 0; i < managerName.length(); i++)
+ {
+ char c = managerName.charAt(i);
+ if ((initialChar && Character.isJavaIdentifierStart(c))
+ || (!initialChar && Character.isJavaIdentifierPart(c)))
+ {
+ builder.append(c);
+ initialChar = false;
+ }
+ }
+ if (builder.length() > 0)
+ {
+ builder.append("_");
+ }
+ builder.append(DigestUtils.md5Hex(managerName));
+ return builder.toString();
+ }
+
+}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
index 0cd4f0b6b2..0cd4f0b6b2 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
index a321c285b7..a321c285b7 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java
index 8d05e719ee..8d05e719ee 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java
index f055760efe..f055760efe 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java
index 4be64a3b94..4be64a3b94 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
index 6ad7014c47..6ad7014c47 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java
index 1b0e50fd34..1b0e50fd34 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
index cb7f213f06..cb7f213f06 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java
index 02d628da68..02d628da68 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java
index da4c9825b1..da4c9825b1 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java
index 585f045ad9..585f045ad9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java
index b7e51d88d3..b7e51d88d3 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
index 08f35c08f9..08f35c08f9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/State.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/State.java
index 55e2539dcf..55e2539dcf 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/State.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/State.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java
index 5704126f62..5704126f62 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
index 2ebbedccd4..2ebbedccd4 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
index 39ca3197b4..39ca3197b4 100755
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java
index 626615a59f..626615a59f 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostFactoryRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java
index 8527435eea..8527435eea 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostListener.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
index 483e11942b..483e11942b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java
index 54f7d0d172..54f7d0d172 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/plugins/QueueExistsException.java
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/tools/security/Passwd.java
index cd833c89c4..cd833c89c4 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/tools/security/Passwd.java
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory
index 8ff67030ef..8ff67030ef 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory
index cd314abcae..cd314abcae 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfigurationStoreFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory
index d183d91f18..d183d91f18 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.DurableConfigurationStoreFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType
index 4ad646b7a0..4ad646b7a0 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ExchangeType
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory
index 6bfb55ff18..6bfb55ff18 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.GroupManagerFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
index e0ae6e97cc..e0ae6e97cc 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory
index 9fe8379120..9fe8379120 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.PreferencesProviderFactory
diff --git a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory
index 81217884e4..81217884e4 100644
--- a/qpid/java/broker/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory
+++ b/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.VirtualHostFactory
diff --git a/qpid/java/broker-core/src/main/resources/initial-config.json b/qpid/java/broker-core/src/main/resources/initial-config.json
new file mode 100644
index 0000000000..7173433aa8
--- /dev/null
+++ b/qpid/java/broker-core/src/main/resources/initial-config.json
@@ -0,0 +1,68 @@
+/*
+ *
+ * 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.
+ *
+ */
+{
+ "name": "Broker",
+ "storeVersion": 1,
+ "modelVersion": "1.2",
+ "defaultVirtualHost" : "default",
+ "authenticationproviders" : [ {
+ "name" : "passwordFile",
+ "type" : "PlainPasswordFile",
+ "path" : "${qpid.home_dir}/etc/passwd",
+ "preferencesproviders" : [{
+ "name": "fileSystemPreferences",
+ "type": "FileSystemPreferences",
+ "path" : "${qpid.work_dir}/user.preferences.json"
+ }]
+ } ],
+ "ports" : [ {
+ "name" : "AMQP",
+ "port" : "${qpid.amqp_port}",
+ "authenticationProvider" : "passwordFile"
+ }, {
+ "name" : "HTTP",
+ "port" : "${qpid.http_port}",
+ "authenticationProvider" : "passwordFile",
+ "protocols" : [ "HTTP" ]
+ }, {
+ "name" : "RMI_REGISTRY",
+ "port" : "${qpid.rmi_port}",
+ "protocols" : [ "RMI" ]
+ }, {
+ "name" : "JMX_CONNECTOR",
+ "port" : "${qpid.jmx_port}",
+ "authenticationProvider" : "passwordFile",
+ "protocols" : [ "JMX_RMI" ]
+ }],
+ "virtualhosts" : [ {
+ "name" : "default",
+ "type" : "STANDARD",
+ "storeType" : "DERBY",
+ "storePath" : "${qpid.work_dir}/derbystore/default"
+ } ],
+ "plugins" : [ {
+ "pluginType" : "MANAGEMENT-HTTP",
+ "name" : "httpManagement"
+ }, {
+ "pluginType" : "MANAGEMENT-JMX",
+ "name" : "jmxManagement"
+ } ]
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
index c22fcf4a14..c22fcf4a14 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/SelectorParserTest.java
index 3e0e217eee..3e0e217eee 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/SelectorParserTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java
index 96078d766c..96078d766c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java
index a7772ffd10..a7772ffd10 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreatorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java
index 5e9e19ffaf..5e9e19ffaf 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/BrokerPropertiesTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
new file mode 100644
index 0000000000..96ac92a0f9
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
@@ -0,0 +1,292 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration;
+
+import static org.mockito.Mockito.when;
+
+import java.util.Collections;
+import junit.framework.TestCase;
+import org.apache.commons.configuration.CompositeConfiguration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
+import org.apache.qpid.server.util.BrokerTestHelper;
+
+public class QueueConfigurationTest extends TestCase
+{
+ private VirtualHostConfiguration _emptyConf;
+ private PropertiesConfiguration _env;
+ private VirtualHostConfiguration _fullHostConf;
+ private Broker _broker;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ BrokerTestHelper.setUp();
+ _broker = BrokerTestHelper.createBrokerMock();
+ _env = new PropertiesConfiguration();
+ _emptyConf = new VirtualHostConfiguration("test", _env, _broker);
+
+ PropertiesConfiguration fullEnv = new PropertiesConfiguration();
+ fullEnv.setProperty("queues.maximumMessageAge", 1);
+ fullEnv.setProperty("queues.maximumQueueDepth", 1);
+ fullEnv.setProperty("queues.maximumMessageSize", 1);
+ fullEnv.setProperty("queues.maximumMessageCount", 1);
+ fullEnv.setProperty("queues.minimumAlertRepeatGap", 1);
+ fullEnv.setProperty("queues.deadLetterQueues", true);
+ fullEnv.setProperty("queues.maximumDeliveryCount", 5);
+
+ _fullHostConf = new VirtualHostConfiguration("test", fullEnv, _broker);
+
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ BrokerTestHelper.tearDown();
+ super.tearDown();
+ }
+
+ public void testMaxDeliveryCount() throws Exception
+ {
+ // broker MAXIMUM_DELIVERY_ATTEMPTS attribute is not set
+ when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(null);
+
+ // Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals("Unexpected default server configuration for max delivery count ", 0, qConf.getMaxDeliveryCount());
+
+ // set broker MAXIMUM_DELIVERY_ATTEMPTS attribute to 2
+ when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(2);
+
+ // Check that queue inherits the MAXIMUM_DELIVERY_ATTEMPTS value from broker
+ qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals("Unexpected default server configuration for max delivery count ", 2, qConf.getMaxDeliveryCount());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumDeliveryCount", 7);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals("Unexpected host configuration for max delivery count", 7, qConf.getMaxDeliveryCount());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals("Unexpected queue configuration for max delivery count", 5, qConf.getMaxDeliveryCount());
+ }
+
+ /**
+ * Tests that the default setting for DLQ configuration is disabled, and verifies that it can be overridden
+ * at a broker or virtualhost level.
+ * @throws Exception
+ */
+ public void testIsDeadLetterQueueEnabled() throws Exception
+ {
+ // enable dead letter queues broker wide
+ when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
+
+ // Check that queue inherits the broker setting
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
+
+ // broker DEAD_LETTER_QUEUE_ENABLED is not set
+ when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(null);
+
+ // Check that queue dead letter queue is not enabled
+ qConf = new QueueConfiguration("test", _emptyConf);
+ assertFalse("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("deadLetterQueues", true);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
+ }
+
+ public void testGetMaximumMessageAge() throws ConfigurationException
+ {
+ // Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(0, qConf.getMaximumMessageAge());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageAge", 2);
+
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getMaximumMessageAge());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals(1, qConf.getMaximumMessageAge());
+ }
+
+ public void testGetMaximumQueueDepth() throws ConfigurationException
+ {
+ // Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(0, qConf.getMaximumQueueDepth());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumQueueDepth", 2);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getMaximumQueueDepth());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals(1, qConf.getMaximumQueueDepth());
+ }
+
+ public void testGetMaximumMessageSize() throws ConfigurationException
+ {
+ // Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(0, qConf.getMaximumMessageSize());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageSize", 2);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getMaximumMessageSize());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals(1, qConf.getMaximumMessageSize());
+ }
+
+ public void testGetMaximumMessageCount() throws ConfigurationException
+ {
+ // Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(0, qConf.getMaximumMessageCount());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageCount", 2);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getMaximumMessageCount());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals(1, qConf.getMaximumMessageCount());
+ }
+
+ public void testGetMinimumAlertRepeatGap() throws Exception
+ {
+ // set broker attribute ALERT_REPEAT_GAP to 10
+ when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(10);
+
+ // check that broker level setting is available on queue configuration
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(10, qConf.getMinimumAlertRepeatGap());
+
+ // remove configuration for ALERT_REPEAT_GAP on broker level
+ when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(null);
+
+ // Check default value
+ qConf = new QueueConfiguration("test", _emptyConf);
+ assertEquals(0, qConf.getMinimumAlertRepeatGap());
+
+ // Check explicit value
+ VirtualHostConfiguration vhostConfig = overrideConfiguration("minimumAlertRepeatGap", 2);
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getMinimumAlertRepeatGap());
+
+ // Check inherited value
+ qConf = new QueueConfiguration("test", _fullHostConf);
+ assertEquals(1, qConf.getMinimumAlertRepeatGap());
+ }
+
+ public void testSortQueueConfiguration() throws ConfigurationException
+ {
+ //Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertNull(qConf.getQueueSortKey());
+
+ // Check explicit value
+ final VirtualHostConfiguration vhostConfig = overrideConfiguration("sortKey", "test-sort-key");
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals("test-sort-key", qConf.getQueueSortKey());
+ }
+
+ public void testQueueDescription() throws ConfigurationException
+ {
+ //Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertNull(qConf.getDescription());
+
+ // Check explicit value
+ final VirtualHostConfiguration vhostConfig = overrideConfiguration("description", "mydescription");
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals("mydescription", qConf.getDescription());
+ }
+
+
+ public void testQueueSingleArgument() throws ConfigurationException
+ {
+ //Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertTrue(qConf.getArguments().isEmpty());
+
+ // Check explicit value
+ final VirtualHostConfiguration vhostConfig = overrideConfiguration("argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY + "=mykey");
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(Collections.singletonMap(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"mykey"), qConf.getArguments());
+ }
+
+
+ public void testQueueMultipleArguments() throws ConfigurationException
+ {
+ //Check default value
+ QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+ assertTrue(qConf.getArguments().isEmpty());
+
+
+ PropertiesConfiguration queueConfig = new PropertiesConfiguration();
+ queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY + "=mykey");
+ queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_SHARED_MSG_GROUP + "=1");
+
+ CompositeConfiguration config = new CompositeConfiguration();
+ config.addConfiguration(_fullHostConf.getConfig());
+ config.addConfiguration(queueConfig);
+
+ final VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration("test", config, _broker);;
+ qConf = new QueueConfiguration("test", vhostConfig);
+ assertEquals(2, qConf.getArguments().size());
+ assertEquals("mykey", qConf.getArguments().get(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY));
+ assertEquals("1", qConf.getArguments().get(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP));
+ }
+
+
+ private VirtualHostConfiguration overrideConfiguration(String property, Object value)
+ throws ConfigurationException
+ {
+ PropertiesConfiguration queueConfig = new PropertiesConfiguration();
+ queueConfig.setProperty("queues.queue.test." + property, value);
+
+ CompositeConfiguration config = new CompositeConfiguration();
+ config.addConfiguration(_fullHostConf.getConfig());
+ config.addConfiguration(queueConfig);
+
+ return new VirtualHostConfiguration("test", config, _broker);
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
index dc9ddf7b32..dc9ddf7b32 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java
index 674abbfeb7..674abbfeb7 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/plugins/AbstractConfigurationTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java
new file mode 100644
index 0000000000..ab5147c1e3
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
+import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory;
+import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.test.utils.TestFileUtils;
+
+public class AuthenticationProviderRecovererTest extends QpidTestCase
+{
+ private Broker _broker;
+ private AuthenticationProviderRecoverer _recoverer;
+ private ConfigurationEntryStore _configurationStore;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ BrokerTestHelper.setUp();
+ _broker = BrokerTestHelper.createBrokerMock();
+ QpidServiceLoader<AuthenticationManagerFactory> serviceLoader = new QpidServiceLoader<AuthenticationManagerFactory>();
+ AuthenticationProviderFactory authenticationProviderFactory = new AuthenticationProviderFactory(serviceLoader);
+ StoreConfigurationChangeListener storeChangeListener = mock(StoreConfigurationChangeListener.class);
+ _recoverer = new AuthenticationProviderRecoverer(authenticationProviderFactory, storeChangeListener);
+ _configurationStore = mock(ConfigurationEntryStore.class);
+ }
+
+ public void tearDown() throws Exception
+ {
+ try
+ {
+ BrokerTestHelper.tearDown();
+ }
+ finally
+ {
+ super.tearDown();
+ }
+ }
+
+ public void testRecoverAuthenticationProviderWithPreferencesProvider()
+ {
+ File authenticationProviderFile = TestFileUtils.createTempFile(this, "test-authenticator.txt", "test_user:test_user");
+ try
+ {
+ Map<String, Object> authenticationAttributes = new HashMap<String, Object>();
+ authenticationAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE,
+ PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ authenticationAttributes.put(AuthenticationProvider.NAME, "test-authenticator");
+ authenticationAttributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH,
+ authenticationProviderFile.getAbsolutePath());
+ UUID authenticationId = UUID.randomUUID();
+
+ final PreferencesProviderRecoverer preferencesRecoverer = new PreferencesProviderRecoverer();
+ RecovererProvider recovererProvider = new RecovererProvider()
+ {
+ @Override
+ public ConfiguredObjectRecoverer<? extends ConfiguredObject> getRecoverer(String type)
+ {
+ return preferencesRecoverer;
+ }
+ };
+
+ Map<String, Object> preferencesAttributes = new HashMap<String, Object>();
+ UUID preferencesId = UUID.randomUUID();
+ preferencesAttributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.PROVIDER_TYPE);
+ preferencesAttributes.put(PreferencesProvider.NAME, "test-provider");
+ File file = TestFileUtils.createTempFile(this, ".prefs.json",
+ "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
+ preferencesAttributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
+ ConfigurationEntry preferencesEntry = new ConfigurationEntry(preferencesId, PreferencesProvider.class.getSimpleName(),
+ preferencesAttributes, Collections.<UUID> emptySet(), _configurationStore);
+ when(_configurationStore.getEntry(preferencesId)).thenReturn(preferencesEntry);
+
+ ConfigurationEntry authenticationProviderEntry = new ConfigurationEntry(authenticationId,
+ AuthenticationProvider.class.getSimpleName(), authenticationAttributes, Collections.singleton(preferencesId),
+ _configurationStore);
+ try
+ {
+ AuthenticationProvider authenticationProvider = _recoverer.create(recovererProvider, authenticationProviderEntry,
+ _broker);
+ assertNotNull("Authentication provider was not recovered", authenticationProvider);
+ assertEquals("Unexpected name", "test-authenticator", authenticationProvider.getName());
+ assertEquals("Unexpected id", authenticationId, authenticationProvider.getId());
+ PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
+ assertNotNull("Preferences provider was not recovered", preferencesProvider);
+ assertEquals("Unexpected path", file.getAbsolutePath(),
+ preferencesProvider.getAttribute(FileSystemPreferencesProvider.PATH));
+ }
+ finally
+ {
+ file.delete();
+ }
+ }
+ finally
+ {
+ authenticationProviderFile.delete();
+ }
+ }
+
+}
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
new file mode 100644
index 0000000000..c45f4f72a8
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
@@ -0,0 +1,392 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.startup;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.UUID;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.GroupProvider;
+import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.Plugin;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
+import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
+import org.apache.qpid.server.model.adapter.GroupProviderFactory;
+import org.apache.qpid.server.model.adapter.PortFactory;
+import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+
+public class BrokerRecovererTest extends TestCase
+{
+ private BrokerRecoverer _brokerRecoverer;
+ private ConfigurationEntry _brokerEntry = mock(ConfigurationEntry.class);
+
+ private UUID _brokerId = UUID.randomUUID();
+ private Map<String, Collection<ConfigurationEntry>> _brokerEntryChildren = new HashMap<String, Collection<ConfigurationEntry>>();
+ private ConfigurationEntry _authenticationProviderEntry1;
+ private AuthenticationProvider _authenticationProvider1;
+ private UUID _authenticationProvider1Id = UUID.randomUUID();
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ _brokerRecoverer = new BrokerRecoverer(mock(AuthenticationProviderFactory.class), mock(GroupProviderFactory.class), mock(AccessControlProviderFactory.class), mock(PortFactory.class),
+ mock(StatisticsGatherer.class), mock(VirtualHostRegistry.class), mock(LogRecorder.class), mock(RootMessageLogger.class), mock(TaskExecutor.class), mock(BrokerOptions.class),
+ mock(StoreConfigurationChangeListener.class));
+ when(_brokerEntry.getId()).thenReturn(_brokerId);
+ when(_brokerEntry.getChildren()).thenReturn(_brokerEntryChildren);
+ when(_brokerEntry.getAttributes()).thenReturn(Collections.<String, Object>singletonMap(Broker.MODEL_VERSION, Model.MODEL_VERSION));
+
+ //Add a base AuthenticationProvider for all tests
+ _authenticationProvider1 = mock(AuthenticationProvider.class);
+ when(_authenticationProvider1.getName()).thenReturn("authenticationProvider1");
+ when(_authenticationProvider1.getId()).thenReturn(_authenticationProvider1Id);
+ _authenticationProviderEntry1 = mock(ConfigurationEntry.class);
+ _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1));
+ }
+
+ public void testCreateBrokerAttributes()
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6l);
+ attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5l);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5l);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3l);
+ attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
+ attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
+ attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1l);
+ attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
+ attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
+ attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
+ attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
+ attributes.put(Broker.MODEL_VERSION, Model.MODEL_VERSION);
+
+ Map<String, Object> entryAttributes = new HashMap<String, Object>();
+ for (Map.Entry<String, Object> attribute : attributes.entrySet())
+ {
+ String value = convertToString(attribute.getValue());
+ entryAttributes.put(attribute.getKey(), value);
+ }
+
+ when(_brokerEntry.getAttributes()).thenReturn(entryAttributes);
+
+ final ConfigurationEntry virtualHostEntry = mock(ConfigurationEntry.class);
+ String typeName = VirtualHost.class.getSimpleName();
+ when(virtualHostEntry.getType()).thenReturn(typeName);
+ _brokerEntryChildren.put(typeName, Arrays.asList(virtualHostEntry));
+ final VirtualHost virtualHost = mock(VirtualHost.class);
+ when(virtualHost.getName()).thenReturn("test");
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[] { virtualHostEntry, _authenticationProviderEntry1 },
+ new ConfiguredObject[] { virtualHost, _authenticationProvider1 });
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+
+ for (Map.Entry<String, Object> attribute : attributes.entrySet())
+ {
+ Object attributeValue = broker.getAttribute(attribute.getKey());
+ assertEquals("Unexpected value of attribute '" + attribute.getKey() + "'", attribute.getValue(), attributeValue);
+ }
+ }
+
+ public void testCreateBrokerWithVirtualHost()
+ {
+ final ConfigurationEntry virtualHostEntry = mock(ConfigurationEntry.class);
+
+ String typeName = VirtualHost.class.getSimpleName();
+ when(virtualHostEntry.getType()).thenReturn(typeName);
+ _brokerEntryChildren.put(typeName, Arrays.asList(virtualHostEntry));
+
+ final VirtualHost virtualHost = mock(VirtualHost.class);
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{virtualHostEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{virtualHost, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(1, broker.getVirtualHosts().size());
+ assertEquals(virtualHost, broker.getVirtualHosts().iterator().next());
+ }
+
+ public void testCreateBrokerWithPorts()
+ {
+ ConfigurationEntry portEntry = mock(ConfigurationEntry.class);
+ Port port = mock(Port.class);
+ _brokerEntryChildren.put(Port.class.getSimpleName(), Arrays.asList(portEntry));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{portEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{port, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singletonList(port), broker.getPorts());
+ }
+
+ public void testCreateBrokerWithOneAuthenticationProvider()
+ {
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{_authenticationProviderEntry1},
+ new ConfiguredObject[]{_authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singletonList(_authenticationProvider1), broker.getAuthenticationProviders());
+ }
+
+ public void testCreateBrokerWithMultipleAuthenticationProvidersAndPorts()
+ {
+ //Create a second authentication provider
+ AuthenticationProvider authenticationProvider2 = mock(AuthenticationProvider.class);
+ when(authenticationProvider2.getName()).thenReturn("authenticationProvider2");
+ ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
+ _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));
+
+ //Add a couple ports
+ ConfigurationEntry portEntry1 = mock(ConfigurationEntry.class);
+ Port port1 = mock(Port.class);
+ when(port1.getId()).thenReturn(UUIDGenerator.generateRandomUUID());
+ when(port1.getName()).thenReturn("port1");
+ when(port1.getPort()).thenReturn(5671);
+ when(port1.getAttribute(Port.AUTHENTICATION_PROVIDER)).thenReturn("authenticationProvider1");
+ ConfigurationEntry portEntry2 = mock(ConfigurationEntry.class);
+ Port port2 = mock(Port.class);
+ when(port2.getId()).thenReturn(UUIDGenerator.generateRandomUUID());
+ when(port2.getName()).thenReturn("port2");
+ when(port2.getPort()).thenReturn(5672);
+ when(port2.getAttribute(Port.AUTHENTICATION_PROVIDER)).thenReturn("authenticationProvider2");
+ _brokerEntryChildren.put(Port.class.getSimpleName(), Arrays.asList(portEntry1, portEntry2));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(
+ new ConfigurationEntry[]{portEntry1, portEntry2, authenticationProviderEntry2, _authenticationProviderEntry1},
+ new ConfiguredObject[]{port1, port2, authenticationProvider2, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals("Unexpected number of authentication providers", 2, broker.getAuthenticationProviders().size());
+
+ Collection<Port> ports = broker.getPorts();
+ assertEquals("Unexpected number of ports", 2, ports.size());
+ assertTrue(ports.contains(port1));
+ assertTrue(ports.contains(port2));
+ }
+
+ public void testCreateBrokerWithGroupProvider()
+ {
+ ConfigurationEntry groupProviderEntry = mock(ConfigurationEntry.class);
+ GroupProvider groupProvider = mock(GroupProvider.class);
+ _brokerEntryChildren.put(GroupProvider.class.getSimpleName(), Arrays.asList(groupProviderEntry));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{groupProviderEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{groupProvider, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singletonList(groupProvider), broker.getGroupProviders());
+ }
+
+ public void testCreateBrokerWithPlugins()
+ {
+ ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
+ Plugin plugin = mock(Plugin.class);
+ _brokerEntryChildren.put(Plugin.class.getSimpleName(), Arrays.asList(pluginEntry));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{plugin, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singleton(plugin), new HashSet<ConfiguredObject>(broker.getChildren(Plugin.class)));
+ }
+
+ public void testCreateBrokerWithKeyStores()
+ {
+ ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
+ KeyStore keyStore = mock(KeyStore.class);
+ _brokerEntryChildren.put(KeyStore.class.getSimpleName(), Arrays.asList(pluginEntry));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{keyStore, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singleton(keyStore), new HashSet<ConfiguredObject>(broker.getChildren(KeyStore.class)));
+ }
+
+ public void testCreateBrokerWithTrustStores()
+ {
+ ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
+ TrustStore trustStore = mock(TrustStore.class);
+ _brokerEntryChildren.put(TrustStore.class.getSimpleName(), Arrays.asList(pluginEntry));
+
+ RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
+ new ConfiguredObject[]{trustStore, _authenticationProvider1});
+
+ Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
+
+ assertNotNull(broker);
+ assertEquals(_brokerId, broker.getId());
+ assertEquals(Collections.singleton(trustStore), new HashSet<ConfiguredObject>(broker.getChildren(TrustStore.class)));
+ }
+
+ public void testModelVersionValidationForIncompatibleMajorVersion() throws Exception
+ {
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ String[] incompatibleVersions = {Integer.MAX_VALUE + "." + 0, "0.0"};
+ for (String incompatibleVersion : incompatibleVersions)
+ {
+ brokerAttributes.put(Broker.MODEL_VERSION, incompatibleVersion);
+ when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
+
+ try
+ {
+ _brokerRecoverer.create(null, _brokerEntry);
+ fail("The broker creation should fail due to unsupported model version");
+ }
+ catch (IllegalConfigurationException e)
+ {
+ assertEquals("The model version '" + incompatibleVersion
+ + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'", e.getMessage());
+ }
+ }
+ }
+
+
+ public void testModelVersionValidationForIncompatibleMinorVersion() throws Exception
+ {
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ String incompatibleVersion = Model.MODEL_MAJOR_VERSION + "." + Integer.MAX_VALUE;
+ brokerAttributes.put(Broker.MODEL_VERSION, incompatibleVersion);
+ when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
+
+ try
+ {
+ _brokerRecoverer.create(null, _brokerEntry);
+ fail("The broker creation should fail due to unsupported model version");
+ }
+ catch (IllegalConfigurationException e)
+ {
+ assertEquals("The model version '" + incompatibleVersion
+ + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'", e.getMessage());
+ }
+ }
+
+ public void testIncorrectModelVersion() throws Exception
+ {
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ String[] versions = { Integer.MAX_VALUE + "_" + 0, "", null };
+ for (String modelVersion : versions)
+ {
+ brokerAttributes.put(Broker.MODEL_VERSION, modelVersion);
+ when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
+
+ try
+ {
+ _brokerRecoverer.create(null, _brokerEntry);
+ fail("The broker creation should fail due to unsupported model version");
+ }
+ catch (IllegalConfigurationException e)
+ {
+ // pass
+ }
+ }
+ }
+
+ private String convertToString(Object attributeValue)
+ {
+ return String.valueOf(attributeValue);
+ }
+
+ private RecovererProvider createRecoveryProvider(final ConfigurationEntry[] entries, final ConfiguredObject[] objectsToRecoverer)
+ {
+ RecovererProvider recovererProvider = new RecovererProvider()
+ {
+ @Override
+ public ConfiguredObjectRecoverer<? extends ConfiguredObject> getRecoverer(String type)
+ {
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final ConfiguredObjectRecoverer<? extends ConfiguredObject> recovever = new ConfiguredObjectRecoverer()
+ {
+ @Override
+ public ConfiguredObject create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject... parents)
+ {
+ for (int i = 0; i < entries.length; i++)
+ {
+ ConfigurationEntry e = entries[i];
+ if (entry == e)
+ {
+ return objectsToRecoverer[i];
+ }
+ }
+ return null;
+ }
+ };
+
+ return recovever;
+ }
+ };
+ return recovererProvider;
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java
index 9e2f2fcf32..9e2f2fcf32 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java
index d6f03a9758..d6f03a9758 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/GroupProviderRecovererTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java
index e0a736df89..e0a736df89 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java
index 42fd742407..42fd742407 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PluginRecovererTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java
new file mode 100644
index 0000000000..1fc630dae0
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.configuration.startup;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
+import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.test.utils.TestFileUtils;
+
+/*
+*
+* 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.
+*
+*/
+public class PreferencesProviderRecovererTest extends QpidTestCase
+{
+ private AuthenticationProvider _authenticationProvider;
+ private Broker _broker;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ BrokerTestHelper.setUp();
+ _authenticationProvider = mock(AuthenticationProvider.class);
+ _broker = BrokerTestHelper.createBrokerMock();
+ when(_authenticationProvider.getParent(Broker.class)).thenReturn(_broker);
+ }
+
+ public void tearDown() throws Exception
+ {
+ try
+ {
+ BrokerTestHelper.tearDown();
+ }
+ finally
+ {
+ super.tearDown();
+ }
+ }
+
+ public void testRecoverFileSystemPreferencesProvider()
+ {
+ PreferencesProviderRecoverer recoverer = new PreferencesProviderRecoverer();
+
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ UUID id = UUID.randomUUID();
+ attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.PROVIDER_TYPE);
+ attributes.put(PreferencesProvider.NAME, "test-provider");
+ File file = TestFileUtils.createTempFile(this, ".prefs.json", "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
+ try
+ {
+ attributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
+ ConfigurationEntry entry = new ConfigurationEntry(id, PreferencesProvider.class.getSimpleName(), attributes, Collections.<UUID>emptySet(), mock(ConfigurationEntryStore.class));
+ PreferencesProvider provider = recoverer.create(mock(RecovererProvider.class), entry, _authenticationProvider);
+ assertNotNull("Preferences provider was not recovered", provider);
+ assertEquals("Unexpected name", "test-provider", provider.getName());
+ assertEquals("Unexpected id", id, provider.getId());
+ assertEquals("Unexpected path", file.getAbsolutePath(), provider.getAttribute(FileSystemPreferencesProvider.PATH));
+ }
+ finally
+ {
+ file.delete();
+ }
+ }
+
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java
index 4d92f99306..4d92f99306 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
index f00d12b77d..f00d12b77d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
new file mode 100644
index 0000000000..df7e06e2e6
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
@@ -0,0 +1,437 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.store;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.GroupProvider;
+import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.Transport;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager;
+import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManager;
+import org.apache.qpid.test.utils.QpidTestCase;
+
+public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
+{
+ private ConfigurationEntryStore _store;
+
+ private UUID _brokerId;
+ private UUID _virtualHostId;
+ protected UUID _authenticationProviderId;
+
+ private Map<String, Object> _brokerAttributes;
+ private Map<String, Object> _virtualHostAttributes;
+ private Map<String, Object> _authenticationProviderAttributes;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ _brokerId = UUID.randomUUID();
+ _brokerAttributes = new HashMap<String, Object>();
+ _brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5);
+ _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5);
+ _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3);
+ _brokerAttributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
+ _brokerAttributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
+ _brokerAttributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1);
+ _brokerAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
+ _brokerAttributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
+ _brokerAttributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
+ _brokerAttributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
+
+ _virtualHostId = UUID.randomUUID();
+ _virtualHostAttributes = new HashMap<String, Object>();
+ _virtualHostAttributes.put(VirtualHost.NAME, "test");
+ _virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/test");
+
+ _authenticationProviderId = UUID.randomUUID();
+ _authenticationProviderAttributes = new HashMap<String, Object>();
+ _authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
+ _authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, AnonymousAuthenticationManager.class.getSimpleName());
+
+ _store = createStore(_brokerId, _brokerAttributes);
+ addConfiguration(_virtualHostId, VirtualHost.class.getSimpleName(), _virtualHostAttributes);
+ addConfiguration(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(), _authenticationProviderAttributes);
+ }
+
+ // ??? perhaps it should not be abstract
+ protected abstract ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception;
+
+ protected abstract void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId);
+
+ protected final void addConfiguration(UUID id, String type, Map<String, Object> attributes)
+ {
+ addConfiguration(id, type, attributes, _brokerId);
+ }
+
+ protected ConfigurationEntryStore getStore()
+ {
+ return _store;
+ }
+
+ public void testGetRootEntry()
+ {
+ ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
+ assertNotNull("Root entry does not exist", brokerConfigEntry);
+ assertEquals("Unexpected id", _brokerId, brokerConfigEntry.getId());
+ assertEquals("Unexpected type ", Broker.class.getSimpleName(), brokerConfigEntry.getType());
+ Map<String, Object> attributes = brokerConfigEntry.getAttributes();
+ assertNotNull("Attributes cannot be null", attributes);
+ for (Map.Entry<String, Object> attribute : _brokerAttributes.entrySet())
+ {
+ assertEquals("Unexpected attribute " + attribute.getKey(), attribute.getValue(), attributes.get(attribute.getKey()));
+ }
+ }
+
+ public void testGetEntry()
+ {
+ ConfigurationEntry authenticationProviderConfigEntry = _store.getEntry(_authenticationProviderId);
+ assertNotNull("Provider with id " + _authenticationProviderId + " should exist", authenticationProviderConfigEntry);
+ assertEquals("Unexpected id", _authenticationProviderId, authenticationProviderConfigEntry.getId());
+ assertEquals("Unexpected type ", AuthenticationProvider.class.getSimpleName(), authenticationProviderConfigEntry.getType());
+ Map<String, Object> attributes = authenticationProviderConfigEntry.getAttributes();
+ assertNotNull("Attributes cannot be null", attributes);
+ assertEquals("Unexpected attributes", _authenticationProviderAttributes, attributes);
+ }
+
+ public void testRemove()
+ {
+ Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
+ virtualHostAttributes.put(VirtualHost.NAME, getName());
+ virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config");
+ UUID virtualHostId = UUID.randomUUID();
+ addConfiguration(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes);
+
+ assertNotNull("Virtual host with id " + virtualHostId + " should exist", _store.getEntry(virtualHostId));
+
+ _store.remove(virtualHostId);
+ assertNull("Authentication provider configuration should be removed", _store.getEntry(virtualHostId));
+ }
+
+ public void testRemoveMultipleEntries()
+ {
+ Map<String, Object> virtualHost1Attributes = new HashMap<String, Object>();
+ virtualHost1Attributes.put(VirtualHost.NAME, "test1");
+ virtualHost1Attributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
+ UUID virtualHost1Id = UUID.randomUUID();
+ addConfiguration(virtualHost1Id, VirtualHost.class.getSimpleName(), virtualHost1Attributes);
+
+ Map<String, Object> virtualHost2Attributes = new HashMap<String, Object>();
+ virtualHost2Attributes.put(VirtualHost.NAME, "test1");
+ virtualHost2Attributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config2");
+ UUID virtualHost2Id = UUID.randomUUID();
+ addConfiguration(virtualHost2Id, VirtualHost.class.getSimpleName(), virtualHost2Attributes);
+
+ assertNotNull("Virtual host with id " + virtualHost1Id + " should exist", _store.getEntry(virtualHost1Id));
+ assertNotNull("Virtual host with id " + virtualHost2Id + " should exist", _store.getEntry(virtualHost2Id));
+
+ UUID[] deletedIds = _store.remove(virtualHost1Id, virtualHost2Id);
+ assertNotNull("Unexpected deleted ids", deletedIds);
+ assertEquals("Unexpected id of first deleted virtual host", virtualHost1Id , deletedIds[0]);
+ assertEquals("Unexpected id of second deleted virtual host", virtualHost2Id , deletedIds[1]);
+ assertNull("First virtual host configuration should be removed", _store.getEntry(virtualHost1Id));
+ assertNull("Second virtual host configuration should be removed", _store.getEntry(virtualHost2Id));
+ }
+
+ public void testSaveBroker()
+ {
+ ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 19);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 16);
+ attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 15);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 15);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 13);
+ attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 12);
+ attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, false);
+ attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 11);
+ attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 11000);
+ attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 12000);
+ attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 14000);
+ attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, false);
+ ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(_brokerId, Broker.class.getSimpleName(), attributes,
+ brokerConfigEntry.getChildrenIds(), _store);
+
+ _store.save(updatedBrokerEntry);
+
+ ConfigurationEntry newBrokerConfigEntry = _store.getRootEntry();
+ assertNotNull("Root entry does not exist", newBrokerConfigEntry);
+ assertEquals("Unexpected id", _brokerId, newBrokerConfigEntry.getId());
+ assertEquals("Unexpected type ", Broker.class.getSimpleName(), newBrokerConfigEntry.getType());
+ Map<String, Object> newBrokerattributes = newBrokerConfigEntry.getAttributes();
+ assertNotNull("Attributes cannot be null", newBrokerattributes);
+ assertEquals("Unexpected attributes", attributes, newBrokerattributes);
+ }
+
+ public void testSaveNewVirtualHost()
+ {
+ Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
+ virtualHostAttributes.put(VirtualHost.NAME, "test1");
+ virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
+ UUID virtualHostId = UUID.randomUUID();
+ ConfigurationEntry hostEntry = new ConfigurationEntry(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
+ Collections.<UUID> emptySet(), _store);
+
+ _store.save(hostEntry);
+
+ ConfigurationEntry configurationEntry = _store.getEntry(virtualHostId);
+ assertEquals("Unexpected virtual host configuration", hostEntry, configurationEntry);
+ assertEquals("Unexpected type", VirtualHost.class.getSimpleName(), configurationEntry.getType());
+ assertEquals("Unexpected virtual host attributes", hostEntry.getAttributes(), configurationEntry.getAttributes());
+ assertTrue("Unexpected virtual host children found", hostEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSaveExistingVirtualHost()
+ {
+ ConfigurationEntry hostEntry = _store.getEntry(_virtualHostId);
+ assertNotNull("Host configuration is not found", hostEntry);
+
+ Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
+ virtualHostAttributes.put(VirtualHost.NAME, "test");
+ virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/new/phantom/test/configuration");
+
+ ConfigurationEntry updatedEntry = new ConfigurationEntry(_virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
+ hostEntry.getChildrenIds(), _store);
+ _store.save(updatedEntry);
+
+ ConfigurationEntry newHostEntry = _store.getEntry(_virtualHostId);
+ assertEquals("Unexpected virtual host configuration", updatedEntry, newHostEntry);
+ assertEquals("Unexpected type", VirtualHost.class.getSimpleName(), newHostEntry.getType());
+ assertEquals("Unexpected virtual host attributes", updatedEntry.getAttributes(), newHostEntry.getAttributes());
+ assertEquals("Unexpected virtual host children found", updatedEntry.getChildrenIds(), newHostEntry.getChildrenIds());
+ }
+
+ public void testSaveNewAuthenticationProvider()
+ {
+ UUID authenticationProviderId = UUID.randomUUID();
+ Map<String, Object> authenticationProviderAttributes = new HashMap<String, Object>();
+ authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
+ authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManager.class.getSimpleName());
+ ConfigurationEntry providerEntry = new ConfigurationEntry(authenticationProviderId, AuthenticationProvider.class.getSimpleName(),
+ authenticationProviderAttributes, Collections.<UUID> emptySet(), _store);
+
+ _store.save(providerEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(authenticationProviderId);
+ assertEquals("Unexpected provider configuration", providerEntry, storeEntry);
+ assertEquals("Unexpected type", AuthenticationProvider.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected provider attributes", providerEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSaveExistingAuthenticationProvider()
+ {
+ ConfigurationEntry providerEntry = _store.getEntry(_authenticationProviderId);
+ assertNotNull("provider configuration is not found", providerEntry);
+
+ Map<String, Object> authenticationProviderAttributes = new HashMap<String, Object>();
+ authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
+ authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManager.class.getSimpleName());
+ ConfigurationEntry updatedEntry = new ConfigurationEntry(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(),
+ authenticationProviderAttributes, Collections.<UUID> emptySet(), _store);
+ _store.save(updatedEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(_authenticationProviderId);
+ assertEquals("Unexpected provider configuration", updatedEntry, storeEntry);
+ assertEquals("Unexpected type", AuthenticationProvider.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected provider attributes", updatedEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSaveTrustStore()
+ {
+ UUID trustStoreId = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(TrustStore.NAME, getName());
+ attributes.put(TrustStore.PATH, "/path/to/truststore");
+ attributes.put(TrustStore.PASSWORD, "my-secret-password");
+ attributes.put(TrustStore.TYPE, "NON-JKS");
+ attributes.put(TrustStore.TRUST_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
+ attributes.put(TrustStore.DESCRIPTION, "Description");
+
+ ConfigurationEntry trustStoreEntry = new ConfigurationEntry(trustStoreId, TrustStore.class.getSimpleName(), attributes,
+ Collections.<UUID> emptySet(), _store);
+
+ _store.save(trustStoreEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(trustStoreId);
+ assertEquals("Unexpected trust store configuration", trustStoreEntry, storeEntry);
+ assertEquals("Unexpected type", TrustStore.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected provider attributes", trustStoreEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSaveKeyStore()
+ {
+ UUID keyStoreId = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(KeyStore.NAME, getName());
+ attributes.put(KeyStore.PATH, "/path/to/truststore");
+ attributes.put(KeyStore.PASSWORD, "my-secret-password");
+ attributes.put(KeyStore.TYPE, "NON-JKS");
+ attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
+ attributes.put(KeyStore.DESCRIPTION, "Description");
+ attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");
+
+ ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
+ _store);
+
+ _store.save(keyStoreEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(keyStoreId);
+ assertEquals("Unexpected key store configuration", keyStoreEntry, storeEntry);
+ assertEquals("Unexpected type", KeyStore.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected provider attributes", keyStoreEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSaveGroupProvider()
+ {
+ UUID groupProviderId = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(GroupProvider.NAME, getName());
+
+ ConfigurationEntry groupProviderEntry = new ConfigurationEntry(groupProviderId, GroupProvider.class.getSimpleName(), attributes,
+ Collections.<UUID> emptySet(), _store);
+
+ _store.save(groupProviderEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(groupProviderId);
+ assertEquals("Unexpected group provider configuration", groupProviderEntry, storeEntry);
+ assertEquals("Unexpected type", GroupProvider.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected group provider attributes", groupProviderEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testSavePort()
+ {
+ UUID portId = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ Set<String> tcpTransportSet = Collections.singleton(Transport.TCP.name());
+ attributes.put(Port.PORT, 9999);
+ attributes.put(Port.TRANSPORTS, tcpTransportSet);
+ attributes.put(Port.TCP_NO_DELAY, true);
+ attributes.put(Port.RECEIVE_BUFFER_SIZE, 1);
+ attributes.put(Port.SEND_BUFFER_SIZE, 2);
+ attributes.put(Port.NEED_CLIENT_AUTH, true);
+ attributes.put(Port.WANT_CLIENT_AUTH, true);
+
+ ConfigurationEntry portEntry = new ConfigurationEntry(portId, Port.class.getSimpleName(), attributes, Collections.<UUID> emptySet(), _store);
+
+ _store.save(portEntry);
+
+ ConfigurationEntry storeEntry = _store.getEntry(portId);
+ assertEquals("Unexpected port configuration", portEntry, storeEntry);
+ assertEquals("Unexpected type", Port.class.getSimpleName(), storeEntry.getType());
+ assertEquals("Unexpected port attributes", portEntry.getAttributes(), storeEntry.getAttributes());
+ assertTrue("Unexpected port children found", storeEntry.getChildrenIds().isEmpty());
+ }
+
+ public void testMultipleSave()
+ {
+ UUID virtualHostId = UUID.randomUUID();
+ Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
+ virtualHostAttributes.put(VirtualHost.NAME, "test1");
+ virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
+ ConfigurationEntry hostEntry = new ConfigurationEntry(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
+ Collections.<UUID> emptySet(), _store);
+
+ UUID keyStoreId = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(KeyStore.NAME, getName());
+ attributes.put(KeyStore.PATH, "/path/to/truststore");
+ attributes.put(KeyStore.PASSWORD, "my-secret-password");
+ attributes.put(KeyStore.TYPE, "NON-JKS");
+ attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
+ attributes.put(KeyStore.DESCRIPTION, "Description");
+ attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");
+
+ ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
+ _store);
+
+ _store.save(hostEntry, keyStoreEntry);
+
+ assertNotNull("Virtual host is not found", _store.getEntry(virtualHostId));
+ assertNotNull("Key store is not found", _store.getEntry(keyStoreId));
+ }
+
+ public void testAddPreferencesProvider()
+ {
+ UUID preferencesProviderId = UUID.randomUUID();
+ String path = TMP_FOLDER;
+ String name = getTestName();
+
+ addPreferencesProvider(preferencesProviderId, name, path);
+
+ assertEquals("Unexpected preference provider ID in authentication provider children set", preferencesProviderId, _store
+ .getEntry(_authenticationProviderId).getChildrenIds().iterator().next());
+ ConfigurationEntry preferencesProviderEntry = _store.getEntry(preferencesProviderId);
+ assertNotNull("Preferences providert is not found", preferencesProviderEntry);
+ assertEquals("Unexpected preferences providert id", preferencesProviderId, preferencesProviderEntry.getId());
+ Map<String, Object> attributes = preferencesProviderEntry.getAttributes();
+ assertEquals("Unexpected preferences provider name", name, attributes.get(PreferencesProvider.NAME));
+ assertEquals("Unexpected preferences provider path", path, attributes.get(FileSystemPreferencesProvider.PATH));
+ assertEquals("Unexpected preferences provider type", FileSystemPreferencesProvider.PROVIDER_TYPE,
+ attributes.get(PreferencesProvider.TYPE));
+ }
+
+ protected void addPreferencesProvider(UUID preferencesProviderId, String name, String path)
+ {
+ ConfigurationEntry authenticationProviderEntry = _store.getEntry(_authenticationProviderId);
+ ConfigurationEntry newAuthenticationProviderConfigEntry = new ConfigurationEntry(authenticationProviderEntry.getId(),
+ authenticationProviderEntry.getType(), authenticationProviderEntry.getAttributes(),
+ Collections.<UUID>singleton(preferencesProviderId), _store);
+
+ Map<String, Object> preferencesProviderAttributes = new HashMap<String, Object>();
+ preferencesProviderAttributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.PROVIDER_TYPE);
+ preferencesProviderAttributes.put(FileSystemPreferencesProvider.PATH, path);
+ preferencesProviderAttributes.put(PreferencesProvider.NAME, name);
+
+ ConfigurationEntry preferencesProviderEntry = new ConfigurationEntry(preferencesProviderId, PreferencesProvider.class.getSimpleName(),
+ preferencesProviderAttributes, Collections.<UUID> emptySet(), _store);
+
+ _store.save(newAuthenticationProviderConfigEntry, preferencesProviderEntry);
+ }
+
+}
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java
new file mode 100644
index 0000000000..54c8592c2b
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java
@@ -0,0 +1,268 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.store;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
+import org.apache.qpid.test.utils.TestFileUtils;
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+
+public class JsonConfigurationEntryStoreTest extends ConfigurationEntryStoreTestCase
+{
+ private File _storeFile;
+ private ObjectMapper _objectMapper;
+
+
+ @Override
+ public void setUp() throws Exception
+ {
+ _objectMapper = new ObjectMapper();
+ _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ _storeFile.delete();
+ super.tearDown();
+ }
+
+ @Override
+ protected ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception
+ {
+ _storeFile = createStoreFile(brokerId, brokerAttributes);
+ JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
+ return store;
+ }
+
+ private File createStoreFile(UUID brokerId, Map<String, Object> brokerAttributes) throws IOException,
+ JsonGenerationException, JsonMappingException
+ {
+ return createStoreFile(brokerId, brokerAttributes, true);
+ }
+
+ private File createStoreFile(UUID brokerId, Map<String, Object> brokerAttributes, boolean setVersion) throws IOException,
+ JsonGenerationException, JsonMappingException
+ {
+ Map<String, Object> brokerObjectMap = new HashMap<String, Object>();
+ brokerObjectMap.put(Broker.ID, brokerId);
+ if (setVersion)
+ {
+ brokerObjectMap.put(Broker.STORE_VERSION, MemoryConfigurationEntryStore.STORE_VERSION);
+ }
+ brokerObjectMap.put(Broker.NAME, getTestName());
+ brokerObjectMap.putAll(brokerAttributes);
+
+ StringWriter sw = new StringWriter();
+ _objectMapper.writeValue(sw, brokerObjectMap);
+
+ String brokerJson = sw.toString();
+
+ return TestFileUtils.createTempFile(this, ".json", brokerJson);
+ }
+
+ @Override
+ protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
+ {
+ ConfigurationEntryStore store = getStore();
+ ConfigurationEntry parentEntry = getStore().getEntry(parentId);
+ Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
+ children.add(id);
+ ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
+ store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
+ }
+
+ public void testAttributeIsResolvedFromSystemProperties()
+ {
+ String defaultVhost = getTestName();
+ setTestSystemProperty("my.test.property", defaultVhost);
+
+ ConfigurationEntryStore store = getStore();
+ ConfigurationEntry brokerConfigEntry = store.getRootEntry();
+ Map<String, Object> attributes = new HashMap<String, Object>(brokerConfigEntry.getAttributes());
+ attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "${my.test.property}");
+ ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(brokerConfigEntry.getId(), Broker.class.getSimpleName(),
+ attributes, brokerConfigEntry.getChildrenIds(), store);
+ store.save(updatedBrokerEntry);
+
+ JsonConfigurationEntryStore store2 = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
+
+ assertEquals("Unresolved default virtualhost value", defaultVhost, store2.getRootEntry().getAttributes().get(Broker.DEFAULT_VIRTUAL_HOST));
+ }
+
+ public void testCreateEmptyStore()
+ {
+ File file = TestFileUtils.createTempFile(this, ".json");
+ try
+ {
+ new JsonConfigurationEntryStore(file.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
+ fail("Cannot create a new store without initial store");
+ }
+ catch(IllegalConfigurationException e)
+ {
+ // pass
+ }
+ }
+
+ public void testCreateFromExistingLocation() throws Exception
+ {
+ UUID brokerId = UUID.randomUUID();
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ brokerAttributes.put(Broker.NAME, getTestName());
+ File file = createStoreFile(brokerId, brokerAttributes);
+
+ JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(file.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
+ ConfigurationEntry root = store.getRootEntry();
+ assertNotNull("Root entry is not found", root);
+ assertEquals("Unexpected root entry", brokerId, root.getId());
+ Map<String, Object> attributes = root.getAttributes();
+ assertNotNull("Attributes not found", attributes);
+ assertEquals("Unexpected number of attriburtes", 2, attributes.size());
+ assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
+ assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION));
+ }
+
+ public void testCreateFromInitialStore() throws Exception
+ {
+ UUID brokerId = UUID.randomUUID();
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ File initialStoreFile = createStoreFile(brokerId, brokerAttributes);
+
+ JsonConfigurationEntryStore initialStore = new JsonConfigurationEntryStore(initialStoreFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
+
+ File storeFile = TestFileUtils.createTempFile(this, ".json");
+ JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), initialStore, false, Collections.<String,String>emptyMap());
+
+ ConfigurationEntry root = store.getRootEntry();
+ assertNotNull("Root entry is not found", root);
+ assertEquals("Unexpected root entry", brokerId, root.getId());
+ Map<String, Object> attributes = root.getAttributes();
+ assertNotNull("Attributes not found", attributes);
+ assertEquals("Unexpected number of attriburtes", 2, attributes.size());
+ assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
+ assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION));
+ }
+
+ public void testGetVersion()
+ {
+ assertEquals("Unexpected version", 1, getStore().getVersion());
+ }
+
+ public void testGetType()
+ {
+ assertEquals("Unexpected type", "json", getStore().getType());
+ }
+
+ public void testUnsupportedStoreVersion() throws Exception
+ {
+ UUID brokerId = UUID.randomUUID();
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ int[] storeVersions = {Integer.MAX_VALUE, 0};
+ for (int storeVersion : storeVersions)
+ {
+ brokerAttributes.put(Broker.STORE_VERSION, storeVersion);
+ File storeFile = null;
+ try
+ {
+ storeFile = createStoreFile(brokerId, brokerAttributes);
+ new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), null, false, Collections.<String, String>emptyMap());
+ fail("The store creation should fail due to unsupported store version");
+ }
+ catch (IllegalConfigurationException e)
+ {
+ assertEquals("The data of version " + storeVersion
+ + " can not be loaded by store of version " + MemoryConfigurationEntryStore.STORE_VERSION, e.getMessage());
+ }
+ finally
+ {
+ if (storeFile != null)
+ {
+ storeFile.delete();
+ }
+ }
+ }
+ }
+
+ public void testStoreVersionNotSpecified() throws Exception
+ {
+ UUID brokerId = UUID.randomUUID();
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ File storeFile = null;
+ try
+ {
+ storeFile = createStoreFile(brokerId, brokerAttributes, false);
+ new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), null, false, Collections.<String, String>emptyMap());
+ fail("The store creation should fail due to unspecified store version");
+ }
+ catch (IllegalConfigurationException e)
+ {
+ assertEquals("Broker " + Broker.STORE_VERSION + " attribute must be specified", e.getMessage());
+ }
+ finally
+ {
+ if (storeFile != null)
+ {
+ storeFile.delete();
+ }
+ }
+ }
+
+ public void testGetPreferencesProvider() throws Exception
+ {
+ UUID preferencesProviderId = UUID.randomUUID();
+ String path = TMP_FOLDER;
+ String name = getTestName();
+
+ addPreferencesProvider(preferencesProviderId, name, path);
+
+ // verify that store can deserialise child of a child
+ JsonConfigurationEntryStore newStore = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String, String>emptyMap());
+
+ ConfigurationEntry authenticationProviderEntry = newStore.getEntry(_authenticationProviderId);
+ assertEquals("Unexpected preference provider ID in authentication provider children set", preferencesProviderId, authenticationProviderEntry.getChildrenIds().iterator().next());
+ ConfigurationEntry preferencesProviderEntry = newStore.getEntry(preferencesProviderId);
+ assertNotNull("Preferences providert is not found", preferencesProviderEntry);
+ assertEquals("Unexpected preferences providert id", preferencesProviderId, preferencesProviderEntry.getId());
+ Map<String, Object> attributes = preferencesProviderEntry.getAttributes();
+ assertEquals("Unexpected preferences provider name", name, attributes.get(PreferencesProvider.NAME));
+ assertEquals("Unexpected preferences provider path", path, attributes.get(FileSystemPreferencesProvider.PATH));
+ assertEquals("Unexpected preferences provider type", FileSystemPreferencesProvider.PROVIDER_TYPE,
+ attributes.get(PreferencesProvider.TYPE));
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
index 34b4fbf1ab..34b4fbf1ab 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java
new file mode 100644
index 0000000000..ffb084f767
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.configuration.store;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryStore;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.Broker;
+import org.codehaus.jackson.map.ObjectMapper;
+
+public class MemoryConfigurationEntryStoreTest extends ConfigurationEntryStoreTestCase
+{
+
+ @Override
+ protected ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception
+ {
+ Map<String, Object> broker = new HashMap<String, Object>();
+ broker.put(Broker.ID, brokerId);
+ broker.putAll(brokerAttributes);
+ ObjectMapper mapper = new ObjectMapper();
+
+ return new MemoryConfigurationEntryStore(mapper.writeValueAsString(broker), Collections.<String,String>emptyMap());
+ }
+
+ @Override
+ protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
+ {
+ ConfigurationEntryStore store = getStore();
+ ConfigurationEntry parentEntry = getStore().getEntry(parentId);
+ Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
+ children.add(id);
+ ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
+ store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
+ }
+
+ public void testCreateWithNullLocationAndNullInitialStore()
+ {
+ try
+ {
+ new MemoryConfigurationEntryStore(null, null, Collections.<String,String>emptyMap());
+ fail("Cannot create a memory store without either initial store or path to an initial store file");
+ }
+ catch(IllegalConfigurationException e)
+ {
+ // pass
+ }
+ }
+
+ public void testCreateWithNullJson()
+ {
+ MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, Collections.<String,String>emptyMap());
+
+ ConfigurationEntry root = store.getRootEntry();
+ assertNotNull("Root entry is not found", root);
+ }
+
+ public void testOpenInMemoryWithInitialStore() throws Exception
+ {
+ UUID brokerId = UUID.randomUUID();
+ Map<String, Object> brokerAttributes = new HashMap<String, Object>();
+ brokerAttributes.put(Broker.NAME, getTestName());
+ MemoryConfigurationEntryStore initialStoreFile = (MemoryConfigurationEntryStore)createStore(brokerId, brokerAttributes);
+ MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, initialStoreFile, Collections.<String,String>emptyMap());
+
+ ConfigurationEntry root = store.getRootEntry();
+ assertNotNull("Root entry is not found", root);
+ assertEquals("Unexpected root entry", brokerId, root.getId());
+ Map<String, Object> attributes = root.getAttributes();
+ assertNotNull("Attributes not found", attributes);
+ assertEquals("Unexpected number of attriburtes", 1, attributes.size());
+ assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
+ }
+
+
+ public void testOpenWithDefaultInitialStore() throws Exception
+ {
+ // check whether QPID_HOME JVM system property is set
+ if (QPID_HOME == null)
+ {
+ // set the properties in order to resolve the defaults store settings
+ setTestSystemProperty("QPID_HOME", TMP_FOLDER);
+ setTestSystemProperty("QPID_WORK", TMP_FOLDER + File.separator + "work");
+ }
+ MemoryConfigurationEntryStore initialStore = new MemoryConfigurationEntryStore(BrokerOptions.DEFAULT_INITIAL_CONFIG_LOCATION, null, new BrokerOptions().getConfigProperties());
+ ConfigurationEntry initialStoreRoot = initialStore.getRootEntry();
+ assertNotNull("Initial store root entry is not found", initialStoreRoot);
+
+ MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, initialStore, Collections.<String,String>emptyMap());
+
+ ConfigurationEntry root = store.getRootEntry();
+ assertNotNull("Root entry is not found", root);
+
+ assertEquals("Unexpected broker attributes", initialStoreRoot.getAttributes(), root.getAttributes());
+ assertEquals("Unexpected broker children", initialStoreRoot.getChildrenIds(), root.getChildrenIds());
+ }
+
+ public void testGetVersion()
+ {
+ assertEquals("Unexpected version", 1, getStore().getVersion());
+ }
+
+ public void testGetType()
+ {
+ assertEquals("Unexpected type", "memory", getStore().getType());
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
index c23c4715e8..c23c4715e8 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java
index cd6302d55b..cd6302d55b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
index 86ae3e6e9c..86ae3e6e9c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
index 7335d43b2e..7335d43b2e 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
index 833df34fd8..833df34fd8 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
index 0f1ab65244..0f1ab65244 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
index a84f5e1ecb..a84f5e1ecb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java
index 91002edfc6..91002edfc6 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/filter/JMSSelectorFilterTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java
index e2a6a56ee2..e2a6a56ee2 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/Log4jMessageLoggerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java
index b0cb0ca0ab..b0cb0ca0ab 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java
index be31f3d039..be31f3d039 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLogger.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java
index e2e112be8f..e2e112be8f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/UnitTestMessageLoggerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java
index 41b42fac78..41b42fac78 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
index d1cf256563..d1cf256563 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java
index bf38bb64bf..bf38bb64bf 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AbstractManagementActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java
index 30c3a51604..30c3a51604 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java
index 1cb6474e41..1cb6474e41 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
index 701ccaab47..701ccaab47 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java
index 905de4b639..905de4b639 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/HttpManagementActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java
index a0bfa592db..a0bfa592db 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java
index 55153b7389..55153b7389 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java
index 92915e7092..92915e7092 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java
index 30f4e16e42..30f4e16e42 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml
index 62ec877d3d..62ec877d3d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingFacadeTest.log4j.xml
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java
index 72b34868ba..72b34868ba 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacadeTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
index 229d75c69f..229d75c69f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java
index 22de8349c6..22de8349c6 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java
index 6571d20711..6571d20711 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java
index 2f1276508c..2f1276508c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java
index b2951ae54a..b2951ae54a 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java
index f1452b8b88..f1452b8b88 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
index dfc9357402..dfc9357402 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
index 3377573b9d..3377573b9d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java
index d51e6a6bb7..d51e6a6bb7 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java
index b2bc351f8f..b2bc351f8f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java
index 17d68ef7c3..17d68ef7c3 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
index cd8f13d52e..cd8f13d52e 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java
index e52ead451e..e52ead451e 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java
index a3d96c6d12..a3d96c6d12 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java
index e9a9317102..e9a9317102 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java
index b327738797..b327738797 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
index 3d43ef0f44..3d43ef0f44 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java
index e2765f338b..e2765f338b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
index b9efac1ae8..b9efac1ae8 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java
index 7684db0b3d..7684db0b3d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java
index 72cf09585c..72cf09585c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectStateTransitionTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java
index c686a24e99..c686a24e99 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/UUIDGeneratorTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
new file mode 100644
index 0000000000..7d8dd67f93
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
@@ -0,0 +1,170 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.RecovererProvider;
+import org.apache.qpid.server.configuration.startup.VirtualHostRecoverer;
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.SystemOutMessageLogger;
+import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.logging.actors.TestLogActor;
+import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
+import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
+import org.apache.qpid.test.utils.QpidTestCase;
+
+public class VirtualHostTest extends QpidTestCase
+{
+
+ private Broker _broker;
+ private StatisticsGatherer _statisticsGatherer;
+ private RecovererProvider _recovererProvider;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ CurrentActor.set(new TestLogActor(new SystemOutMessageLogger()));
+
+ _broker = BrokerTestHelper.createBrokerMock();
+ TaskExecutor taslExecutor = mock(TaskExecutor.class);
+ when(taslExecutor.isTaskExecutorThread()).thenReturn(true);
+ when(_broker.getTaskExecutor()).thenReturn(taslExecutor);
+
+ _recovererProvider = mock(RecovererProvider.class);
+ _statisticsGatherer = mock(StatisticsGatherer.class);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ CurrentActor.remove();
+ }
+
+ public void testInitialisingState()
+ {
+ VirtualHost host = createHost();
+
+ assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
+ }
+
+ public void testActiveState()
+ {
+ VirtualHost host = createHost();
+
+ host.setDesiredState(State.INITIALISING, State.ACTIVE);
+ assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
+ }
+
+ public void testQuiescedState()
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(VirtualHost.NAME, getName());
+ attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
+ attributes.put(VirtualHost.STORE_TYPE, TestMemoryMessageStore.TYPE);
+ attributes.put(VirtualHost.STATE, State.QUIESCED);
+
+ VirtualHost host = createHost(attributes);
+
+ assertEquals("Unexpected state", State.QUIESCED, host.getAttribute(VirtualHost.STATE));
+
+ host.setDesiredState(State.QUIESCED, State.ACTIVE);
+ assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
+ }
+
+ public void testStoppedState()
+ {
+ VirtualHost host = createHost();
+
+ assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
+
+ host.setDesiredState(State.INITIALISING, State.ACTIVE);
+ assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
+
+ host.setDesiredState(State.ACTIVE, State.STOPPED);
+ assertEquals("Unexpected state", State.STOPPED, host.getAttribute(VirtualHost.STATE));
+ }
+
+ public void testDeletedState()
+ {
+ VirtualHost host = createHost();
+
+ assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
+
+ host.setDesiredState(State.INITIALISING, State.DELETED);
+ assertEquals("Unexpected state", State.DELETED, host.getAttribute(VirtualHost.STATE));
+ }
+
+ public void testCreateQueueChildHavingMessageGrouppingAttributes()
+ {
+ VirtualHost host = createHost();
+ host.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ String queueName = getTestName();
+ Map<String, Object> arguments = new HashMap<String, Object>();
+ arguments.put(Queue.MESSAGE_GROUP_KEY, "mykey");
+ arguments.put(Queue.MESSAGE_GROUP_SHARED_GROUPS, true);
+ arguments.put(Queue.NAME, queueName);
+
+ host.createChild(Queue.class, arguments);
+
+ Queue queue = ConfiguredObjectFinder.findConfiguredObjectByName(host.getQueues(), queueName);
+ Object messageGroupKey = queue.getAttribute(Queue.MESSAGE_GROUP_KEY);
+ assertEquals("Unexpected message group key attribute", "mykey", messageGroupKey);
+
+ Object sharedGroups = queue.getAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS);
+ assertEquals("Unexpected shared groups attribute", true, sharedGroups);
+
+ }
+
+ private VirtualHost createHost()
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(VirtualHost.NAME, getName());
+ attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
+ attributes.put(VirtualHost.STORE_TYPE, TestMemoryMessageStore.TYPE);
+
+ VirtualHost host = createHost(attributes);
+ return host;
+ }
+
+ private VirtualHost createHost(Map<String, Object> attributes)
+ {
+ ConfigurationEntry entry = new ConfigurationEntry(UUID.randomUUID(), VirtualHost.class.getSimpleName(), attributes,
+ Collections.<UUID> emptySet(), null);
+
+ return new VirtualHostRecoverer(_statisticsGatherer).create(_recovererProvider, entry, _broker);
+ }
+
+}
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java
new file mode 100644
index 0000000000..59eaf96ec3
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java
@@ -0,0 +1,155 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.never;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
+
+public class AuthenticationProviderFactoryTest extends TestCase
+{
+
+ public void testCreatePasswordCredentialManagingAuthenticationProvider()
+ {
+ AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
+ AuthenticationProvider provider = testForFactory(am, true);
+ assertTrue("The created provider should match the factory's AuthenticationManager type",
+ provider instanceof PasswordCredentialManagingAuthenticationProvider);
+ verify(am).onCreate();
+ }
+
+ public void testCreateNonPasswordCredentialManagingAuthenticationProvider()
+ {
+ AuthenticationManager am = mock(AuthenticationManager.class);
+ AuthenticationProvider provider = testForFactory(am, true);
+ assertFalse("The created provider should match the factory's AuthenticationManager type",
+ provider instanceof PasswordCredentialManagingAuthenticationProvider);
+ verify(am).onCreate();
+ }
+
+ public void testRecoverPasswordCredentialManagingAuthenticationProvider()
+ {
+ AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
+ AuthenticationProvider provider = testForFactory(am, false);
+ assertTrue("The created provider should match the factory's AuthenticationManager type",
+ provider instanceof PasswordCredentialManagingAuthenticationProvider);
+ verify(am, never()).onCreate();
+ }
+
+ public void testRecoverNonPasswordCredentialManagingAuthenticationProvider()
+ {
+ AuthenticationManager am = mock(AuthenticationManager.class);
+ AuthenticationProvider provider = testForFactory(am, false);
+ assertFalse("The created provider should match the factory's AuthenticationManager type",
+ provider instanceof PasswordCredentialManagingAuthenticationProvider);
+ verify(am, never()).onCreate();
+ }
+
+ @SuppressWarnings("unchecked")
+ private AuthenticationProvider testForFactory(AuthenticationManager authenticationManager, boolean create)
+ {
+ UUID id = UUID.randomUUID();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ QpidServiceLoader<AuthenticationManagerFactory> authManagerFactoryServiceLoader = mock(QpidServiceLoader.class);
+ AuthenticationManagerFactory authenticationManagerFactory = mock(AuthenticationManagerFactory.class);
+
+ Broker broker = mock(Broker.class);
+
+ when(authManagerFactoryServiceLoader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(
+ Collections.singleton(authenticationManagerFactory));
+ when(authenticationManagerFactory.createInstance(broker, attributes)).thenReturn(authenticationManager);
+
+ AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(authManagerFactoryServiceLoader);
+
+ AuthenticationProvider provider = null;
+ if (create)
+ {
+ provider = providerFactory.create(id, broker, attributes);
+ }
+ else
+ {
+ provider = providerFactory.recover(id, attributes, broker);
+ }
+
+ assertNotNull("Provider is not created", provider);
+ assertEquals("Unexpected ID", id, provider.getId());
+
+ return provider;
+ }
+
+ public void testCreatePasswordCredentialManagingAuthenticationProviderFailsWhenAnotherOneAlready()
+ {
+ Broker broker = mock(Broker.class);
+ PasswordCredentialManagingAuthenticationProvider anotherProvider = mock(PasswordCredentialManagingAuthenticationProvider.class);
+ when(broker.getAuthenticationProviders()).thenReturn(Collections.<AuthenticationProvider>singleton(anotherProvider));
+
+ QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
+ AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
+ when(managerFactory.createInstance(any(Broker.class), any(Map.class))).thenReturn(mock(PrincipalDatabaseAuthenticationManager.class));
+ when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));
+
+ AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader);
+
+ UUID randomUUID = UUID.randomUUID();
+ AuthenticationProvider provider = providerFactory.create(randomUUID, broker, new HashMap<String, Object>());
+
+ assertNotNull("Provider is not created", provider);
+ assertEquals("Unexpected ID", randomUUID, provider.getId());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void testCreateNonPasswordCredentialManagingAuthenticationProviderWhenAnotherOneAlreadyExist()
+ {
+ Broker broker = mock(Broker.class);
+ AuthenticationProvider anotherProvider = mock(AuthenticationProvider.class);
+ when(broker.getAuthenticationProviders()).thenReturn(Collections.singleton(anotherProvider));
+
+ QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
+ AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
+ when(managerFactory.createInstance(any(Broker.class), any(Map.class))).thenReturn(mock(AuthenticationManager.class));
+ when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));
+
+ AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader);
+ UUID id = UUID.randomUUID();
+ AuthenticationProvider provider = providerFactory.create(id, broker, new HashMap<String, Object>());
+
+ assertNotNull("Provider is not created", provider);
+ assertEquals("Unexpected ID", id, provider.getId());
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java
index 64dfad94c3..64dfad94c3 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java
new file mode 100644
index 0000000000..8b0847e0d2
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java
@@ -0,0 +1,301 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.adapter;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.test.utils.TestFileUtils;
+
+public class FileSystemPreferencesProviderTest extends QpidTestCase
+{
+ private static final String TEST_PREFERENCES = "{\"user1\":{\"pref1\":\"pref1User1Value\", \"pref2\": true, \"pref3\": 1.0, \"pref4\": 2},"
+ + "\"user2\":{\"pref1\":\"pref1User2Value\", \"pref2\": false, \"pref3\": 2.0, \"pref4\": 3}}";
+ private FileSystemPreferencesProvider _preferencesProvider;
+ private AuthenticationProvider _authenticationProvider;
+ private Broker _broker;
+ private String _user1, _user2;
+ private File _preferencesFile;
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ BrokerTestHelper.setUp();
+ _authenticationProvider = mock(AuthenticationProvider.class);
+ _user1 = "user1";
+ _user2 = "user2";
+ _preferencesFile = TestFileUtils.createTempFile(this, ".prefs.json", TEST_PREFERENCES);
+
+ _broker = BrokerTestHelper.createBrokerMock();
+ TaskExecutor taslExecutor = mock(TaskExecutor.class);
+ when(taslExecutor.isTaskExecutorThread()).thenReturn(true);
+ when(_broker.getTaskExecutor()).thenReturn(taslExecutor);
+ when(_authenticationProvider.getParent(Broker.class)).thenReturn(_broker);
+ }
+
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ if (_preferencesProvider != null)
+ {
+ _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.DELETED);
+ }
+ BrokerTestHelper.tearDown();
+ _preferencesFile.delete();
+ }
+ finally
+ {
+ super.tearDown();
+ }
+ }
+
+ public void testConstructionWithExistingFile()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
+ }
+
+ public void testConstructionWithNonExistingFile()
+ {
+ File nonExistingFile = new File(TMP_FOLDER, "preferences-" + getTestName() + ".json");
+ assertFalse("Preferences file exists", nonExistingFile.exists());
+ try
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(FileSystemPreferencesProvider.PATH, nonExistingFile.getAbsolutePath());
+ _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
+ _preferencesProvider.createStoreIfNotExist();
+ assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
+ assertTrue("Preferences file was not created", nonExistingFile.exists());
+ }
+ finally
+ {
+ nonExistingFile.delete();
+ }
+ }
+
+ public void testConstructionWithEmptyFile() throws Exception
+ {
+ File emptyPrefsFile = new File(TMP_FOLDER, "preferences-" + getTestName() + ".json");
+ emptyPrefsFile.createNewFile();
+ assertTrue("Preferences file does notexists", emptyPrefsFile.exists());
+ try
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(FileSystemPreferencesProvider.PATH, emptyPrefsFile.getAbsolutePath());
+ _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
+ assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
+ }
+ finally
+ {
+ emptyPrefsFile.delete();
+ }
+ }
+
+ public void testActivate()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ assertEquals("Unexpexpected state", State.ACTIVE, _preferencesProvider.getActualState());
+ }
+
+ public void testChangeAttributes()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ File newPrefsFile = TestFileUtils.createTempFile(this, ".prefs.json", "{\"user3\":{\"pref1\":\"pref1User3Value\", \"pref3\": 2.0}}");
+ try
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(FileSystemPreferencesProvider.PATH, newPrefsFile.getAbsolutePath());
+ _preferencesProvider.changeAttributes(attributes);
+ assertEquals("Unexpected path", newPrefsFile.getAbsolutePath(),
+ _preferencesProvider.getAttribute(FileSystemPreferencesProvider.PATH));
+
+ Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
+ assertTrue("Unexpected preferences for user1", preferences1.isEmpty());
+
+ String user3 = "user3";
+ Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
+ assertFalse("No preference found for user3", preferences3.isEmpty());
+ assertEquals("Unexpected preference 1 for user 3", "pref1User3Value", preferences3.get("pref1"));
+ assertEquals("Unexpected preference 3 for user 3", 2.0, ((Number) preferences3.get("pref3")).floatValue(), 0.01);
+ }
+ finally
+ {
+ newPrefsFile.delete();
+ }
+ }
+
+ public void testGetPreferences()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
+ assertUser1Preferences(preferences1);
+
+ Map<String, Object> preferences2 = _preferencesProvider.getPreferences(_user2);
+ assertUser2Preferences(preferences2);
+
+ String user3 = "user3";
+ Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
+ assertTrue("No preference found for user3", preferences3.isEmpty());
+ }
+
+ public void testSetPrefernces()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ Map<String, Object> newPreferences = new HashMap<String, Object>();
+ newPreferences.put("pref2", false);
+ newPreferences.put("pref4", 8);
+ Map<String, Object> pref5 = new HashMap<String, Object>();
+ pref5.put("test1", "test1Value");
+ pref5.put("test2", 5);
+ newPreferences.put("pref5", pref5);
+
+ _preferencesProvider.setPreferences(_user1, newPreferences);
+ _preferencesProvider.setDesiredState(State.ACTIVE, State.STOPPED);
+
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+ Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
+ assertNotNull("Preferences should not be null for user 1", preferences1);
+ assertEquals("Unexpected preference 1 for user 1", "pref1User1Value", preferences1.get("pref1"));
+ assertEquals("Unexpected preference 2 for user 1", false, preferences1.get("pref2"));
+ assertEquals("Unexpected preference 3 for user 1", 1.0, ((Number) preferences1.get("pref3")).floatValue(), 0.01);
+ assertEquals("Unexpected preference 4 for user 1", 8, preferences1.get("pref4"));
+ assertNotNull("Unexpected preference 5 for user 1", preferences1.get("pref5"));
+ assertEquals("Unexpected preference 5 for user 1", pref5, preferences1.get("pref5"));
+
+ Map<String, Object> preferences2 = _preferencesProvider.getPreferences(_user2);
+ assertUser2Preferences(preferences2);
+
+ String user3 = "user3";
+ Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
+ assertTrue("Unexpected preferences found for user3", preferences3.isEmpty());
+ }
+
+ public void testDeletePrefernces()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ assertUser1Preferences(_preferencesProvider.getPreferences(_user1));
+ assertUser2Preferences(_preferencesProvider.getPreferences(_user2));
+
+ _preferencesProvider.deletePreferences(_user1);
+ _preferencesProvider.setDesiredState(State.ACTIVE, State.STOPPED);
+
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+ Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
+ assertTrue("Preferences should not be set for user 1", preferences1.isEmpty());
+
+ Map<String, Object> preferences2 = _preferencesProvider.getPreferences(_user2);
+ assertUser2Preferences(preferences2);
+
+ String user3 = "user3";
+ Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
+ assertTrue("Unexpected preferences found for user3", preferences3.isEmpty());
+ }
+
+ public void testDeleteMultipleUsersPrefernces()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ assertUser1Preferences(_preferencesProvider.getPreferences(_user1));
+ assertUser2Preferences(_preferencesProvider.getPreferences(_user2));
+
+ _preferencesProvider.deletePreferences(_user1, _user2);
+ _preferencesProvider.setDesiredState(State.ACTIVE, State.STOPPED);
+
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+ Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
+ assertTrue("Preferences should not be set for user 1", preferences1.isEmpty());
+
+ Map<String, Object> preferences2 = _preferencesProvider.getPreferences(_user2);
+ assertTrue("Preferences should not be set for user 2", preferences2.isEmpty());
+
+ String user3 = "user3";
+ Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
+ assertTrue("No preference found for user3", preferences3.isEmpty());
+ }
+
+ public void testListUserNames()
+ {
+ _preferencesProvider = createPreferencesProvider();
+ _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+ Set<String> userNames = _preferencesProvider.listUserIDs();
+
+ assertEquals("Unexpected user names", new HashSet<String>(Arrays.asList("user1", "user2")), userNames);
+ }
+
+ private FileSystemPreferencesProvider createPreferencesProvider()
+ {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(FileSystemPreferencesProvider.PATH, _preferencesFile.getAbsolutePath());
+ attributes.put(FileSystemPreferencesProvider.NAME, "test");
+ return _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
+ }
+
+ private void assertUser1Preferences(Map<String, Object> preferences1)
+ {
+ assertNotNull("Preferences should not be null for user 1", preferences1);
+ assertEquals("Unexpected preference 1 for user 1", "pref1User1Value", preferences1.get("pref1"));
+ assertEquals("Unexpected preference 2 for user 1", true, preferences1.get("pref2"));
+ assertEquals("Unexpected preference 3 for user 1", 1.0, ((Number) preferences1.get("pref3")).floatValue(), 0.01);
+ assertEquals("Unexpected preference 4 for user 1", 2, preferences1.get("pref4"));
+ assertNull("Unexpected preference 5 for user 1", preferences1.get("pref5"));
+ }
+
+ private void assertUser2Preferences(Map<String, Object> preferences2)
+ {
+ assertNotNull("Preferences should not be null for user 2", preferences2);
+ assertEquals("Unexpected preference 1 for user 2", "pref1User2Value", preferences2.get("pref1"));
+ assertEquals("Unexpected preference 2 for user 2", false, preferences2.get("pref2"));
+ assertEquals("Unexpected preference 2 for user 2", 2.0, ((Number) preferences2.get("pref3")).floatValue(), 0.01);
+ assertEquals("Unexpected preference 3 for user 2", 3, preferences2.get("pref4"));
+ assertNull("Unexpected preference 5 for user 2", preferences2.get("pref5"));
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
index 54826b8c88..54826b8c88 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java
index dd48d7b56d..dd48d7b56d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/configuration/ConfigurationEntryTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java
index a468fa072b..a468fa072b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
new file mode 100644
index 0000000000..29a03b2ee7
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
@@ -0,0 +1,560 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.queue;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyMap;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.configuration.QueueConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
+import org.apache.qpid.server.exchange.DefaultExchangeFactory;
+import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.logging.LogActor;
+import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.plugin.ExchangeType;
+import org.apache.qpid.server.store.DurableConfigurationStore;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.mockito.ArgumentCaptor;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+public class AMQQueueFactoryTest extends QpidTestCase
+{
+ private QueueRegistry _queueRegistry;
+ private VirtualHost _virtualHost;
+ private AMQQueueFactory _queueFactory;
+ private List<AMQQueue> _queues;
+ private QueueConfiguration _queueConfiguration;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ _queues = new ArrayList<AMQQueue>();
+
+ _virtualHost = mock(VirtualHost.class);
+
+ VirtualHostConfiguration vhostConfig = mock(VirtualHostConfiguration.class);
+ when(_virtualHost.getConfiguration()).thenReturn(vhostConfig);
+ _queueConfiguration = mock(QueueConfiguration.class);
+ when(vhostConfig.getQueueConfiguration(anyString())).thenReturn(_queueConfiguration);
+ LogActor logActor = mock(LogActor.class);
+ CurrentActor.set(logActor);
+ RootMessageLogger rootLogger = mock(RootMessageLogger.class);
+ when(logActor.getRootMessageLogger()).thenReturn(rootLogger);
+ DurableConfigurationStore store = mock(DurableConfigurationStore.class);
+ when(_virtualHost.getDurableConfigurationStore()).thenReturn(store);
+
+ mockExchangeCreation();
+ mockQueueRegistry();
+ delegateVhostQueueCreation();
+
+ when(_virtualHost.getQueues()).thenReturn(_queues);
+
+
+ _queueFactory = new AMQQueueFactory(_virtualHost, _queueRegistry);
+
+
+
+ }
+
+ private void delegateVhostQueueCreation() throws AMQException
+ {
+ final ArgumentCaptor<UUID> id = ArgumentCaptor.forClass(UUID.class);
+ final ArgumentCaptor<String> queueName = ArgumentCaptor.forClass(String.class);
+ final ArgumentCaptor<Boolean> durable = ArgumentCaptor.forClass(Boolean.class);
+ final ArgumentCaptor<String> owner = ArgumentCaptor.forClass(String.class);
+ final ArgumentCaptor<Boolean> autoDelete = ArgumentCaptor.forClass(Boolean.class);
+ final ArgumentCaptor<Boolean> exclusive = ArgumentCaptor.forClass(Boolean.class);
+ final ArgumentCaptor<Boolean> deleteOnNoConsumer = ArgumentCaptor.forClass(Boolean.class);
+ final ArgumentCaptor<Map> arguments = ArgumentCaptor.forClass(Map.class);
+
+ when(_virtualHost.createQueue(id.capture(), queueName.capture(), durable.capture(), owner.capture(),
+ autoDelete.capture(), exclusive.capture(), deleteOnNoConsumer.capture(), arguments.capture())).then(
+ new Answer<AMQQueue>()
+ {
+ @Override
+ public AMQQueue answer(InvocationOnMock invocation) throws Throwable
+ {
+ return _queueFactory.createQueue(id.getValue(),
+ queueName.getValue(),
+ durable.getValue(),
+ owner.getValue(),
+ autoDelete.getValue(),
+ exclusive.getValue(),
+ deleteOnNoConsumer.getValue(),
+ arguments.getValue());
+ }
+ }
+ );
+ }
+
+ private void mockQueueRegistry()
+ {
+ _queueRegistry = mock(QueueRegistry.class);
+
+ final ArgumentCaptor<AMQQueue> capturedQueue = ArgumentCaptor.forClass(AMQQueue.class);
+ doAnswer(new Answer()
+ {
+
+ @Override
+ public Object answer(final InvocationOnMock invocation) throws Throwable
+ {
+ AMQQueue queue = capturedQueue.getValue();
+ when(_queueRegistry.getQueue(eq(queue.getId()))).thenReturn(queue);
+ when(_queueRegistry.getQueue(eq(queue.getName()))).thenReturn(queue);
+ when(_virtualHost.getQueue(eq(queue.getId()))).thenReturn(queue);
+ when(_virtualHost.getQueue(eq(queue.getName()))).thenReturn(queue);
+ _queues.add(queue);
+
+ return null;
+ }
+ }).when(_queueRegistry).registerQueue(capturedQueue.capture());
+ }
+
+ private void mockExchangeCreation() throws AMQException
+ {
+ final ArgumentCaptor<UUID> idCapture = ArgumentCaptor.forClass(UUID.class);
+ final ArgumentCaptor<String> exchangeNameCapture = ArgumentCaptor.forClass(String.class);
+ final ArgumentCaptor<String> type = ArgumentCaptor.forClass(String.class);
+
+ when(_virtualHost.createExchange(idCapture.capture(), exchangeNameCapture.capture(), type.capture(),
+ anyBoolean(), anyBoolean(), anyString())).then(
+ new Answer<Exchange>()
+ {
+ @Override
+ public Exchange answer(InvocationOnMock invocation) throws Throwable
+ {
+ final String name = exchangeNameCapture.getValue();
+ final UUID id = idCapture.getValue();
+
+ final Exchange exchange = mock(Exchange.class);
+ ExchangeType exType = mock(ExchangeType.class);
+
+ when(exchange.getName()).thenReturn(name);
+ when(exchange.getId()).thenReturn(id);
+ when(exchange.getType()).thenReturn(exType);
+
+ final String typeName = type.getValue();
+ when(exType.getType()).thenReturn(typeName);
+ when(exchange.getTypeName()).thenReturn(typeName);
+
+ when(_virtualHost.getExchange(eq(name))).thenReturn(exchange);
+ when(_virtualHost.getExchange(eq(id))).thenReturn(exchange);
+
+ final ArgumentCaptor<AMQQueue> queue = ArgumentCaptor.forClass(AMQQueue.class);
+
+ when(exchange.addBinding(anyString(),queue.capture(),anyMap())).then(new Answer<Boolean>() {
+
+ @Override
+ public Boolean answer(InvocationOnMock invocation) throws Throwable
+ {
+ when(exchange.isBound(eq(queue.getValue()))).thenReturn(true);
+ return true;
+ }
+ });
+
+ return exchange;
+ }
+ }
+ );
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ private void verifyRegisteredQueueCount(int count)
+ {
+ assertEquals("Queue was not registered in virtualhost", count, _virtualHost.getQueues().size());
+ }
+
+
+ private void verifyQueueRegistered(String queueName)
+ {
+ assertNotNull("Queue " + queueName + " was not created", _virtualHost.getQueue(queueName));
+ }
+
+ public void testPriorityQueueRegistration() throws Exception
+ {
+ Map<String,Object> attributes = Collections.singletonMap(Queue.PRIORITIES, (Object) 5);
+
+
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ "testPriorityQueue",
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ attributes);
+
+ assertEquals("Queue not a priorty queue", AMQPriorityQueue.class, queue.getClass());
+ verifyQueueRegistered("testPriorityQueue");
+ verifyRegisteredQueueCount(1);
+ }
+
+
+ public void testSimpleQueueRegistration() throws Exception
+ {
+ String queueName = getName();
+ String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
+
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner", false,
+ false,
+ false,
+ null);
+ assertEquals("Queue not a simple queue", SimpleAMQQueue.class, queue.getClass());
+ verifyQueueRegistered(queueName);
+
+ //verify that no alternate exchange or DLQ were produced
+
+ assertNull("Queue should not have an alternate exchange as DLQ wasnt enabled", queue.getAlternateExchange());
+ assertNull("The DLQ should not exist", _virtualHost.getQueue(dlQueueName));
+
+ verifyRegisteredQueueCount(1);
+ }
+
+ /**
+ * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true does
+ * cause the alternate exchange to be set and DLQ to be produced.
+ * @throws AMQException
+ */
+ public void testDeadLetterQueueEnabled() throws AMQException
+ {
+ Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
+
+ String queueName = "testDeadLetterQueueEnabled";
+ String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
+ String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
+
+ assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
+ assertNull("The alternate exchange should not yet exist", _virtualHost.getExchange(dlExchangeName));
+
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ queueName,
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ attributes);
+
+ Exchange altExchange = queue.getAlternateExchange();
+ assertNotNull("Queue should have an alternate exchange as DLQ is enabled", altExchange);
+ assertEquals("Alternate exchange name was not as expected", dlExchangeName, altExchange.getName());
+ assertEquals("Alternate exchange type was not as expected", ExchangeDefaults.FANOUT_EXCHANGE_CLASS, altExchange.getTypeName());
+
+ assertNotNull("The alternate exchange was not registered as expected", _virtualHost.getExchange(dlExchangeName));
+ assertEquals("The registered exchange was not the expected exchange instance", altExchange, _virtualHost.getExchange(dlExchangeName));
+
+ AMQQueue dlQueue = _virtualHost.getQueue(dlQueueName);
+ assertNotNull("The DLQ was not registered as expected", dlQueue);
+ assertTrue("DLQ should have been bound to the alternate exchange", altExchange.isBound(dlQueue));
+ assertNull("DLQ should have no alternate exchange", dlQueue.getAlternateExchange());
+ assertEquals("DLQ should have a zero maximum delivery count", 0, dlQueue.getMaximumDeliveryCount());
+
+ //2 queues should have been registered
+ verifyRegisteredQueueCount(2);
+ }
+
+ /**
+ * Tests that the deadLetterQueues/maximumDeliveryCount settings from the configuration
+ * are not applied to the DLQ itself.
+ * @throws AMQException
+ */
+ public void testDeadLetterQueueDoesNotInheritDLQorMDCSettings() throws Exception
+ {
+
+ String queueName = "testDeadLetterQueueEnabled";
+ String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
+ String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
+
+ when(_queueConfiguration.getMaxDeliveryCount()).thenReturn(5);
+ when(_queueConfiguration.isDeadLetterQueueEnabled()).thenReturn(true);
+
+ assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
+ assertNull("The alternate exchange should not yet exist", _virtualHost.getExchange(dlExchangeName));
+
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ queueName,
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ null);
+
+ assertEquals("Unexpected maximum delivery count", 5, queue.getMaximumDeliveryCount());
+ Exchange altExchange = queue.getAlternateExchange();
+ assertNotNull("Queue should have an alternate exchange as DLQ is enabled", altExchange);
+ assertEquals("Alternate exchange name was not as expected", dlExchangeName, altExchange.getName());
+ assertEquals("Alternate exchange type was not as expected", ExchangeDefaults.FANOUT_EXCHANGE_CLASS, altExchange.getTypeName());
+
+ assertNotNull("The alternate exchange was not registered as expected", _virtualHost.getExchange(dlExchangeName));
+ assertEquals("The registered exchange was not the expected exchange instance", altExchange, _virtualHost.getExchange(dlExchangeName));
+
+ AMQQueue dlQueue = _virtualHost.getQueue(dlQueueName);
+ assertNotNull("The DLQ was not registered as expected", dlQueue);
+ assertTrue("DLQ should have been bound to the alternate exchange", altExchange.isBound(dlQueue));
+ assertNull("DLQ should have no alternate exchange", dlQueue.getAlternateExchange());
+ assertEquals("DLQ should have a zero maximum delivery count", 0, dlQueue.getMaximumDeliveryCount());
+
+ //2 queues should have been registered
+ verifyRegisteredQueueCount(2);
+ }
+
+ /**
+ * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument false does not
+ * result in the alternate exchange being set and DLQ being created.
+ * @throws AMQException
+ */
+ public void testDeadLetterQueueDisabled() throws AMQException
+ {
+ Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) false);
+
+ String queueName = "testDeadLetterQueueDisabled";
+ String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
+ String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
+
+ assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
+ assertNull("The alternate exchange should not exist", _virtualHost.getExchange(dlExchangeName));
+
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ queueName,
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ attributes);
+
+ assertNull("Queue should not have an alternate exchange as DLQ is disabled", queue.getAlternateExchange());
+ assertNull("The alternate exchange should still not exist", _virtualHost.getExchange(dlExchangeName));
+
+ assertNull("The DLQ should still not exist", _virtualHost.getQueue(dlQueueName));
+
+ //only 1 queue should have been registered
+ verifyRegisteredQueueCount(1);
+ }
+
+ /**
+ * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true but
+ * creating an auto-delete queue, does not result in the alternate exchange
+ * being set and DLQ being created.
+ * @throws AMQException
+ */
+ public void testDeadLetterQueueNotCreatedForAutodeleteQueues() throws AMQException
+ {
+ Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
+
+ String queueName = "testDeadLetterQueueNotCreatedForAutodeleteQueues";
+ String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
+ String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
+
+ assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
+ assertNull("The alternate exchange should not exist", _virtualHost.getExchange(dlExchangeName));
+
+ //create an autodelete queue
+ AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ queueName,
+ false,
+ "owner",
+ true,
+ false,
+ false,
+ attributes);
+ assertTrue("Queue should be autodelete", queue.isAutoDelete());
+
+ //ensure that the autodelete property overrides the request to enable DLQ
+ assertNull("Queue should not have an alternate exchange as queue is autodelete", queue.getAlternateExchange());
+ assertNull("The alternate exchange should not exist as queue is autodelete", _virtualHost.getExchange(dlExchangeName));
+ assertNull("The DLQ should not exist as queue is autodelete", _virtualHost.getQueue(dlQueueName));
+
+ //only 1 queue should have been registered
+ verifyRegisteredQueueCount(1);
+ }
+
+ /**
+ * Tests that setting the {@link QueueArgumentsConverter#X_QPID_MAXIMUM_DELIVERY_COUNT} argument has
+ * the desired effect.
+ */
+ public void testMaximumDeliveryCount() throws Exception
+ {
+ Map<String,Object> attributes = Collections.singletonMap(Queue.MAXIMUM_DELIVERY_ATTEMPTS, (Object) 5);
+
+ final AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ "testMaximumDeliveryCount",
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ attributes);
+
+ assertNotNull("The queue was not registered as expected ", queue);
+ assertEquals("Maximum delivery count not as expected", 5, queue.getMaximumDeliveryCount());
+
+ verifyRegisteredQueueCount(1);
+ }
+
+ /**
+ * Tests that omitting the {@link QueueArgumentsConverter#X_QPID_MAXIMUM_DELIVERY_COUNT} argument means
+ * that queue is created with a default maximumDeliveryCount of zero (unless set in config).
+ */
+ public void testMaximumDeliveryCountDefault() throws Exception
+ {
+ final AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
+ "testMaximumDeliveryCount",
+ false,
+ "owner",
+ false,
+ false,
+ false,
+ null);
+
+ assertNotNull("The queue was not registered as expected ", queue);
+ assertEquals("Maximum delivery count not as expected", 0, queue.getMaximumDeliveryCount());
+
+ verifyRegisteredQueueCount(1);
+ }
+
+ /**
+ * Tests queue creation with queue name set to null
+ */
+ public void testQueueNameNullValidation()
+ {
+ try
+ {
+ _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), null, false, "owner", true, false,
+ false,
+ null);
+ fail("queue with null name can not be created!");
+ }
+ catch (Exception e)
+ {
+ assertTrue(e instanceof IllegalArgumentException);
+ assertEquals("Queue name must not be null", e.getMessage());
+ }
+ }
+
+ /**
+ * Tests queue creation with queue name length less 255 characters but
+ * corresponding DLQ name length greater than 255.
+ */
+ public void testQueueNameWithLengthLessThan255ButDLQNameWithLengthGreaterThan255()
+ {
+ String queueName = "test-" + generateStringWithLength('a', 245);
+ try
+ {
+ // change DLQ name to make its length bigger than exchange name
+ setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_EXCHANGE_SUFFIX, "_DLE");
+ setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_QUEUE_SUFFIX, "_DLQUEUE");
+ Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
+ _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner",
+ false, false, false, attributes);
+ fail("queue with DLQ name having more than 255 characters can not be created!");
+ }
+ catch (Exception e)
+ {
+ assertTrue("Unexpected exception is thrown!", e instanceof IllegalArgumentException);
+ assertTrue("Unexpected exception message!", e.getMessage().contains("DLQ queue name")
+ && e.getMessage().contains("length exceeds limit of 255"));
+ }
+ }
+
+ /**
+ * Tests queue creation with queue name length less 255 characters but
+ * corresponding DL exchange name length greater than 255.
+ */
+ public void testQueueNameWithLengthLessThan255ButDLExchangeNameWithLengthGreaterThan255()
+ {
+ String queueName = "test-" + generateStringWithLength('a', 245);
+ try
+ {
+ // change DLQ name to make its length bigger than exchange name
+ setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_EXCHANGE_SUFFIX, "_DLEXCHANGE");
+ setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_QUEUE_SUFFIX, "_DLQ");
+ Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
+ _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner",
+ false, false, false, attributes);
+ fail("queue with DLE name having more than 255 characters can not be created!");
+ }
+ catch (Exception e)
+ {
+ assertTrue("Unexpected exception is thrown!", e instanceof IllegalArgumentException);
+ assertTrue("Unexpected exception message!", e.getMessage().contains("DL exchange name")
+ && e.getMessage().contains("length exceeds limit of 255"));
+ }
+ }
+
+ public void testMessageGroupFromConfig() throws Exception
+ {
+
+ Map<String,String> arguments = new HashMap<String, String>();
+ arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"mykey");
+ arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
+
+ QueueConfiguration qConf = mock(QueueConfiguration.class);
+ when(qConf.getArguments()).thenReturn(arguments);
+ when(qConf.getName()).thenReturn("test");
+
+ AMQQueue queue = _queueFactory.createAMQQueueImpl(qConf);
+ assertEquals("mykey", queue.getAttribute(Queue.MESSAGE_GROUP_KEY));
+ assertEquals(Boolean.TRUE, queue.getAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS));
+ }
+
+ private String generateStringWithLength(char ch, int length)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < length; i++)
+ {
+ sb.append(ch);
+ }
+ return sb.toString();
+ }
+
+
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java
index 6538724a71..6538724a71 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/ConflationQueueListTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java
index 584e26d88f..584e26d88f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/InboundMessageAdapterTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
index 2a0c12ff3e..2a0c12ff3e 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
index f5d4f1219d..f5d4f1219d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java
index df2de7f0e0..df2de7f0e0 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/NotificationCheckTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java
index e8c0470915..e8c0470915 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java
index d348c3e67b..d348c3e67b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java
index beb5bda7ff..beb5bda7ff 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java
index 674af36b77..674af36b77 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SelfValidatingSortedQueueEntryList.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
index 3a41bb9c72..3a41bb9c72 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
index c115af5a38..c115af5a38 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java
index c2c2fc4b98..c2c2fc4b98 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java
index 63b3a7d165..63b3a7d165 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryListTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java
index acd0ccbdeb..acd0ccbdeb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryImplTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java
index 7add2d4d43..7add2d4d43 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java
index 9edd345360..9edd345360 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java
index cd5791952f..cd5791952f 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java
index e9d8d16fce..e9d8d16fce 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticatedPrincipalTestHelper.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java
index a023cbdbb2..a023cbdbb2 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/AuthenticationResultTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java
index ea6b40e3de..ea6b40e3de 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/TestPrincipalUtils.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java
index 5e025d3ca8..5e025d3ca8 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/UsernamePrincipalTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java
index 4102a1fc68..4102a1fc68 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java
index abb0b15a76..abb0b15a76 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java
index eecbcdf38d..eecbcdf38d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java
index 44faa57dbe..44faa57dbe 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/database/PlainUserTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java
index a4dd97e6a1..a4dd97e6a1 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/jmx/JMXPasswordAuthenticatorTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java
index cfeb7c525b..cfeb7c525b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java
new file mode 100644
index 0000000000..b3d94a5043
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
+
+public class Base64MD5PasswordFileAuthenticationManagerFactoryTest extends TestCase
+{
+ AuthenticationManagerFactory _factory = new Base64MD5PasswordFileAuthenticationManagerFactory();
+ private Map<String, Object> _configuration = new HashMap<String, Object>();
+ private File _emptyPasswordFile;
+ private Broker _broker = mock(Broker.class);
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ _emptyPasswordFile = File.createTempFile(getName(), "passwd");
+ _emptyPasswordFile.deleteOnExit();
+ }
+
+ public void testBase64MD5InstanceCreated() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNotNull(manager);
+ assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
+ assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof Base64MD5PasswordFilePrincipalDatabase);
+ }
+
+ public void testPasswordFileNotFound() throws Exception
+ {
+ //delete the file
+ _emptyPasswordFile.delete();
+
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
+
+ try
+ {
+ _factory.createInstance(_broker, _configuration);
+ }
+ catch (RuntimeException re)
+ {
+ assertTrue(re.getCause() instanceof FileNotFoundException);
+ }
+ }
+
+ public void testReturnsNullWhenNoConfig() throws Exception
+ {
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ public void testReturnsNullWhenConfigForOtherAuthManagerType() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, "other-auth-manager");
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ public void testReturnsNullWhenConfigForPlainPDImplementationNoPasswordFileValueSpecified() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ if (_emptyPasswordFile == null && _emptyPasswordFile.exists())
+ {
+ _emptyPasswordFile.delete();
+ }
+ }
+ finally
+ {
+ super.tearDown();
+ }
+ }
+} \ No newline at end of file
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java
index 61506777c5..61506777c5 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java
new file mode 100644
index 0000000000..9ff8d18238
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase;
+
+public class PlainPasswordFileAuthenticationManagerFactoryTest extends TestCase
+{
+ AuthenticationManagerFactory _factory = new PlainPasswordFileAuthenticationManagerFactory();
+ private Map<String, Object> _configuration = new HashMap<String, Object>();
+ private File _emptyPasswordFile;
+ private Broker _broker = mock(Broker.class);
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ _emptyPasswordFile = File.createTempFile(getName(), "passwd");
+ _emptyPasswordFile.deleteOnExit();
+ }
+
+ public void testPlainInstanceCreated() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNotNull(manager);
+ assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
+ assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof PlainPasswordFilePrincipalDatabase);
+ }
+
+ public void testPasswordFileNotFound() throws Exception
+ {
+ //delete the file
+ _emptyPasswordFile.delete();
+
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+
+ assertNotNull(manager);
+ assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
+ assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof PlainPasswordFilePrincipalDatabase);
+ }
+
+ public void testReturnsNullWhenNoConfig() throws Exception
+ {
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ public void testReturnsNullWhenConfigForOtherAuthManagerType() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, "other-auth-manager");
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ public void testReturnsNullWhenConfigForPlainPDImplementationNoPasswordFileValueSpecified() throws Exception
+ {
+ _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ if (_emptyPasswordFile == null && _emptyPasswordFile.exists())
+ {
+ _emptyPasswordFile.delete();
+ }
+ }
+ finally
+ {
+ super.tearDown();
+ }
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java
index cba6058426..cba6058426 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java
index 110206a83d..110206a83d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java
new file mode 100644
index 0000000000..cadc5d3a3d
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager;
+
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.verifyZeroInteractions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.TrustStore;
+
+
+import junit.framework.TestCase;
+
+public class SimpleLDAPAuthenticationManagerFactoryTest extends TestCase
+{
+ private SimpleLDAPAuthenticationManagerFactory _factory = new SimpleLDAPAuthenticationManagerFactory();
+ private Map<String, Object> _configuration = new HashMap<String, Object>();
+ private Broker _broker = mock(Broker.class);
+ private TrustStore _trustStore = mock(TrustStore.class);
+
+ public void testLdapInstanceCreated() throws Exception
+ {
+ _configuration.put(SimpleLDAPAuthenticationManagerFactory.ATTRIBUTE_TYPE, SimpleLDAPAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put("providerUrl", "ldap://example.com:389/");
+ _configuration.put("searchContext", "dc=example");
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNotNull(manager);
+
+ verifyZeroInteractions(_broker);
+ }
+
+ public void testLdapsInstanceCreated() throws Exception
+ {
+ _configuration.put(SimpleLDAPAuthenticationManagerFactory.ATTRIBUTE_TYPE, SimpleLDAPAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put("providerUrl", "ldaps://example.com:636/");
+ _configuration.put("searchContext", "dc=example");
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNotNull(manager);
+
+ verifyZeroInteractions(_broker);
+ }
+
+ public void testLdapsWithTrustStoreInstanceCreated() throws Exception
+ {
+ when(_broker.findTrustStoreByName("mytruststore")).thenReturn(_trustStore);
+
+ _configuration.put(SimpleLDAPAuthenticationManagerFactory.ATTRIBUTE_TYPE, SimpleLDAPAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put("providerUrl", "ldaps://example.com:636/");
+ _configuration.put("searchContext", "dc=example");
+ _configuration.put("trustStore", "mytruststore");
+
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNotNull(manager);
+ }
+
+ public void testLdapsWhenTrustStoreNotFound() throws Exception
+ {
+ when(_broker.findTrustStoreByName("notfound")).thenReturn(null);
+
+ _configuration.put(SimpleLDAPAuthenticationManagerFactory.ATTRIBUTE_TYPE, SimpleLDAPAuthenticationManagerFactory.PROVIDER_TYPE);
+ _configuration.put("providerUrl", "ldaps://example.com:636/");
+ _configuration.put("searchContext", "dc=example");
+ _configuration.put("trustStore", "notfound");
+
+ try
+ {
+ _factory.createInstance(_broker, _configuration);
+ fail("Exception not thrown");
+ }
+ catch(IllegalConfigurationException e)
+ {
+ assertEquals("Can't find truststore with name 'notfound'", e.getMessage());
+ }
+ }
+
+ public void testReturnsNullWhenNoConfig() throws Exception
+ {
+ AuthenticationManager manager = _factory.createInstance(_broker, _configuration);
+ assertNull(manager);
+ }
+}
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGeneratorTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGeneratorTest.java
new file mode 100644
index 0000000000..fccffc0163
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ldap/LDAPSSLSocketFactoryGeneratorTest.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.security.auth.manager.ldap;
+
+import static org.apache.qpid.server.security.auth.manager.ldap.LDAPSSLSocketFactoryGenerator.TARGET_PACKAGE_NAME;
+
+import static org.mockito.Mockito.mock;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+
+import junit.framework.TestCase;
+
+public class LDAPSSLSocketFactoryGeneratorTest extends TestCase
+{
+ private SSLSocketFactory _sslSocketFactory = mock(SSLSocketFactory.class);
+
+ public void testPackageAndClassName() throws Exception
+ {
+ Class<? extends SocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory);
+ assertEquals("MyNewClass", socketFactoryClass.getSimpleName());
+ assertEquals(TARGET_PACKAGE_NAME, socketFactoryClass.getPackage().getName());
+ }
+
+ public void testLoadingWithClassForName() throws Exception
+ {
+ Class<? extends AbstractLDAPSSLSocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory);
+ String fqcn = socketFactoryClass.getName();
+
+ try
+ {
+ Class.forName(fqcn);
+ fail("Class loading by name should not have been successful");
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ // PASS
+ }
+
+ final ClassLoader sfClassloader = socketFactoryClass.getClassLoader();
+ // Note: Oracle's com.sun.jndi.ldap.LdapClient uses the following form passing the context loader
+ Class<?> loaded = Class.forName(fqcn, true, sfClassloader);
+ assertEquals(socketFactoryClass, loaded);
+ }
+
+ public void testClassloaderDelegatesToParent() throws Exception
+ {
+ ClassLoader classLoader = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory).getClassLoader();
+ assertEquals(String.class, classLoader.loadClass("java.lang.String"));
+ assertEquals(TestClassForLoading.class, classLoader.loadClass(TestClassForLoading.class.getName()));
+ }
+
+ public void testGetDefaultCreatesInstance() throws Exception
+ {
+ Class<? extends AbstractLDAPSSLSocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory);
+
+ AbstractLDAPSSLSocketFactory socketFactory = invokeGetDefaultMethod(socketFactoryClass);
+ assertTrue(socketFactory instanceof AbstractLDAPSSLSocketFactory);
+ assertEquals("MyNewClass", socketFactory.getClass().getSimpleName());
+ }
+
+ private AbstractLDAPSSLSocketFactory invokeGetDefaultMethod(Class<? extends AbstractLDAPSSLSocketFactory> socketFactoryClass) throws Exception
+ {
+ return (AbstractLDAPSSLSocketFactory) socketFactoryClass.getMethod("getDefault").invoke(null);
+ }
+
+ class TestClassForLoading
+ {
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java
index 3079222b1c..3079222b1c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java
index b3e929dd6c..b3e929dd6c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexServerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java
index f5247634ac..f5247634ac 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java
index 251ebc4c81..251ebc4c81 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslUtil.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java
index 17c63d738c..17c63d738c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java
index 6245064bf7..6245064bf7 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java
index 5dd51250dc..5dd51250dc 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java
index b020c1655a..b020c1655a 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupDatabaseTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java
index 90308d316b..90308d316b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerFactoryTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java
index 152703d548..152703d548 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/FileGroupManagerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java
index d285a0797a..d285a0797a 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java
index 147879f5e8..147879f5e8 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/stats/StatisticsCounterTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
index fd8148f2ce..fd8148f2ce 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/EventManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/EventManagerTest.java
index 2be79c5839..2be79c5839 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/EventManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/EventManagerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java
index b6300e6f48..b6300e6f48 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java
new file mode 100644
index 0000000000..6b6d62378e
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java
@@ -0,0 +1,183 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store;
+
+import java.io.File;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.message.EnqueableMessage;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.util.FileUtils;
+
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public abstract class MessageStoreQuotaEventsTestBase extends QpidTestCase implements EventListener, TransactionLogResource
+{
+ private static final Logger _logger = Logger.getLogger(MessageStoreQuotaEventsTestBase.class);
+
+ protected static final byte[] MESSAGE_DATA = new byte[32 * 1024];
+
+ private MessageStore _store;
+ private File _storeLocation;
+
+ private List<Event> _events;
+ private UUID _transactionResource;
+
+ protected abstract MessageStore createStore() throws Exception;
+
+ protected abstract void applyStoreSpecificConfiguration(VirtualHost virtualHost);
+
+ protected abstract int getNumberOfMessagesToFillStore();
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ _storeLocation = new File(new File(TMP_FOLDER), getTestName());
+ FileUtils.delete(_storeLocation, true);
+
+
+ VirtualHost vhost = mock(VirtualHost.class);
+ when(vhost.getAttribute(eq(VirtualHost.STORE_PATH))).thenReturn(_storeLocation.getAbsolutePath());
+ when(vhost.getName()).thenReturn("test");
+
+ applyStoreSpecificConfiguration(vhost);
+
+ _store = createStore();
+ ((DurableConfigurationStore)_store).configureConfigStore(vhost, null);
+ _store.configureMessageStore(vhost, mock(MessageStoreRecoveryHandler.class), null);
+
+ _transactionResource = UUID.randomUUID();
+ _events = new ArrayList<Event>();
+ _store.addEventListener(this, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ try
+ {
+ super.tearDown();
+ }
+ finally
+ {
+ if (_store != null)
+ {
+ _store.close();
+ }
+ FileUtils.delete(_storeLocation, true);
+ }
+ }
+
+ public void testOverflow() throws Exception
+ {
+ Transaction transaction = _store.newTransaction();
+
+ List<EnqueableMessage> messages = new ArrayList<EnqueableMessage>();
+ for (int i = 0; i < getNumberOfMessagesToFillStore(); i++)
+ {
+ EnqueableMessage m = addMessage(i);
+ messages.add(m);
+ transaction.enqueueMessage(this, m);
+ }
+ transaction.commitTran();
+
+ assertEvent(1, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL);
+
+ for (EnqueableMessage m : messages)
+ {
+ m.getStoredMessage().remove();
+ }
+
+ assertEvent(2, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
+ }
+
+ protected EnqueableMessage addMessage(long id)
+ {
+ StorableMessageMetaData metaData = createMetaData(id, MESSAGE_DATA.length);
+ StoredMessage<?> handle = _store.addMessage(metaData);
+ handle.addContent(0, ByteBuffer.wrap(MESSAGE_DATA));
+ TestMessage message = new TestMessage(id, handle);
+ return message;
+ }
+
+ private StorableMessageMetaData createMetaData(long id, int length)
+ {
+ return new TestMessageMetaData(id, length);
+ }
+
+ @Override
+ public void event(Event event)
+ {
+ _logger.debug("Test event listener received event " + event);
+ _events.add(event);
+ }
+
+ private void assertEvent(int expectedNumberOfEvents, Event... expectedEvents)
+ {
+ assertEquals("Unexpected number of events received ", expectedNumberOfEvents, _events.size());
+ for (Event event : expectedEvents)
+ {
+ assertTrue("Expected event is not found:" + event, _events.contains(event));
+ }
+ }
+
+ @Override
+ public UUID getId()
+ {
+ return _transactionResource;
+ }
+
+ private static class TestMessage implements EnqueableMessage
+ {
+ private final StoredMessage<?> _handle;
+ private final long _messageId;
+
+ public TestMessage(long messageId, StoredMessage<?> handle)
+ {
+ _messageId = messageId;
+ _handle = handle;
+ }
+
+ public long getMessageNumber()
+ {
+ return _messageId;
+ }
+
+ public boolean isPersistent()
+ {
+ return true;
+ }
+
+ public StoredMessage<?> getStoredMessage()
+ {
+ return _handle;
+ }
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java
index 7ebfd54df6..7ebfd54df6 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java
index c309dad5eb..c309dad5eb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/StateManagerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/StateManagerTest.java
index 18efb976eb..18efb976eb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/StateManagerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/StateManagerTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
index 32df355c07..32df355c07 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java
index fd2d4215ab..fd2d4215ab 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaData.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaData.java
new file mode 100644
index 0000000000..d99adb91fe
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaData.java
@@ -0,0 +1,72 @@
+package org.apache.qpid.server.store;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.qpid.framing.EncodingUtils;
+import org.apache.qpid.server.plugin.MessageMetaDataType;
+import org.apache.qpid.server.store.StorableMessageMetaData;
+import org.apache.qpid.server.util.ByteBufferOutputStream;
+
+public class TestMessageMetaData implements StorableMessageMetaData
+{
+ public static final MessageMetaDataType.Factory<TestMessageMetaData> FACTORY = new TestMessageMetaDataFactory();
+
+ private static final TestMessageMetaDataType TYPE = new TestMessageMetaDataType();
+
+ private int _contentSize;
+ private long _messageId;
+
+ public TestMessageMetaData(long messageId, int contentSize)
+ {
+ _contentSize = contentSize;
+ _messageId = messageId;
+ }
+
+ @Override
+ public int getContentSize()
+ {
+ return _contentSize;
+ }
+
+ @Override
+ public int getStorableSize()
+ {
+ int storeableSize = 8 + //message id, long, 8bytes/64bits
+ 4; //content size, int, 4bytes/32bits
+
+ return storeableSize;
+ }
+
+ @Override
+ public MessageMetaDataType getType()
+ {
+ return TYPE;
+ }
+
+ @Override
+ public boolean isPersistent()
+ {
+ return true;
+ }
+
+ @Override
+ public int writeToBuffer(int offsetInMetaData, ByteBuffer dest)
+ {
+ int oldPosition = dest.position();
+ try
+ {
+ DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
+ EncodingUtils.writeLong(dataOutputStream, _messageId);
+ EncodingUtils.writeInteger(dataOutputStream, _contentSize);
+ }
+ catch (IOException e)
+ {
+ // This shouldn't happen as we are not actually using anything that can throw an IO Exception
+ throw new RuntimeException(e);
+ }
+
+ return dest.position() - oldPosition;
+ };
+}
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataFactory.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataFactory.java
new file mode 100644
index 0000000000..8acdd25e97
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataFactory.java
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.qpid.framing.EncodingUtils;
+import org.apache.qpid.server.plugin.MessageMetaDataType;
+import org.apache.qpid.util.ByteBufferInputStream;
+
+public class TestMessageMetaDataFactory implements MessageMetaDataType.Factory<TestMessageMetaData>
+{
+ public TestMessageMetaData createMetaData(ByteBuffer buf)
+ {
+ try
+ {
+ ByteBufferInputStream bbis = new ByteBufferInputStream(buf);
+ DataInputStream dais = new DataInputStream(bbis);
+
+ long id = EncodingUtils.readLong(dais);
+ int size = EncodingUtils.readInteger(dais);
+
+ return new TestMessageMetaData(id, size);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ }
+} \ No newline at end of file
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
new file mode 100644
index 0000000000..25f1df7a20
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.store;
+
+import java.nio.ByteBuffer;
+
+import org.apache.qpid.server.message.AMQMessageHeader;
+import org.apache.qpid.server.message.MessageReference;
+import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.plugin.MessageMetaDataType;
+import org.apache.qpid.server.protocol.AmqpProtocolVersion;
+
+public class TestMessageMetaDataType implements MessageMetaDataType<TestMessageMetaData>
+{
+ //largest metadata type value the BDBMessageStore can store (it uses a byte)
+ private static final byte TYPE = 7;
+
+ @Override
+ public int ordinal()
+ {
+ return TYPE;
+ }
+
+ @Override
+ public TestMessageMetaData createMetaData(ByteBuffer buf)
+ {
+ return TestMessageMetaData.FACTORY.createMetaData(buf);
+ }
+
+ @Override
+ public ServerMessage<TestMessageMetaData> createMessage(StoredMessage<TestMessageMetaData> msg)
+ {
+ return new TestServerMessage(msg);
+ }
+
+ public int hashCode()
+ {
+ return ordinal();
+ }
+
+ public boolean equals(Object o)
+ {
+ return o != null && o.getClass() == getClass();
+ }
+
+ @Override
+ public String getType()
+ {
+ return AmqpProtocolVersion.v0_8.toString();
+ }
+
+
+ private static class TestServerMessage implements ServerMessage<TestMessageMetaData>
+ {
+ private StoredMessage<TestMessageMetaData> _storedMsg;
+
+ public TestServerMessage(StoredMessage<TestMessageMetaData> storedMsg)
+ {
+ _storedMsg = storedMsg;
+ }
+ @Override
+ public long getArrivalTime()
+ {
+ return 0;
+ }
+
+ @Override
+ public int getContent(ByteBuffer buf, int offset)
+ {
+ return 0;
+ }
+
+ @Override
+ public ByteBuffer getContent(int offset, int size)
+ {
+ return null;
+ }
+
+ @Override
+ public long getExpiration()
+ {
+ return 0;
+ }
+
+ @Override
+ public AMQMessageHeader getMessageHeader()
+ {
+ return null;
+ }
+
+ @Override
+ public long getMessageNumber()
+ {
+ return 0;
+ }
+
+ @Override
+ public String getRoutingKey()
+ {
+ return null;
+ }
+
+ @Override
+ public long getSize()
+ {
+ return 0;
+ }
+
+ @Override
+ public StoredMessage<TestMessageMetaData> getStoredMessage()
+ {
+ return _storedMsg;
+ }
+
+ @Override
+ public boolean isImmediate()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isPersistent()
+ {
+ return false;
+ }
+
+ @Override
+ public MessageReference newReference()
+ {
+ return null;
+ }
+ }
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
index bb3c0cf535..bb3c0cf535 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
index b26d7530aa..b26d7530aa 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java
index c4d1a1e614..c4d1a1e614 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/subscription/SubscriptionListTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java
index 5c1012d50b..5c1012d50b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AsyncAutoCommitTransactionTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java
index 06b8539eb1..06b8539eb1 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/AutoCommitTransactionTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java
index 4904cbc6fb..4904cbc6fb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/LocalTransactionTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockAction.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockAction.java
index 15c135ea2c..15c135ea2c 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockAction.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockAction.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
index aa5b555b3b..aa5b555b3b 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java
index 0221f3d509..0221f3d509 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
index cb1fc2737d..cb1fc2737d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java
index 56567523df..56567523df 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/MapJsonSerializerTest.java
diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/StringUtilTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/StringUtilTest.java
new file mode 100644
index 0000000000..c468ca2e0d
--- /dev/null
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/StringUtilTest.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.util;
+
+import org.apache.qpid.server.util.StringUtil;
+import org.apache.qpid.test.utils.QpidTestCase;
+
+public class StringUtilTest extends QpidTestCase
+{
+ private StringUtil _util;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ _util = new StringUtil();
+ }
+
+ public void testRandomAlphaNumericStringInt()
+ {
+ String password = _util.randomAlphaNumericString(10);
+ assertEquals("Unexpected password string length", 10, password.length());
+ assertCharacters(password);
+ }
+
+ private void assertCharacters(String password)
+ {
+ String numbers = "0123456789";
+ String letters = "abcdefghijklmnopqrstuvwxwy";
+ String others = "_-";
+ String expectedCharacters = (numbers + letters + letters.toUpperCase() + others);
+ char[] chars = password.toCharArray();
+ for (int i = 0; i < chars.length; i++)
+ {
+ char ch = chars[i];
+ assertTrue("Unexpected character " + ch, expectedCharacters.indexOf(ch) != -1);
+ }
+ }
+
+ public void testCreateUniqueJavaName()
+ {
+ assertEquals("MyName_973de1b4e26b629d4817c8255090e58e", _util.createUniqueJavaName("MyName"));
+ assertEquals("ContaisIllegalJavaCharacters_a68b2484f2eb790558d6527e56c595fa", _util.createUniqueJavaName("Contais+Illegal-Java*Characters"));
+ assertEquals("StartsWithIllegalInitial_93031eec569608c60c6a98ac9e84a0a7", _util.createUniqueJavaName("9StartsWithIllegalInitial"));
+ assertEquals("97b247ba19ff869340d3797cc73ca065", _util.createUniqueJavaName("1++++----"));
+ assertEquals("d41d8cd98f00b204e9800998ecf8427e", _util.createUniqueJavaName(""));
+ }
+
+}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
index 987a541d05..987a541d05 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java
index 8b4a52bb79..8b4a52bb79 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/HouseKeepingTaskTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
index 1ca7ff1b65..1ca7ff1b65 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
index 03cb483e40..03cb483e40 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/tools/security/PasswdTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/tools/security/PasswdTest.java
index b2a7234c8a..b2a7234c8a 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/tools/security/PasswdTest.java
+++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/tools/security/PasswdTest.java
diff --git a/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageMetaDataType b/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageMetaDataType
new file mode 100644
index 0000000000..5edf3448f9
--- /dev/null
+++ b/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageMetaDataType
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+org.apache.qpid.server.store.TestMessageMetaDataType
diff --git a/qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory b/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
index 9512fb8117..9512fb8117 100644
--- a/qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
+++ b/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
diff --git a/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java b/qpid/java/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
index a10d3b6a77..a10d3b6a77 100644
--- a/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
+++ b/qpid/java/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
diff --git a/qpid/java/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm b/qpid/java/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
new file mode 100644
index 0000000000..803c2151da
--- /dev/null
+++ b/qpid/java/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package ${package};
+
+import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.logging.LogMessage;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
+ *
+ * Generated using GenerateLogMessages and LogMessages.vm
+ * This file is based on the content of ${type.name}_logmessages.properties
+ *
+ * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ */
+public class ${type.name}Messages
+{
+ private static ResourceBundle _messages;
+ private static Locale _currentLocale = BrokerProperties.getLocale();
+
+ public static final String ${type.name.toUpperCase()}_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "${type.name.toLowerCase()}";
+#foreach( $message in ${type.list} )
+ public static final String ${message.methodName.toUpperCase()}_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "${type.name.toLowerCase()}.${message.methodName.toLowerCase()}";
+#end
+
+ static
+ {
+ Logger.getLogger(${type.name.toUpperCase()}_LOG_HIERARCHY);
+#foreach( $message in ${type.list} )
+ Logger.getLogger(${message.methodName.toUpperCase()}_LOG_HIERARCHY);
+#end
+
+ _messages = ResourceBundle.getBundle("${resource}", _currentLocale);
+ }
+
+##
+## The list stored under key 'list' in the 'type' HashMap contains all the
+## log messages that this class should contain. So for each entry in the list
+## this template will create a new log method.
+##
+#foreach( $message in ${type.list} )
+ /**
+ * Log a ${type.name} message of the Format:
+ * <pre>${message.format}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+## There is a lot in the method header here. To make it more readable/understandable
+## This is the same text laid out to be easier to read:
+## public static LogMessage ${message.methodName} (
+## #foreach($parameter in ${message.parameters})
+## ${parameter.type} ${parameter.name}
+## #if (${velocityCount} != ${message.parameters.size()} )
+## ,
+## #end
+## #end
+## #if(${message.parameters.size()} > 0 && ${message.options.size()} > 0)
+## ,
+## #end
+## #foreach($option in ${message.options})
+## boolean ${option.name}
+## #if (${velocityCount} != ${message.options.size()} )
+## ,
+## #end
+## #end
+## )
+##
+## What is going on is that we set the method name based on the HashMap lookup
+## for 'methodName' Then for each entry(another HashMap) in the list stored
+## in the HashMap under 'parameters' build the argument list of from the 'type'
+## and 'name' values. Ensuring that we add a ', ' between each entry.
+##
+## However, check that we are not at the last entry of the list as we don't
+## want to add ', ' at then end.
+##
+## Before we go on to the options we perform a check to see if we had any
+## parameters. If we did and we have options to add then we add ', ' to keep
+## the syntax correct.
+##
+## We then go on to the options that are again retrieved from the top HashMap
+## with key 'options'. For each option a boolean argument is created and the
+## name is retrieved from the option HashMap with key 'name'
+##
+ public static LogMessage ${message.methodName}(#foreach($parameter in ${message.parameters})${parameter.type} ${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end
+#end#if(${message.parameters.size()} > 0 && ${message.options.size()} > 0), #end#foreach($option in ${message.options})boolean ${option.name}#if (${velocityCount} != ${message.options.size()} ), #end#end)
+ {
+ String rawMessage = _messages.getString("${message.name}");
+## If we have some options then we need to build the message based
+## on those values so only provide that logic if we need it.
+#if(${message.options.size()} > 0)
+ StringBuffer msg = new StringBuffer();
+
+ // Split the formatted message up on the option values so we can
+ // rebuild the message based on the configured options.
+ String[] parts = rawMessage.split("\\[");
+ msg.append(parts[0]);
+
+ int end;
+ if (parts.length > 1)
+ {
+## For Each Optional value check if it has been enabled and then
+## append it to the log.
+#foreach($option in ${message.options})
+
+ // Add Option : ${option.value}.
+ end = parts[${velocityCount}].indexOf(']');
+ if (${option.name})
+ {
+ msg.append(parts[${velocityCount}].substring(0, end));
+ }
+
+ // Use 'end + 1' to remove the ']' from the output
+ msg.append(parts[${velocityCount}].substring(end + 1));
+#end
+ }
+
+ rawMessage = msg.toString();
+#end
+
+##
+## If we don't have any parameters then we don't need the overhead of using the
+## message formatter so we can just set our return message to the retreived
+## fixed string. So we don't need to create a new MessageFormat
+##
+## Here we setup rawMessage to be the formatted message ready for direct return
+## with the message.name or further processing to remove options.
+##
+#if(${message.parameters.size()} > 0)
+ final Object[] messageArguments = {#foreach($parameter in ${message.parameters})${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end#end};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+#else
+## If we have no parameters then we can skip the formating and set the log
+ final String message = rawMessage;
+#end
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return ${message.methodName.toUpperCase()}_LOG_HIERARCHY;
+ }
+ };
+ }
+
+#end
+
+ private ${type.name}Messages()
+ {
+ }
+
+}
diff --git a/qpid/java/broker/src/xsl/qmf.xsl b/qpid/java/broker-core/src/xsl/qmf.xsl
index c45d1e419e..c45d1e419e 100644
--- a/qpid/java/broker/src/xsl/qmf.xsl
+++ b/qpid/java/broker-core/src/xsl/qmf.xsl
diff --git a/qpid/java/broker-plugins/access-control/build.xml b/qpid/java/broker-plugins/access-control/build.xml
index 4debdcb95a..eea98937d4 100644
--- a/qpid/java/broker-plugins/access-control/build.xml
+++ b/qpid/java/broker-plugins/access-control/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins Access Control" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests management/common" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests management/common" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker.plugin" value="true"/>
@@ -31,6 +31,4 @@
<target name="bundle" depends="bundle-tasks"/>
- <target name="precompile" depends="gen_logging"/>
-
</project>
diff --git a/qpid/java/broker-plugins/access-control/pom.xml b/qpid/java/broker-plugins/access-control/pom.xml
new file mode 100644
index 0000000000..c4b966d9ae
--- /dev/null
+++ b/qpid/java/broker-plugins/access-control/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-access-control</artifactId>
+
+ <properties>
+ <generated-logmessages-dir>${project.build.directory}/generated-sources/generated-logmessages</generated-logmessages-dir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java b/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java
index e61370fced..e321e0e8f0 100644
--- a/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java
+++ b/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java
@@ -39,12 +39,12 @@ import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.logging.messages.AccessControlMessages;
import org.apache.qpid.server.security.Result;
import org.apache.qpid.server.security.access.ObjectProperties;
import org.apache.qpid.server.security.access.ObjectType;
import org.apache.qpid.server.security.access.Operation;
import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.security.access.logging.AccessControlMessages;
/**
* Models the rule configuration for the access control plugin.
diff --git a/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/logging/AccessControl_logmessages.properties b/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/logging/AccessControl_logmessages.properties
deleted file mode 100644
index 2a5eb7b3be..0000000000
--- a/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/logging/AccessControl_logmessages.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# 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.
-#
-
-# org.apache.qpid.server.security.access.logging.AccessControl
-
-# Access Control logging message i18n strings.
-
-# 'accept-log' rule message
-ALLOWED = ACL-1001 : Allowed : {0} {1} {2}
-
-# 'deny-log' rule message
-DENIED = ACL-1002 : Denied : {0} {1} {2}
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/build.xml b/qpid/java/broker-plugins/amqp-0-10-protocol/build.xml
index e3e6fabc87..3537be172d 100644
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/build.xml
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 0-10 Protocol" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker-plugins-amqp-0-10-protocol.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/pom.xml b/qpid/java/broker-plugins/amqp-0-10-protocol/pom.xml
new file mode 100644
index 0000000000..c24dd918e0
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/build.xml b/qpid/java/broker-plugins/amqp-0-8-protocol/build.xml
index 45086b6242..0ab2b0b833 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/build.xml
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 0-8 Protocol" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker-plugins-amqp-0-8-protocol.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/pom.xml b/qpid/java/broker-plugins/amqp-0-8-protocol/pom.xml
new file mode 100644
index 0000000000..2e9954bc46
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
index e8fda2bc65..5b1e5af7bd 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
@@ -20,38 +20,38 @@
*/
package org.apache.qpid.server.protocol.v0_8;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.security.auth.Subject;
+
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.ContentHeaderBody;
import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQSessionModel;
-import org.apache.qpid.server.protocol.v0_8.AMQChannel;
-import org.apache.qpid.server.protocol.v0_8.AMQMessage;
import org.apache.qpid.server.message.MessageContentSource;
import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine;
+import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
import org.apache.qpid.server.queue.QueueEntry;
import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
import org.apache.qpid.server.security.auth.UsernamePrincipal;
import org.apache.qpid.server.subscription.ClientDeliveryMethod;
import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.protocol.v0_8.SubscriptionImpl;
import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.transport.TestNetworkConnection;
-
-import javax.security.auth.Subject;
-
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
+import org.apache.qpid.transport.Sender;
+import org.apache.qpid.transport.network.NetworkConnection;
public class InternalTestProtocolSession extends AMQProtocolEngine implements ProtocolOutputConverter
{
@@ -266,4 +266,95 @@ public class InternalTestProtocolSession extends AMQProtocolEngine implements Pr
}
}
}
+
+ private static class TestNetworkConnection implements NetworkConnection
+ {
+ private String _remoteHost = "127.0.0.1";
+ private String _localHost = "127.0.0.1";
+ private int _port = 1;
+ private final Sender<ByteBuffer> _sender;
+
+ public TestNetworkConnection()
+ {
+ _sender = new Sender<ByteBuffer>()
+ {
+ public void setIdleTimeout(int i)
+ {
+ }
+
+ public void send(ByteBuffer msg)
+ {
+ }
+
+ public void flush()
+ {
+ }
+
+ public void close()
+ {
+ }
+ };
+ }
+
+ @Override
+ public SocketAddress getLocalAddress()
+ {
+ return new InetSocketAddress(_localHost, _port);
+ }
+
+ @Override
+ public SocketAddress getRemoteAddress()
+ {
+ return new InetSocketAddress(_remoteHost, _port);
+ }
+
+ @Override
+ public void setMaxReadIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void setPeerPrincipal(Principal principal)
+ {
+ }
+
+ @Override
+ public Principal getPeerPrincipal()
+ {
+ return null;
+ }
+
+ @Override
+ public int getMaxReadIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public int getMaxWriteIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public void setMaxWriteIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public Sender<ByteBuffer> getSender()
+ {
+ return _sender;
+ }
+
+ @Override
+ public void start()
+ {
+ }
+ }
}
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/build.xml b/qpid/java/broker-plugins/amqp-1-0-protocol/build.xml
index b83e3eeae1..00926c0787 100644
--- a/qpid/java/broker-plugins/amqp-1-0-protocol/build.xml
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 1.0 Protocol" default="build">
- <property name="module.depends" value="common broker amqp-1-0-common" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core amqp-1-0-common" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker-plugins-amqp-1-0-protocol.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/pom.xml b/qpid/java/broker-plugins/amqp-1-0-protocol/pom.xml
new file mode 100644
index 0000000000..31b42ef0e2
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java
index be9b0323a3..5925bf0c32 100644
--- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java
@@ -23,8 +23,12 @@ package org.apache.qpid.server.protocol.v1_0;
import java.io.EOFException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
import org.apache.qpid.amqp_1_0.messaging.SectionEncoder;
import org.apache.qpid.amqp_1_0.messaging.SectionEncoderImpl;
import org.apache.qpid.amqp_1_0.type.Binary;
@@ -92,6 +96,7 @@ public abstract class MessageConverter_to_1_0<M extends ServerMessage> implement
{
String propName = reader.readStringImpl();
Object value = reader.readObject();
+
map.put(propName, value);
}
catch (EOFException e)
@@ -105,21 +110,23 @@ public abstract class MessageConverter_to_1_0<M extends ServerMessage> implement
}
- return new AmqpValue(map);
+ return new AmqpValue(fixMapValues(map));
}
else if("amqp/map".equals(mimeType))
{
BBDecoder decoder = new BBDecoder();
decoder.init(ByteBuffer.wrap(data));
- return new AmqpValue(decoder.readMap());
+ final Map<String,Object> map = decoder.readMap();
+
+ return new AmqpValue(fixMapValues(map));
}
else if("amqp/list".equals(mimeType))
{
BBDecoder decoder = new BBDecoder();
decoder.init(ByteBuffer.wrap(data));
- return new AmqpValue(decoder.readList());
+ return new AmqpValue(fixListValues(decoder.readList()));
}
else if("jms/stream-message".equals(mimeType))
{
@@ -130,7 +137,7 @@ public abstract class MessageConverter_to_1_0<M extends ServerMessage> implement
{
try
{
- list.add(reader.readObject());
+ list.add(fixValue(reader.readObject()));
}
catch (TypedBytesFormatException e)
{
@@ -150,6 +157,47 @@ public abstract class MessageConverter_to_1_0<M extends ServerMessage> implement
}
}
+ private static Map fixMapValues(final Map<String, Object> map)
+ {
+ for(Map.Entry<String,Object> entry : map.entrySet())
+ {
+ entry.setValue(fixValue(entry.getValue()));
+ }
+ return map;
+ }
+
+ private static Object fixValue(final Object value)
+ {
+ if(value instanceof byte[])
+ {
+ return new Binary((byte[])value);
+ }
+ else if(value instanceof Map)
+ {
+ return fixMapValues((Map)value);
+ }
+ else if(value instanceof List)
+ {
+ return fixListValues((List)value);
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ private static List fixListValues(final List list)
+ {
+ ListIterator iterator = list.listIterator();
+ while(iterator.hasNext())
+ {
+ Object value = iterator.next();
+ iterator.set(fixValue(value));
+
+ }
+ return list;
+ }
+
private StoredMessage<MessageMetaData_1_0> convertServerMessage(final MessageMetaData_1_0 metaData,
final ServerMessage serverMessage,
SectionEncoder sectionEncoder)
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java
index 35f24afbce..0351de3e00 100644
--- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java
@@ -164,7 +164,7 @@ public class SendingLink_1_0 implements SendingLinkListener, Link_1_0, DeliveryS
}
source.setFilter(actualFilters.isEmpty() ? null : actualFilters);
- _subscription = new Subscription_1_0(this, qd);
+ _subscription = new Subscription_1_0(this, qd, source.getDistributionMode() != StdDistMode.COPY);
}
else if(destination instanceof ExchangeDestination)
{
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/build.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/build.xml
index cddbcf5bae..161a4c394c 100644
--- a/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/build.xml
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 0.8 to 1.0 MessageConversion" default="build">
- <property name="module.depends" value="common broker amqp-1-0-common broker-plugins/amqp-1-0-protocol broker-plugins/amqp-0-10-protocol" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core amqp-1-0-common broker-plugins/amqp-1-0-protocol broker-plugins/amqp-0-10-protocol" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-amqp-1-0-common=provided -Sqpid-broker-plugins-amqp-0-10-protocol=provided -Sqpid-broker-plugins-amqp-1-0-protocol=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-amqp-1-0-common=provided -Sqpid-broker-plugins-amqp-0-10-protocol=provided -Sqpid-broker-plugins-amqp-1-0-protocol=provided"/>
<property name="broker-plugins-amqp-msg-conv-0-10-to-1-0.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/pom.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/pom.xml
new file mode 100644
index 0000000000..1403caee0a
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/pom.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-10-to-1-0</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/build.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/build.xml
index f405eb8868..26a89bfed9 100644
--- a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/build.xml
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 0.8 to 0.10 MessageConversion" default="build">
- <property name="module.depends" value="common broker broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-broker-plugins-amqp-0-10-protocol=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-broker-plugins-amqp-0-10-protocol=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided"/>
<property name="broker-plugins-amqp-msg-conv-0-8-to-0-10.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/pom.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/pom.xml
new file mode 100644
index 0000000000..deccb6cf22
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-0-10</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/build.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/build.xml
index 897da14d1f..f28b6760e5 100644
--- a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/build.xml
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins AMQP 0.8 to 1.0 MessageConversion" default="build">
- <property name="module.depends" value="common broker amqp-1-0-common broker-plugins/amqp-0-8-protocol broker-plugins/amqp-1-0-protocol" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core amqp-1-0-common broker-plugins/amqp-0-8-protocol broker-plugins/amqp-1-0-protocol" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-amqp-1-0-common=provided -Sqpid-broker-plugins-amqp-1-0-protocol=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-amqp-1-0-common=provided -Sqpid-broker-plugins-amqp-1-0-protocol=provided -Sqpid-broker-plugins-amqp-0-8-protocol=provided"/>
<property name="broker-plugins-amqp-msg-conv-0-8-to-1-0.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/pom.xml b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/pom.xml
new file mode 100644
index 0000000000..ec725e7e57
--- /dev/null
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/pom.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-1-0</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-amqp-1-0-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/derby-store/build.xml b/qpid/java/broker-plugins/derby-store/build.xml
index be3d72f059..95d3263fbc 100644
--- a/qpid/java/broker-plugins/derby-store/build.xml
+++ b/qpid/java/broker-plugins/derby-store/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins Derby Store" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker-plugins-derby-store.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/derby-store/pom.xml b/qpid/java/broker-plugins/derby-store/pom.xml
new file mode 100644
index 0000000000..09bb66d589
--- /dev/null
+++ b/qpid/java/broker-plugins/derby-store/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-derby-store</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.8.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/jdbc-provider-bone/build.xml b/qpid/java/broker-plugins/jdbc-provider-bone/build.xml
index eb3f40734f..8c8e44c072 100644
--- a/qpid/java/broker-plugins/jdbc-provider-bone/build.xml
+++ b/qpid/java/broker-plugins/jdbc-provider-bone/build.xml
@@ -17,9 +17,9 @@
- under the License.
-->
<project name="jdbc-provider-bone" xmlns:ivy="antlib:org.apache.ivy.ant" default="build">
- <property name="module.depends" value="common broker" />
+ <property name="module.depends" value="common broker-core" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/jdbc-provider-bone/pom.xml b/qpid/java/broker-plugins/jdbc-provider-bone/pom.xml
new file mode 100644
index 0000000000..ced20e165e
--- /dev/null
+++ b/qpid/java/broker-plugins/jdbc-provider-bone/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-jdbc-provider-bone</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jolbox</groupId>
+ <artifactId>bonecp</artifactId>
+ <version>0.7.1.RELEASE</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <!-- exclude and specify a fixed version below -->
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>14.0.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/jdbc-store/build.xml b/qpid/java/broker-plugins/jdbc-store/build.xml
index 9b6aeb32d6..4a8e72898c 100644
--- a/qpid/java/broker-plugins/jdbc-store/build.xml
+++ b/qpid/java/broker-plugins/jdbc-store/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins JDBC Store" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker-plugins-jdbc-store.libs" value="" />
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/jdbc-store/pom.xml b/qpid/java/broker-plugins/jdbc-store/pom.xml
new file mode 100644
index 0000000000..cca9c301e0
--- /dev/null
+++ b/qpid/java/broker-plugins/jdbc-store/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-jdbc-store</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.8.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/management-http/build.xml b/qpid/java/broker-plugins/management-http/build.xml
index abf35d9c88..d921b91580 100644
--- a/qpid/java/broker-plugins/management-http/build.xml
+++ b/qpid/java/broker-plugins/management-http/build.xml
@@ -18,36 +18,35 @@
-->
<project name="Qpid Broker-Plugins Management HTTP" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="broker/tests common/tests management/common client" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="broker-core/tests qpid-test-utils management/common client" />
<property name="module.genpom" value="true" />
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided" />
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided" />
<property name="broker.plugin" value="true"/>
- <property name="broker-plugins-management-http.libs" value="" />
-
<import file="../../module.xml" />
- <!-- Flagfile used to determine if uwar needs to be done. ._ is part of Ant's defaultexcludes so wont appear bundles -->
- <property name="dojo.uptodate.flagfile" value="${module.classes}/resources/dojo/._dojouptodate.timestamp" />
+ <property name="module.manifest" value="${module.build}/MANIFEST.MF" />
+ <property name="dojo.config.file" value="${module.classes}/dojoconfig.properties" />
- <target name="precompile" depends="unwardojo" />
+ <target name="precompile" depends="generate-manifest, generate-dojo-config"/>
- <target name="unwardojo" depends="check-unwardojo.done" unless="unwardojo.done">
- <unwar src="${project.root}/${dojo}" dest="${module.classes}/resources/dojo">
- <patternset>
- <exclude name="META-INF/**" />
- <exclude name="WEB-INF/**" />
- <exclude name="**/*.uncompressed.js" />
- </patternset>
- </unwar>
- <touch file="${dojo.uptodate.flagfile}" />
+ <target name="generate-manifest">
+ <!-- Echos exactly as shown, so leave no spaces before/after lines -->
+ <echo file="${module.manifest}" append="false">Manifest-Version: 1.0
+Class-Path: dojo-${dojo-version}.zip
+</echo>
</target>
- <target name="check-unwardojo.done">
- <uptodate property="unwardojo.done" targetfile="${dojo.uptodate.flagfile}" srcfile="${project.root}/${dojo}" />
+ <target name="generate-dojo-config">
+ <!-- Echos exactly as shown, so leave no spaces before/after lines -->
+ <echo file="${dojo.config.file}" append="false">dojo-version=${dojo-version}
+dojo-path=/dojo-${dojo-version}/dojo
+dijit-path=/dojo-${dojo-version}/dijit
+dojox-path=/dojo-${dojo-version}/dojox
+</echo>
</target>
<target name="bundle" depends="bundle-tasks" />
diff --git a/qpid/java/broker-plugins/management-http/pom.xml b/qpid/java/broker-plugins/management-http/pom.xml
new file mode 100644
index 0000000000..36925369fe
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/pom.xml
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-management-http</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty.orbit</groupId>
+ <artifactId>javax.servlet</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-continuation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-continuation</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-websocket</artifactId>
+ <version>7.6.10.v20130312</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.dojotoolkit</groupId>
+ <artifactId>dojo</artifactId>
+ <version>${dojo-version}</version>
+ <type>zip</type>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>resources/</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources-maven</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <archive>
+ <!-- add the dojo zip to the manifest Class-Path so that
+ it gets picked up when using classpath wildcard
+ expansion, which only collects .jar files -->
+ <manifestEntries>
+ <Class-Path>dojo-${dojo-version}.zip</Class-Path>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/DojoHelper.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/DojoHelper.java
new file mode 100644
index 0000000000..2349bb48a7
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/DojoHelper.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *
+ */
+package org.apache.qpid.server.management.plugin;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Properties;
+
+public class DojoHelper
+{
+ private static final Logger _logger = LoggerFactory.getLogger(DojoHelper.class);
+
+ public static final String VERSION_FILE = "dojoconfig.properties";
+ public static final String DOJO_VERSION_PROPERTY = "dojo-version";
+ public static final String DOJO_PATH_PROPERTY = "dojo-path";
+ public static final String DIJIT_PATH_PROPERTY = "dijit-path";
+ public static final String DOJOX_PATH_PROPERTY = "dojox-path";
+
+ private static String _version = "undefined";
+ private static String _dojoPath = "/dojo-undefined/dojo";
+ private static String _dijitPath = "/dojo-undefined/dijit";
+ private static String _dojoxPath = "/dojo-undefined/dojox";
+
+ // Loads the value from the properties file.
+ static
+ {
+ Properties props = new Properties();
+
+ try
+ {
+ InputStream propertyStream = DojoHelper.class.getClassLoader().getResourceAsStream(VERSION_FILE);
+ if (propertyStream == null)
+ {
+ _logger.warn("Unable to find resource " + VERSION_FILE + " from classloader");
+ }
+ else
+ {
+ props.load(propertyStream);
+
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("Dumping Dojo Config:");
+ for (Map.Entry<Object, Object> entry : props.entrySet())
+ {
+ _logger.debug("Property: " + entry.getKey() + " Value: " + entry.getValue());
+ }
+
+ _logger.debug("End of property dump");
+ }
+
+ _version = readPropertyValue(props, DOJO_VERSION_PROPERTY, _version);
+ _dojoPath = readPropertyValue(props, DOJO_PATH_PROPERTY, _dojoPath);
+ _dijitPath = readPropertyValue(props, DIJIT_PATH_PROPERTY, _dijitPath);
+ _dojoxPath = readPropertyValue(props, DOJOX_PATH_PROPERTY, _dojoxPath);
+ }
+ }
+ catch (IOException e)
+ {
+ // Log a warning about this and leave the values initialized to unknown.
+ _logger.error("Exception loading " + VERSION_FILE + " resource:", e);
+ }
+ }
+
+ private static String readPropertyValue(Properties props, String propertyName, String defaultValue)
+ {
+ String value = props.getProperty(propertyName);
+ if (value == null)
+ {
+ return defaultValue;
+ }
+
+ return value;
+ }
+
+ public static String getDojoVersion()
+ {
+ return _version;
+ }
+
+ public static String getDojoPath()
+ {
+ return _dojoPath;
+ }
+
+ public static String getDijitPath()
+ {
+ return _dijitPath;
+ }
+
+ public static String getDojoxPath()
+ {
+ return _dojoxPath;
+ }
+}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
index c6623aefcf..76090b9484 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
@@ -47,7 +47,7 @@ import org.apache.qpid.server.management.plugin.servlet.rest.LogRecordsServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.LogoutServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.MessageContentServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.MessageServlet;
-import org.apache.qpid.server.management.plugin.servlet.rest.PreferencesServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.LoggedOnUserPreferencesServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.UserPreferencesServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.RestServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.SaslServlet;
@@ -300,7 +300,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
addRestServlet(root, "preferencesprovider", AuthenticationProvider.class, PreferencesProvider.class);
root.addServlet(new ServletHolder(new UserPreferencesServlet()), "/rest/userpreferences/*");
- root.addServlet(new ServletHolder(new PreferencesServlet()), "/rest/preferences");
+ root.addServlet(new ServletHolder(new LoggedOnUserPreferencesServlet()), "/rest/preferences");
root.addServlet(new ServletHolder(new StructureServlet()), "/rest/structure");
root.addServlet(new ServletHolder(new MessageServlet()), "/rest/message/*");
root.addServlet(new ServletHolder(new MessageContentServlet()), "/rest/message-content/*");
@@ -313,6 +313,10 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
root.addServlet(new ServletHolder(new DefinedFileServlet("index.html")), "/");
root.addServlet(new ServletHolder(new LogoutServlet()), "/logout");
+ root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoPath(), true)), "/dojo/dojo/*");
+ root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDijitPath(), true)), "/dojo/dijit/*");
+ root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoxPath(), true)), "/dojo/dojox/*");
+
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.js");
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.css");
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.html");
@@ -324,16 +328,9 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.txt");
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.xsl");
root.addServlet(new ServletHolder(new HelperServlet()), "/rest/helper");
- root.addServlet(new ServletHolder(new LogFileListingServlet()), "/rest/logfiles");
+ root.addServlet(new ServletHolder(new LogFileListingServlet()), "/rest/logfilenames");
root.addServlet(new ServletHolder(new LogFileServlet()), "/rest/logfile");
- String[] timeZoneFiles = {"africa", "antarctica", "asia", "australasia", "backward",
- "etcetera", "europe", "northamerica", "pacificnew", "southamerica"};
- for (String timeZoneFile : timeZoneFiles)
- {
- root.addServlet(new ServletHolder(FileServlet.INSTANCE), "/dojo/dojox/date/zoneinfo/" + timeZoneFile);
- }
-
final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
sessionManager.setSessionCookie(JSESSIONID_COOKIE_PREFIX + lastPort);
sessionManager.setMaxInactiveInterval((Integer)getAttribute(TIME_OUT));
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/log/LogFileHelper.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/log/LogFileHelper.java
index 03d98d020b..4104661017 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/log/LogFileHelper.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/log/LogFileHelper.java
@@ -55,14 +55,23 @@ public class LogFileHelper
Map<String, List<LogFileDetails>> cache = new HashMap<String, List<LogFileDetails>>();
for (int i = 0; i < requestedFiles.length; i++)
{
- String[] paths = requestedFiles[i].split("/");
- if (paths.length != 2)
+ String logFile = requestedFiles[i];
+ if ("".equals(logFile))
{
- throw new IllegalArgumentException("Log file name '" + requestedFiles[i] + "' does not include an appender name");
+ throw new IllegalArgumentException("Log file parameter is empty");
+ }
+ int pos = logFile.indexOf("/");
+ if (pos == -1)
+ {
+ throw new IllegalArgumentException("Log file parameter '" + logFile + "' does not include an appender name");
+ }
+ if (pos == logFile.length())
+ {
+ throw new IllegalArgumentException("Log file parameter '" + logFile + "' does not include an file name");
}
- String appenderName = paths[0];
- String fileName = paths[1];
+ String appenderName = logFile.substring(0, pos);
+ String fileName = logFile.substring(pos + 1);
List<LogFileDetails> appenderFiles = cache.get(appenderName);
if (appenderFiles == null)
@@ -92,6 +101,7 @@ public class LogFileHelper
if (logFileDetails.getName().equals(fileName))
{
logFiles.add(logFileDetails);
+ break;
}
}
}
@@ -147,16 +157,16 @@ public class LogFileHelper
{
if (appender instanceof QpidCompositeRollingAppender)
{
- return listAppenderFiles((QpidCompositeRollingAppender) appender, includeLogFileLocation);
+ return listQpidCompositeRollingAppenderFiles((QpidCompositeRollingAppender) appender, includeLogFileLocation);
}
else if (appender instanceof FileAppender)
{
- return listAppenderFiles((FileAppender) appender, includeLogFileLocation);
+ return listFileAppenderFiles((FileAppender) appender, includeLogFileLocation);
}
return null;
}
- private List<LogFileDetails> listAppenderFiles(FileAppender appender, boolean includeLogFileLocation)
+ private List<LogFileDetails> listFileAppenderFiles(FileAppender appender, boolean includeLogFileLocation)
{
String appenderFilePath = appender.getFile();
File appenderFile = new File(appenderFilePath);
@@ -167,17 +177,17 @@ public class LogFileHelper
return Collections.emptyList();
}
- private List<LogFileDetails> listAppenderFiles(QpidCompositeRollingAppender appender, boolean includeLogFileLocation)
+ private List<LogFileDetails> listQpidCompositeRollingAppenderFiles(QpidCompositeRollingAppender appender, boolean includeLogFileLocation)
{
- List<LogFileDetails> files = listAppenderFiles((FileAppender) appender, includeLogFileLocation);
+ List<LogFileDetails> files = listFileAppenderFiles((FileAppender) appender, includeLogFileLocation);
String appenderFilePath = appender.getFile();
File appenderFile = new File(appenderFilePath);
File backupFolder = new File(appender.getBackupFilesToPath());
if (backupFolder.exists())
{
- String backFolderName = backupFolder.getName() + "/";
+ String backupFolderName = backupFolder.getName() + "/";
List<LogFileDetails> backedUpFiles = listLogFiles(backupFolder, appenderFile.getName(), appender.getName(),
- backFolderName, includeLogFileLocation);
+ backupFolderName, includeLogFileLocation);
files.addAll(backedUpFiles);
}
return files;
@@ -192,7 +202,12 @@ public class LogFileHelper
String name = file.getName();
if (name.startsWith(baseFileName))
{
- files.add(new LogFileDetails(name, appenderName, includeLogFileLocation ? file : null, getMimeType(name), file.length(),
+ String diplayPath = name;
+ if (!relativePath.equals(""))
+ {
+ diplayPath = relativePath + name;
+ }
+ files.add(new LogFileDetails(diplayPath, appenderName, includeLogFileLocation ? file : null, getMimeType(name), file.length(),
file.lastModified()));
}
}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/FileServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/FileServlet.java
index 24e5e7c049..7e97b32c0c 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/FileServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/FileServlet.java
@@ -26,6 +26,7 @@ import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
@@ -34,6 +35,8 @@ import javax.servlet.http.HttpServletResponse;
public class FileServlet extends HttpServlet
{
+ private static final String RESOURCES_PREFIX = "/resources";
+
public static final FileServlet INSTANCE = new FileServlet();
private static final Map<String, String> CONTENT_TYPES;
@@ -52,14 +55,33 @@ public class FileServlet extends HttpServlet
CONTENT_TYPES = Collections.unmodifiableMap(contentTypes);
}
+ private final String _resourcePathPrefix;
+ private boolean _usePathInfo;
public FileServlet()
{
+ _resourcePathPrefix = RESOURCES_PREFIX;
+ _usePathInfo = false;
+ }
+
+ public FileServlet(String resourcePathPrefix, boolean usePathInfo)
+ {
+ _resourcePathPrefix = resourcePathPrefix;
+ _usePathInfo = usePathInfo;
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- String filename = request.getServletPath();
+ String filename = null;
+ if(_usePathInfo)
+ {
+ filename = request.getPathInfo();
+ }
+ else
+ {
+ filename = request.getServletPath();
+ }
+
if(filename.contains("."))
{
String suffix = filename.substring(filename.lastIndexOf('.')+1);
@@ -69,7 +91,8 @@ public class FileServlet extends HttpServlet
response.setContentType(contentType);
}
}
- URL resourceURL = getClass().getResource("/resources" + filename);
+
+ URL resourceURL = getClass().getResource(_resourcePathPrefix + filename);
if(resourceURL != null)
{
response.setStatus(HttpServletResponse.SC_OK);
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/LogFileServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/LogFileServlet.java
index 1fa03dc3dc..321cfae66c 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/LogFileServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/LogFileServlet.java
@@ -35,14 +35,13 @@ import org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet;
public class LogFileServlet extends AbstractServlet
{
+ private static final String PARAMETER_LOG_FILE = "l";
+
private static final long serialVersionUID = 1L;
public static final String LOGS_FILE_NAME = "qpid-logs-%s.zip";
public static final String DATE_FORMAT = "yyyy-MM-dd-mmHHss";
- @SuppressWarnings("unchecked")
- private LogFileHelper _helper = new LogFileHelper(Collections.list(LogManager.getRootLogger().getAllAppenders()));
-
@Override
protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
@@ -57,7 +56,7 @@ public class LogFileServlet extends AbstractServlet
return;
}
- String[] requestedFiles = request.getParameterValues("l");
+ String[] requestedFiles = request.getParameterValues(PARAMETER_LOG_FILE);
if (requestedFiles == null || requestedFiles.length == 0)
{
@@ -65,11 +64,14 @@ public class LogFileServlet extends AbstractServlet
return;
}
+ @SuppressWarnings("unchecked")
+ LogFileHelper helper = new LogFileHelper(Collections.list(LogManager.getRootLogger().getAllAppenders()));
+
List<LogFileDetails> logFiles = null;
try
{
- logFiles = _helper.findLogFileDetails(requestedFiles);
+ logFiles = helper.findLogFileDetails(requestedFiles);
}
catch(IllegalArgumentException e)
{
@@ -91,7 +93,7 @@ public class LogFileServlet extends AbstractServlet
OutputStream os = response.getOutputStream();
try
{
- _helper.writeLogFiles(logFiles, os);
+ helper.writeLogFiles(logFiles, os);
}
finally
{
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
index c0f4b55f64..a08d6496bf 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
@@ -275,4 +275,14 @@ public abstract class AbstractServlet extends HttpServlet
mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
mapper.writeValue(writer, object);
}
+
+ protected String[] getPathInfoElements(HttpServletRequest request)
+ {
+ String pathInfo = request.getPathInfo();
+ if (pathInfo != null && pathInfo.length() > 0)
+ {
+ return pathInfo.substring(1).split("/");
+ }
+ return null;
+ }
}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
index 9ba36bb5c2..80ce338d0a 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
@@ -35,6 +35,7 @@ import org.apache.qpid.server.management.plugin.servlet.rest.action.ListAccessCo
import org.apache.qpid.server.management.plugin.servlet.rest.action.ListAuthenticationProviderAttributes;
import org.apache.qpid.server.management.plugin.servlet.rest.action.ListBrokerAttribute;
import org.apache.qpid.server.management.plugin.servlet.rest.action.ListGroupProviderAttributes;
+import org.apache.qpid.server.management.plugin.servlet.rest.action.ListTimeZones;
import org.apache.qpid.server.model.Broker;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
@@ -61,7 +62,8 @@ public class HelperServlet extends AbstractServlet
new ListBrokerAttribute(Broker.PRODUCT_VERSION, "version"),
new ListGroupProviderAttributes(),
new ListAccessControlProviderAttributes(),
- new PluginClassProviderAction()
+ new PluginClassProviderAction(),
+ new ListTimeZones()
};
_actions = new HashMap<String, Action>();
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogFileListingServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogFileListingServlet.java
index b6face18e3..8b88e51e9c 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogFileListingServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogFileListingServlet.java
@@ -36,9 +36,6 @@ public class LogFileListingServlet extends AbstractServlet
{
private static final long serialVersionUID = 1L;
- @SuppressWarnings("unchecked")
- private LogFileHelper _helper = new LogFileHelper(Collections.list(LogManager.getRootLogger().getAllAppenders()));
-
@Override
protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
@@ -49,11 +46,13 @@ public class LogFileListingServlet extends AbstractServlet
if (!getBroker().getSecurityManager().authoriseLogsAccess())
{
- response.sendError(HttpServletResponse.SC_FORBIDDEN, "Log files download is denied");
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Log files access is denied");
return;
}
- List<LogFileDetails> logFiles = _helper.getLogFileDetails(false);
+ @SuppressWarnings("unchecked")
+ LogFileHelper helper = new LogFileHelper(Collections.list(LogManager.getRootLogger().getAllAppenders()));
+ List<LogFileDetails> logFiles = helper.getLogFileDetails(false);
response.setContentType("application/json");
response.setStatus(HttpServletResponse.SC_OK);
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LoggedOnUserPreferencesServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LoggedOnUserPreferencesServlet.java
new file mode 100644
index 0000000000..29cc881be7
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LoggedOnUserPreferencesServlet.java
@@ -0,0 +1,138 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.servlet.rest;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.qpid.server.management.plugin.HttpManagementUtil;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.PreferencesProvider;
+import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
+import org.codehaus.jackson.map.ObjectMapper;
+
+public class LoggedOnUserPreferencesServlet extends AbstractServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException,
+ ServletException
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider(request);
+ if (preferencesProvider == null)
+ {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
+ return;
+ }
+ String userName = getAuthenticatedUserName(request);
+ Map<String, Object> preferences = preferencesProvider.getPreferences(userName);
+ if (preferences == null)
+ {
+ preferences = Collections.<String, Object>emptyMap();
+ }
+ sendJsonResponse(preferences, response);
+ }
+
+ /*
+ * replace preferences
+ */
+ @Override
+ protected void doPutWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider(request);
+ if (preferencesProvider == null)
+ {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
+ return;
+ }
+ String userName = getAuthenticatedUserName(request);
+
+ ObjectMapper mapper = new ObjectMapper();
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> newPreferences = mapper.readValue(request.getInputStream(), LinkedHashMap.class);
+
+ preferencesProvider.deletePreferences(userName);
+ Map<String, Object> preferences = preferencesProvider.setPreferences(userName, newPreferences);
+ if (preferences == null)
+ {
+ preferences = Collections.<String, Object>emptyMap();
+ }
+ sendJsonResponse(preferences, response);
+ }
+
+ /*
+ * update preferences
+ */
+ @Override
+ protected void doPostWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ PreferencesProvider preferencesProvider = getPreferencesProvider(request);
+ if (preferencesProvider == null)
+ {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
+ return;
+ }
+ String userName = getAuthenticatedUserName(request);
+
+ ObjectMapper mapper = new ObjectMapper();
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> newPreferences = mapper.readValue(request.getInputStream(), LinkedHashMap.class);
+ Map<String, Object> preferences = preferencesProvider.setPreferences(userName, newPreferences);
+ if (preferences == null)
+ {
+ preferences = Collections.<String, Object>emptyMap();
+ }
+ sendJsonResponse(preferences, response);
+ }
+
+ private String getAuthenticatedUserName(HttpServletRequest request)
+ {
+ Subject subject = getAuthorisedSubject(request);
+ Principal principal = AuthenticatedPrincipal.getAuthenticatedPrincipalFromSubject(subject);
+ return principal.getName();
+ }
+
+ private PreferencesProvider getPreferencesProvider(HttpServletRequest request)
+ {
+ SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
+ AuthenticationProvider authenticationProvider = getManagementConfiguration().getAuthenticationProvider(localAddress);
+ if (authenticationProvider == null)
+ {
+ throw new IllegalStateException("Authentication provider is not found");
+ }
+ return authenticationProvider.getPreferencesProvider();
+ }
+}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageContentServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageContentServlet.java
index d61c48bb2c..4d85d52997 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageContentServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageContentServlet.java
@@ -44,8 +44,8 @@ public class MessageContentServlet extends AbstractServlet
@Override
protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
-
- if(request.getPathInfo() != null && request.getPathInfo().length()>0 && request.getPathInfo().substring(1).split("/").length > 2)
+ String[] pathInfoElements = getPathInfoElements(request);
+ if(pathInfoElements != null && pathInfoElements.length > 2)
{
getMessageContent(request, response);
}
@@ -55,7 +55,7 @@ public class MessageContentServlet extends AbstractServlet
private void getMessageContent(HttpServletRequest request, HttpServletResponse response) throws IOException
{
Queue queue = getQueueFromRequest(request);
- String path[] = request.getPathInfo().substring(1).split("/");
+ String path[] = getPathInfoElements(request);
MessageFinder finder = new MessageFinder(Long.parseLong(path[2]));
queue.visit(finder);
if(finder.isFound())
@@ -70,15 +70,15 @@ public class MessageContentServlet extends AbstractServlet
private Queue getQueueFromRequest(HttpServletRequest request)
{
- List<String> names = new ArrayList<String>();
// TODO - validation that there is a vhost and queue and only those in the path
- if(request.getPathInfo() != null && request.getPathInfo().length()>0)
+
+ String[] pathInfoElements = getPathInfoElements(request);
+ if(pathInfoElements == null || pathInfoElements.length < 2)
{
- String path = request.getPathInfo().substring(1);
- names.addAll(Arrays.asList(path.split("/")));
+ throw new IllegalArgumentException("Invalid path is specified");
}
- String vhostName = names.get(0);
- String queueName = names.get(1);
+ String vhostName = pathInfoElements[0];
+ String queueName = pathInfoElements[1];
VirtualHost vhost = null;
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java
index 83208516c7..ac0d369402 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java
@@ -56,8 +56,8 @@ public class MessageServlet extends AbstractServlet
@Override
protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
-
- if(request.getPathInfo() != null && request.getPathInfo().length()>0 && request.getPathInfo().substring(1).split("/").length > 2)
+ String[] pathInfoElements = getPathInfoElements(request);
+ if(pathInfoElements != null && pathInfoElements.length > 2)
{
getMessageContent(request, response);
}
@@ -71,7 +71,7 @@ public class MessageServlet extends AbstractServlet
private void getMessageContent(HttpServletRequest request, HttpServletResponse response) throws IOException
{
Queue queue = getQueueFromRequest(request);
- String path[] = request.getPathInfo().substring(1).split("/");
+ String path[] = getPathInfoElements(request);
MessageFinder messageFinder = new MessageFinder(Long.parseLong(path[2]));
queue.visit(messageFinder);
@@ -124,15 +124,15 @@ public class MessageServlet extends AbstractServlet
private Queue getQueueFromRequest(HttpServletRequest request)
{
- List<String> names = new ArrayList<String>();
// TODO - validation that there is a vhost and queue and only those in the path
- if(request.getPathInfo() != null && request.getPathInfo().length()>0)
+
+ String[] pathInfoElements = getPathInfoElements(request);
+ if(pathInfoElements == null || pathInfoElements.length < 2)
{
- String path = request.getPathInfo().substring(1);
- names.addAll(Arrays.asList(path.split("/")));
+ throw new IllegalArgumentException("Invalid path is specified");
}
- String vhostName = names.get(0);
- String queueName = names.get(1);
+ String vhostName = pathInfoElements[0];
+ String queueName = pathInfoElements[1];
VirtualHost vhost = null;
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/PreferencesServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/PreferencesServlet.java
deleted file mode 100644
index bf2a88a2c1..0000000000
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/PreferencesServlet.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.management.plugin.servlet.rest;
-
-import java.io.IOException;
-import java.net.SocketAddress;
-import java.security.Principal;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.qpid.server.management.plugin.HttpManagementUtil;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class PreferencesServlet extends AbstractServlet
-{
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException,
- ServletException
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider(request);
- if (preferencesProvider == null)
- {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
- return;
- }
- String userName = getAuthenticatedUserName(request);
- Map<String, Object> preferences = preferencesProvider.getPreferences(userName);
- if (preferences == null)
- {
- preferences = Collections.<String, Object>emptyMap();
- }
- sendJsonResponse(preferences, response);
- }
-
- /*
- * replace preferences
- */
- @Override
- protected void doPutWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider(request);
- if (preferencesProvider == null)
- {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, "Preferences provider is not configured");
- return;
- }
- String userName = getAuthenticatedUserName(request);
-
- ObjectMapper mapper = new ObjectMapper();
-
- @SuppressWarnings("unchecked")
- Map<String, Object> newPreferences = mapper.readValue(request.getInputStream(), LinkedHashMap.class);
-
- preferencesProvider.deletePreferences(userName);
- Map<String, Object> preferences = preferencesProvider.setPreferences(userName, newPreferences);
- if (preferences == null)
- {
- preferences = Collections.<String, Object>emptyMap();
- }
- sendJsonResponse(preferences, response);
- }
-
- /*
- * update preferences
- */
- @Override
- protected void doPostWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider(request);
- if (preferencesProvider == null)
- {
- throw new IllegalStateException("Preferences provider is not configured");
- }
- String userName = getAuthenticatedUserName(request);
-
- ObjectMapper mapper = new ObjectMapper();
-
- @SuppressWarnings("unchecked")
- Map<String, Object> newPreferences = mapper.readValue(request.getInputStream(), LinkedHashMap.class);
- Map<String, Object> preferences = preferencesProvider.setPreferences(userName, newPreferences);
- if (preferences == null)
- {
- preferences = Collections.<String, Object>emptyMap();
- }
- sendJsonResponse(preferences, response);
- }
-
- private String getAuthenticatedUserName(HttpServletRequest request)
- {
- Subject subject = getAuthorisedSubject(request);
- Principal principal = AuthenticatedPrincipal.getAuthenticatedPrincipalFromSubject(subject);
- return principal.getName();
- }
-
- private PreferencesProvider getPreferencesProvider(HttpServletRequest request)
- {
- SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
- AuthenticationProvider authenticationProvider = getManagementConfiguration().getAuthenticationProvider(localAddress);
- if (authenticationProvider == null)
- {
- throw new IllegalStateException("Authentication provider is not found");
- }
- return authenticationProvider.getPreferencesProvider();
- }
-}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
index 8ea0aa538a..c05b4e30d6 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
@@ -115,16 +115,15 @@ public class RestServlet extends AbstractServlet
protected Collection<ConfiguredObject> getObjects(HttpServletRequest request)
{
+ String[] pathInfoElements = getPathInfoElements(request);
List<String> names = new ArrayList<String>();
- if(request.getPathInfo() != null && request.getPathInfo().length()>0)
+ if(pathInfoElements != null)
{
- String path = request.getPathInfo().substring(1);
- names.addAll(Arrays.asList(path.split("/")));
-
- if(names.size() > _hierarchy.length)
+ if(pathInfoElements.length > _hierarchy.length)
{
throw new IllegalArgumentException("Too many entries in path. Expected " + _hierarchy.length + "; path: " + names);
}
+ names.addAll(Arrays.asList(pathInfoElements));
}
Collection<ConfiguredObject> parents = Collections.singleton((ConfiguredObject) getBroker());
@@ -329,16 +328,15 @@ public class RestServlet extends AbstractServlet
List<String> names = new ArrayList<String>();
- if(request.getPathInfo() != null && request.getPathInfo().length()>0)
+ String[] pathInfoElements = getPathInfoElements(request);
+ if(pathInfoElements != null )
{
- String path = request.getPathInfo().substring(1);
- names.addAll(Arrays.asList(path.split("/")));
-
- if(names.size() != _hierarchy.length)
+ if(pathInfoElements.length != _hierarchy.length)
{
throw new IllegalArgumentException("Path to object to create must be fully specified. "
+ "Found " + names + " of size " + names.size() + " expecting " + _hierarchy.length);
}
+ names.addAll(Arrays.asList(pathInfoElements));
}
if (names.isEmpty())
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/UserPreferencesServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/UserPreferencesServlet.java
index 808e3210dd..355b5df177 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/UserPreferencesServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/UserPreferencesServlet.java
@@ -25,7 +25,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.Iterator;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -50,11 +50,7 @@ public class UserPreferencesServlet extends AbstractServlet
protected void doGetWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
{
- String[] pathElements = null;
- if (request.getPathInfo() != null && request.getPathInfo().length() > 0)
- {
- pathElements = request.getPathInfo().substring(1).split("/");
- }
+ String[] pathElements = getPathInfoElements(request);
if (pathElements != null && pathElements.length > 1)
{
getUserPreferences(pathElements[0], pathElements[1], response);
@@ -70,7 +66,7 @@ public class UserPreferencesServlet extends AbstractServlet
{
if (!userPreferencesOperationAuthorized(userId))
{
- response.sendError(HttpServletResponse.SC_FORBIDDEN, "Vieweing of preferences is not allowed");
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Viewing of preferences is not allowed");
return;
}
Map<String, Object> preferences = null;
@@ -161,53 +157,75 @@ public class UserPreferencesServlet extends AbstractServlet
@Override
protected void doDeleteWithSubjectAndActor(HttpServletRequest request, HttpServletResponse response) throws IOException
{
- final List<String[]> userData = new ArrayList<String[]>();
- for (String name : request.getParameterValues("user"))
+ Broker broker = getBroker();
+ Collection<AuthenticationProvider> authenticationProviders = broker.getAuthenticationProviders();
+ Map<String, Set<String>> providerUsers = new HashMap<String, Set<String>>();
+ Map<String, AuthenticationProvider> requestProviders = new HashMap<String, AuthenticationProvider>();
+ for (String path : request.getParameterValues("user"))
{
- String[] elements = name.split("/");
+ String[] elements = path.split("/");
if (elements.length != 2)
{
- throw new IllegalArgumentException("Illegal parameter");
+ throw new IllegalArgumentException("Illegal user parameter " + path);
}
- userData.add(elements);
+
+ String userId = elements[1];
+
+ if (!userPreferencesOperationAuthorized(userId))
+ {
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Deletion of preferences is not allowed");
+ return;
+ }
+ String providerName = elements[0];
+ Set<String> users = providerUsers.get(providerName);
+
+ if (users == null)
+ {
+ AuthenticationProvider provider = findAuthenticationProviderByName(providerName, authenticationProviders);
+ if (provider == null)
+ {
+ throw new IllegalArgumentException("Cannot find provider with name '" + providerName + "'");
+ }
+ users = new HashSet<String>();
+ providerUsers.put(providerName, users);
+ requestProviders.put(providerName, provider);
+ }
+ users.add(userId);
}
- if (!userData.isEmpty())
+ if (!providerUsers.isEmpty())
{
- Broker broker = getBroker();
- Collection<AuthenticationProvider> authenticationProviders = broker.getAuthenticationProviders();
- for (Iterator<String[]> it = userData.iterator(); it.hasNext();)
+ for (Map.Entry<String, Set<String>> entry : providerUsers.entrySet())
{
- String[] data = (String[]) it.next();
- String authenticationProviderName = data[0];
- String userId = data[1];
+ String providerName = entry.getKey();
+ AuthenticationProvider provider = requestProviders.get(providerName);
+ Set<String> usersToDelete = entry.getValue();
+ PreferencesProvider preferencesProvider = provider.getPreferencesProvider();
- for (AuthenticationProvider authenticationProvider : authenticationProviders)
+ if (preferencesProvider != null && !usersToDelete.isEmpty())
{
- if (authenticationProviderName.equals(authenticationProvider.getName()))
- {
- PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
- if (preferencesProvider != null)
- {
- Set<String> usernames = preferencesProvider.listUserIDs();
- if (usernames.contains(userId))
- {
- if (!userPreferencesOperationAuthorized(userId))
- {
- response.sendError(HttpServletResponse.SC_FORBIDDEN, "Deletion of preferences is not allowed");
- return;
- }
- preferencesProvider.deletePreferences(userId);
- }
- }
- break;
- }
+ String[] users = usersToDelete.toArray(new String[usersToDelete.size()]);
+ preferencesProvider.deletePreferences(users);
}
}
}
}
+ protected AuthenticationProvider findAuthenticationProviderByName(String providerName, Collection<AuthenticationProvider> authenticationProviders)
+ {
+ AuthenticationProvider provider = null;
+ for (AuthenticationProvider authenticationProvider : authenticationProviders)
+ {
+ if(authenticationProvider.getName().equals(providerName))
+ {
+ provider = authenticationProvider;
+ break;
+ }
+ }
+ return provider;
+ }
+
private boolean userPreferencesOperationAuthorized(String userId)
{
return getBroker().getSecurityManager().authoriseUserOperation(Operation.UPDATE, userId);
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListTimeZones.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListTimeZones.java
new file mode 100644
index 0000000000..56bc7b1bf7
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListTimeZones.java
@@ -0,0 +1,117 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.servlet.rest.action;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.apache.qpid.server.management.plugin.servlet.rest.Action;
+import org.apache.qpid.server.model.Broker;
+
+public class ListTimeZones implements Action
+{
+
+ private static final String[] TIMEZONE_REGIONS = { "Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Australia",
+ "Europe", "Indian", "Pacific" };
+
+ @Override
+ public String getName()
+ {
+ return ListTimeZones.class.getSimpleName();
+ }
+
+ @Override
+ public Object perform(Map<String, Object> request, Broker broker)
+ {
+ List<TimeZoneDetails> timeZoneDetails = new ArrayList<TimeZoneDetails>();
+ String[] ids = TimeZone.getAvailableIDs();
+ long currentTime = System.currentTimeMillis();
+ Date currentDate = new Date(currentTime);
+ for (String id : ids)
+ {
+ int cityPos = id.indexOf("/");
+ if (cityPos > 0 && cityPos < id.length() - 1)
+ {
+ String region = id.substring(0, cityPos);
+ for (int i = 0; i < TIMEZONE_REGIONS.length; i++)
+ {
+ if (region.equals(TIMEZONE_REGIONS[i]))
+ {
+ TimeZone tz = TimeZone.getTimeZone(id);
+ int offset = tz.getOffset(currentTime)/60000;
+ String city = id.substring(cityPos + 1).replace('_', ' ');
+ timeZoneDetails.add(new TimeZoneDetails(id, tz.getDisplayName(tz.inDaylightTime(currentDate), TimeZone.SHORT), offset, city, region));
+ break;
+ }
+ }
+ }
+ }
+ return timeZoneDetails;
+ }
+
+ public static class TimeZoneDetails
+ {
+ private String id;
+ private String name;
+ private int offset;
+ private String city;
+ private String region;
+
+ public TimeZoneDetails(String id, String name, int offset, String city, String region)
+ {
+ super();
+ this.id = id;
+ this.name = name;
+ this.offset = offset;
+ this.city = city;
+ this.region = region;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public int getOffset()
+ {
+ return offset;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public String getRegion()
+ {
+ return region;
+ }
+ }
+}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html
index f4846ac556..8e2e068b93 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html
@@ -17,7 +17,7 @@
<div class="dijitHidden">
<div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Authentication Provider'" id="addAuthenticationProvider">
<form id="formAddAuthenticationProvider" method="post" dojoType="dijit.form.Form">
- <div style="height:100px; width:420px; overflow: auto">
+ <div style="width:420px; overflow: auto">
<table class="tableContainer-table tableContainer-table-horiz" width="100%" cellspacing="1">
<tr>
<td class="tableContainer-labelCell" style="width: 200px;">Type*:</td>
@@ -32,6 +32,10 @@
</table>
<input type="hidden" id="formAddAuthenticationProvider.id" name="id"/>
<div id="addAuthenticationProvider.fieldSets"></div>
+ <br/>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Preferences Provider', open: true" id="addAuthenticationProvider.preferencesProviderPanel">
+ <div id="addAuthenticationProvider.preferencesProvider"></div>
+ </div>
</div>
<div class="dijitDialogPaneActionBar">
<!-- submit buttons -->
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html
index ac5dd32119..bca2320888 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html
@@ -18,24 +18,8 @@
<div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Preferences Provider'" id="addPreferencesProvider">
<form id="formAddPreferencesProvider" method="post" data-dojo-type="dijit.form.Form">
<input type="hidden" id="preferencesProvider.id" name="id"/>
- <div style="height:100px; width:420px; overflow: auto">
- <table class="tableContainer-table tableContainer-table-horiz" width="100%" cellspacing="1">
- <tr>
- <td class="tableContainer-labelCell" style="width: 200px;"><strong>Type*:</strong></td>
- <td class="tableContainer-valueCell"><div id="addPreferencesProvider.selectPreferencesProviderDiv"></div></td>
- </tr>
- <tr>
- <td class="tableContainer-labelCell" style="width: 200px;"><strong>Name*:</strong></td>
- <td class="tableContainer-valueCell"><input type="text" name="name"
- id="preferencesProvider.name" data-dojo-type="dijit.form.ValidationTextBox"
- data-dojo-props="placeHolder: 'Name',
- required: true,
- missingMessage: 'A name must be supplied',
- title: 'Enter name',
- pattern: '^[\x20-\x2e\x30-\x7F]{1,255}$'" /></td>
- </tr>
- </table>
- <div id="preferencesProvider.fieldsContainer"></div>
+ <div style="width:420px; overflow: auto">
+ <div id="addPreferencesProvider.preferencesProvider"></div>
</div>
<div class="dijitDialogPaneActionBar">
<!-- submit buttons -->
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html
index f46da4b017..7196493e7c 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html
@@ -18,7 +18,7 @@
<tr>
<td class="tableContainer-labelCell" style="width: 200px;"><strong>Path*: </strong></td>
<td class="tableContainer-valueCell" >
- <input type="text" name="path"
+ <input type="text" name="preferencesProviderPath"
id="preferencesProvider.path"
data-dojo-type="dijit.form.ValidationTextBox"
data-dojo-props="placeHolder: 'Path/to/file',
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/common/TimeZoneSelector.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/common/TimeZoneSelector.html
index 7027a4555c..2b2fca7d8a 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/common/TimeZoneSelector.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/common/TimeZoneSelector.html
@@ -20,36 +20,47 @@
-->
<table cellpadding="0" cellspacing="2">
<tr>
- <td>Region</td>
+ <td class="labelClass"><strong>Use UTC time:</strong></td>
<td>
- <select class='timezoneRegion' name="region" data-dojo-type="dijit/form/FilteringSelect" data-dojo-props="
- placeholder: 'Select region',
- required: true,
- missingMessage: 'A region must be supplied',
- title: 'Select region',
- autoComplete: true,
- value:'undefined'">
- <option value="undefined">Undefined</option>
- <option value="Africa">Africa</option>
- <option value="America">America</option>
- <option value="Antarctica">Antarctica</option>
- <option value="Arctic">Arctic</option>
- <option value="Asia">Asia</option>
- <option value="Atlantic">Atlantic</option>
- <option value="Australia">Australia</option>
- <option value="Europe">Europe</option>
- <option value="Indian">Indian</option>
- <option value="Pacific">Pacific</option>
- </select>
+ <input type="checkbox" class='utcSelector' name="utc" data-dojo-type="dijit/form/CheckBox" value="UTC"></input>
</td>
- <td>City</td>
+ </tr>
+ <tr>
+ <td class="labelClass"><strong>Time Zone:</strong></td>
<td>
- <select class='timezoneCity' name="city" data-dojo-type="dijit/form/FilteringSelect" data-dojo-props="
- placeholder: 'Select city',
- required: true,
- missingMessage: 'A city must be supplied',
- title: 'Select city'">
- </select>
- </td>
+ <table cellpadding="0" cellspacing="2">
+ <tr>
+ <td>Region</td>
+ <td><select class='timezoneRegion' name="region" data-dojo-type="dijit/form/FilteringSelect"
+ data-dojo-props="
+ placeholder: 'Select region',
+ required: true,
+ missingMessage: 'A region must be supplied',
+ title: 'Select region',
+ autoComplete: true,
+ value:'undefined'">
+ <option value="undefined">Undefined</option>
+ <option value="Africa">Africa</option>
+ <option value="America">America</option>
+ <option value="Antarctica">Antarctica</option>
+ <option value="Arctic">Arctic</option>
+ <option value="Asia">Asia</option>
+ <option value="Atlantic">Atlantic</option>
+ <option value="Australia">Australia</option>
+ <option value="Europe">Europe</option>
+ <option value="Indian">Indian</option>
+ <option value="Pacific">Pacific</option>
+ </select></td>
+ <td>City</td>
+ <td><select class='timezoneCity' name="city" data-dojo-type="dijit/form/FilteringSelect"
+ data-dojo-props="
+ placeholder: 'Select city',
+ required: true,
+ missingMessage: 'A city must be supplied',
+ title: 'Select city'">
+ </select></td>
+ </tr>
+ </table>
+ </td>
</tr>
</table> \ No newline at end of file
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
index 4fc961ec12..f17e8d8bba 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
@@ -57,32 +57,24 @@
</script>
<script>
- var qpidHelpLocation = "http://qpid.apache.org/releases/qpid-";
- var qpidHelpURL = null;
- var qpidPreferences = null;
+ var qpidManagementHelper = null;
require([
- "dojo/_base/xhr",
"dojo/parser",
- "qpid/management/Preferences",
+ "qpid/authorization/checkUser",
+ "qpid/common/ConsoleHelper",
"dijit/layout/BorderContainer",
"dijit/layout/TabContainer",
"dijit/layout/ContentPane",
"dijit/TitlePane",
- "dojo/parser",
+ "dijit/Menu",
+ "dijit/MenuItem",
"qpid/management/treeView",
"qpid/management/controller",
- "qpid/common/footer",
- "qpid/authorization/checkUser"], function(xhr, parser, Preferences){
+ "qpid/common/footer"
+ ], function(parser, User, ConsoleHelper){
parser.parse();
- qpidPreferences = new Preferences();
- xhr.get({
- sync: true,
- url: "rest/helper?action=version",
- handleAs: "json"
- }).then(function(qpidVersion) {
- qpidHelpURL = qpidHelpLocation + qpidVersion + "/java-broker/book/index.html";
- });
-
+ qpidManagementHelper = ConsoleHelper;
+ User.getUserAndUpdateUI();
});
</script>
@@ -93,25 +85,17 @@
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
<div id="header" class="header" style="float: left; width: 300px"></div>
<div style="float: right;">
- <div id="login" style="display:none"><strong>User: </strong> <span id="authenticatedUser"></span><a href="logout">[logout]</a></div>
- <div id="preferencesButton" style="float: right; margin-top: 0px;" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'preferencesIcon', title: 'Preferences', showLabel:false">
+ <div id="login" style="display:none"><span id="authenticatedUser" style="display:none"></span>
+ <div id="authenticatedUserControls" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'preferencesIcon', style:{'max-width': '100px'}">
<div data-dojo-type="dijit.Menu">
- <div data-dojo-type="dijit.MenuItem" data-dojo-props="
- iconClass: 'dijitIconFunction',
- onClick: function(){ qpidPreferences.showDialog(); } ">
- Preferences
- </div>
- <!--
- <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass: 'dijitIconMail', onClick: function(){ console.log('TODO'); }">
- Contacts
- </div>
- -->
- <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass: 'helpIcon', onClick: function(){
- var newWindow = window.open(qpidHelpURL,'QpidHelp','height=600,width=600,scrollbars=1,location=1,resizable=1,status=0,toolbar=0,titlebar=1,menubar=0',true); newWindow.focus(); } ">
- Help
- </div>
+ <div data-dojo-type="dijit.MenuItem" data-dojo-props="onClick: function(){window.location='logout';}" >Log out</div>
+ <div data-dojo-type="dijit.MenuItem"
+ data-dojo-props="iconClass:'dijitIconFunction',onClick: function(){qpidManagementHelper.showPreferencesDialog();}">Preferences</div>
+ <div data-dojo-type="dijit.MenuItem"
+ data-dojo-props="iconClass: 'helpIcon', onClick: function(){qpidManagementHelper.showHelp();}">Help</div>
</div>
- </div>
+ </div>
+ </div>
</div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'leading', splitter: true" style="width:20%">
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js
index d65e6c6e07..be9bef3519 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js
@@ -19,19 +19,27 @@
*
*/
-require(["dojo/dom",
+define(["dojo/dom",
"qpid/authorization/sasl",
+ "dijit/registry",
"dojox/html/entities",
- "dojo/domReady!"], function(dom, sasl, entities){
+ "dojo/domReady!"], function(dom, sasl, registry, entities){
var updateUI = function updateUI(data)
{
if(data.user)
{
- dom.byId("authenticatedUser").innerHTML = entities.encode(String(data.user));
- dom.byId("login").style.display = "inline";
+ var userName = entities.encode(String(data.user));
+ var controlButton = registry.byId("authenticatedUserControls");
+ if (controlButton)
+ {
+ controlButton.set("label", userName);
+ }
+ dom.byId("authenticatedUser").innerHTML = userName;
+ dom.byId("login").style.display = "inline";
}
};
-sasl.getUser(updateUI);
+return {getUserAndUpdateUI: function(){sasl.getUser(updateUI);}}
+
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/sasl.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/sasl.js
index 33e736322f..2d99f886ed 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/sasl.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/sasl.js
@@ -18,7 +18,8 @@
* under the License.
*
*/
-define(["dojo/_base/xhr", "dojox/encoding/base64", "dojox/encoding/digests/_base", "dojox/encoding/digests/MD5"], function () {
+define(["dojo/_base/xhr", "dojox/encoding/base64", "dojox/encoding/digests/_base", "dojox/encoding/digests/MD5"],
+ function (xhr, base64, digestsBase, MD5) {
var encodeUTF8 = function encodeUTF8(str) {
var byteArray = [];
@@ -65,7 +66,7 @@ var errorHandler = function errorHandler(error)
var saslPlain = function saslPlain(user, password, callbackFunction)
{
var responseArray = [ 0 ].concat(encodeUTF8( user )).concat( [ 0 ] ).concat( encodeUTF8( password ) );
- var plainResponse = dojox.encoding.base64.encode(responseArray);
+ var plainResponse = base64.encode(responseArray);
// Using dojo.xhrGet, as very little information is being sent
dojo.xhrPost({
@@ -95,19 +96,19 @@ var saslCramMD5 = function saslCramMD5(user, password, saslMechanism, callbackFu
}).then(function(data)
{
- var challengeBytes = dojox.encoding.base64.decode(data.challenge);
+ var challengeBytes = base64.decode(data.challenge);
var wa=[];
var bitLength = challengeBytes.length*8;
for(var i=0; i<bitLength; i+=8)
{
wa[i>>5] |= (challengeBytes[i/8] & 0xFF)<<(i%32);
}
- var challengeStr = dojox.encoding.digests.wordToString(wa).substring(0,challengeBytes.length);
+ var challengeStr = digestsBase.wordToString(wa).substring(0,challengeBytes.length);
- var digest = user + " " + dojox.encoding.digests.MD5._hmac(challengeStr, password, dojox.encoding.digests.outputTypes.Hex);
+ var digest = user + " " + MD5._hmac(challengeStr, password, digestsBase.outputTypes.Hex);
var id = data.id;
- var response = dojox.encoding.base64.encode(encodeUTF8( digest ));
+ var response = base64.encode(encodeUTF8( digest ));
dojo.xhrPost({
// The URL of the request
@@ -162,7 +163,7 @@ SaslClient.authenticate = function(username, password, callbackFunction)
}
else if (containsMechanism(mechMap, "CRAM-MD5-HEX"))
{
- var hashedPassword = dojox.encoding.digests.MD5(password, dojox.encoding.digests.outputTypes.Hex);
+ var hashedPassword = MD5(password, digestsBase.outputTypes.Hex);
saslCramMD5(username, hashedPassword, "CRAM-MD5-HEX", callbackFunction);
}
else if (containsMechanism(mechMap, "PLAIN"))
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js
new file mode 100644
index 0000000000..fdc07f27ca
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js
@@ -0,0 +1,73 @@
+/*
+ *
+ * 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.
+ *
+ */
+define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr) {
+
+ var qpidHelpLocation = "http://qpid.apache.org/releases/qpid-";
+ var preferencesDialog = null;
+ var helpURL = null;
+ var qpidVersion = null;
+
+ return {
+ showPreferencesDialog: function () {
+ if (preferencesDialog == null)
+ {
+ require(["qpid/management/Preferences", "dojo/ready"], function(PreferencesDialog, ready){
+ ready(function(){
+ preferencesDialog = new PreferencesDialog();
+ preferencesDialog.showDialog();
+ });
+ });
+ }
+ else
+ {
+ preferencesDialog.showDialog();
+ }
+ },
+ getVersion: function()
+ {
+ if (!qpidVersion)
+ {
+ xhr.get({
+ sync: true,
+ url: "rest/helper?action=version",
+ handleAs: "json"
+ }).then(function(version) {
+ qpidVersion = version;
+ });
+ }
+ return qpidVersion;
+ },
+ getHelpUrl: function()
+ {
+ if (!helpURL)
+ {
+ helpURL = qpidHelpLocation + this.getVersion() + "/java-broker/book/index.html";
+ }
+ return helpURL;
+ },
+ showHelp: function()
+ {
+ var newWindow = window.open(this.getHelpUrl(),'QpidHelp','height=600,width=600,scrollbars=1,location=1,resizable=1,status=0,toolbar=0,titlebar=1,menubar=0', true);
+ newWindow.focus();
+ }
+ };
+
+});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/TimeZoneSelector.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/TimeZoneSelector.js
index 287fbc9619..fa4bd8c873 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/TimeZoneSelector.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/TimeZoneSelector.js
@@ -24,43 +24,22 @@ define([
"dojo/dom-construct",
"dojo/parser",
"dojo/query",
+ "dojo/dom-style",
"dojo/store/Memory",
"dijit/_WidgetBase",
"dijit/registry",
"dojo/text!common/TimeZoneSelector.html",
+ "qpid/common/timezone",
"dijit/form/ComboBox",
"dijit/form/FilteringSelect",
- "dojox/date/timezone",
+ "dijit/form/CheckBox",
"dojox/validate/us",
"dojox/validate/web",
"dojo/domReady!"],
-function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, registry, template) {
+function (declare, array, domConstruct, parser, query, domStyle, Memory, _WidgetBase, registry, template, timezone) {
var preferencesRegions = ["Africa","America","Antarctica","Arctic","Asia","Atlantic","Australia","Europe","Indian","Pacific"];
- function initSupportedTimeZones()
- {
- var supportedTimeZones = [];
- var allTimeZones = dojox.date.timezone.getAllZones();
- for(var i = 0; i < allTimeZones.length; i++)
- {
- var timeZone = allTimeZones[i];
- var elements = timeZone.split("/");
- if (elements.length > 1)
- {
- for(var j = 0; j<preferencesRegions.length; j++)
- {
- if (elements[0] == preferencesRegions[j])
- {
- supportedTimeZones.push({id: timeZone, region: elements[0], city: elements.slice(1).join("/").replace("_", " ") })
- break;
- }
- }
- }
- }
- return supportedTimeZones;
- }
-
function initSupportedRegions()
{
var supportedRegions = [{"id": "undefined", "name": "Undefined"}];
@@ -77,6 +56,7 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
domNode: null,
_regionSelector: null,
_citySelector: null,
+ _utcSelector: null,
constructor: function(args)
{
@@ -91,8 +71,17 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
postCreate: function(){
this.inherited(arguments);
- var supportedTimeZones = initSupportedTimeZones();
+ var self = this;
+ if (this._args.labelStyle)
+ {
+ var nl = query(".labelClass", this.domNode);
+ array.forEach(nl, function(entry, i){
+ domStyle.set(entry, self._args.labelStyle)
+ });
+ }
+ var supportedTimeZones = timezone.getAllTimeZones();
+ this._utcSelector = registry.byNode(query(".utcSelector", this.domNode)[0]);
this._citySelector = registry.byNode(query(".timezoneCity", this.domNode)[0]);
this._citySelector.set("searchAttr", "city");
this._citySelector.set("query", {region: /.*/});
@@ -105,8 +94,28 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
this._regionSelector = registry.byNode(query(".timezoneRegion", this.domNode)[0]);
var supportedRegions = initSupportedRegions();
this._regionSelector.set("store", new Memory({ data: supportedRegions }));
- var self = this;
+ this._utcSelector.on("change", function(value){
+ var checked = this.get("checked");
+ if (checked)
+ {
+ self.value ="UTC";
+ }
+ else
+ {
+ if (self._citySelector.value && self._regionSelector.value)
+ {
+ self.value = self._citySelector.value;
+ }
+ else
+ {
+ self.value = null;
+ }
+ }
+ self._citySelector.set("disabled", checked);
+ self._regionSelector.set("disabled", checked);
+ self._handleOnChange(self.value);
+ });
this._regionSelector.on("change", function(value){
if (value=="undefined")
{
@@ -114,6 +123,7 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
self._citySelector.query.region = /.*/;
self.value = null;
self._citySelector.set("value", null);
+ self._handleOnChange(self.value);
}
else
{
@@ -133,6 +143,7 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
this._citySelector.on("change", function(value){
self.value = value;
+ self._handleOnChange(value);
});
this._setValueAttr(this._args.value);
@@ -142,23 +153,33 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
{
if (value)
{
- var elements = value.split("/");
- if (elements.length > 1)
+ if (value == "UTC")
{
- this._regionSelector.timeZone = value;
- this._regionSelector.set("value", elements[0]);
- this._citySelector.set("value", value);
+ this._utcSelector.set("checked", true);
}
else
{
- this._regionSelector.set("value", "undefined");
+ this._utcSelector.set("checked", false);
+ var elements = value.split("/");
+ if (elements.length > 1)
+ {
+ this._regionSelector.timeZone = value;
+ this._regionSelector.set("value", elements[0]);
+ this._citySelector.set("value", value);
+ }
+ else
+ {
+ this._regionSelector.set("value", "undefined");
+ }
}
}
else
{
+ this._utcSelector.set("checked", false);
this._regionSelector.set("value", "undefined");
}
this.value = value;
+ this._handleOnChange(value);
},
destroy: function()
@@ -170,6 +191,26 @@ function (declare, array, domConstruct, parser, query, Memory, _WidgetBase, regi
}
_regionSelector: null;
_citySelector: null;
+ _utcSelector: null;
+ },
+
+ onChange: function(newValue){},
+
+ _handleOnChange: function(newValue)
+ {
+ if (this._lastValueReported != newValue)
+ {
+ this._lastValueReported = newValue;
+ if(this._onChangeHandle)
+ {
+ this._onChangeHandle.remove();
+ }
+ this._onChangeHandle = this.defer(function()
+ {
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ });
+ }
}
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilter.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilter.js
index 9c0baf3111..262210f879 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilter.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilter.js
@@ -89,16 +89,14 @@ define([
if(typeof args.ruleCount != 'number' || args.ruleCount < 0){
args.ruleCount = 0;
}
- var rc = this.ruleCountToConfirmClearFilter = args.ruleCountToConfirmClearFilter;
- if(rc === undefined){
- this.ruleCountToConfirmClearFilter = 5;
- }
+ this.ruleCountToConfirmClearFilter = args.ruleCountToConfirmClearFilter || 5;
if (args.filterHidden){
this.filterHidden = args.filterHidden;
}
this.defaulGridRowLimit = args.defaulGridRowLimit;
this.disableFiltering = args.disableFiltering;
+ this.displayLastUpdateTime = args.displayLastUpdateTime;
//Install UI components
var obj = { "plugin": this };
@@ -117,6 +115,7 @@ define([
});
this.filterDefDialog = new FilterDefDialog(obj);
+ this.filterDefDialog.filterDefPane._clearFilterBtn.set("label", "Clear Filter");
nls["statusTipTitleNoFilter"] = "Filter is not set";
nls["statusTipMsg"] = "Click on 'Set Filter' button to specify filtering conditions";
@@ -149,7 +148,9 @@ define([
filterDefDialog: this.filterDefDialog,
defaulGridRowLimit: this.defaulGridRowLimit,
disableFiltering: this.disableFiltering,
- nls: nls
+ displayLastUpdateTime: this.displayLastUpdateTime,
+ nls: nls,
+ ruleCountToConfirmClearFilter: this.ruleCountToConfirmClearFilter
});
this.filterBar.placeAt(this.grid.viewsHeaderNode, "before");
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilterTools.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilterTools.js
index b1645b4905..187ed8cfc6 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilterTools.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/EnhancedFilterTools.js
@@ -22,12 +22,15 @@
define([
"dojo/_base/declare",
"dojo/_base/event",
+ "dojo/dom-construct",
+ "dojo/date/locale",
"dijit/form/Button",
"dijit/form/ToggleButton",
"qpid/common/grid/RowNumberLimitDialog",
"qpid/common/grid/ColumnDefDialog",
- "qpid/common/grid/FilterSummary"
-], function(declare, event, Button, ToggleButton, RowNumberLimitDialog, ColumnDefDialog, FilterSummary){
+ "qpid/common/grid/FilterSummary",
+ "qpid/management/UserPreferences"
+], function(declare, event, domConstruct, locale, Button, ToggleButton, RowNumberLimitDialog, ColumnDefDialog, FilterSummary, UserPreferences){
var _stopEvent = function (evt){
try{
@@ -64,6 +67,8 @@ define([
this.filterStatusTip= params.filterStatusTip;
this.clearFilterDialog = params.clearFilterDialog;
this.filterDefDialog = params.filterDefDialog;
+ this.ruleCountToConfirmClearFilter = params.ruleCountToConfirmClearFilter;
+ this.displayLastUpdateTime = params.hasOwnProperty("displayLastUpdateTime")?params.displayLastUpdateTime:true;
this._addRefreshButtons();
this._addRowLimitButton(params.defaulGridRowLimit);
@@ -167,6 +172,38 @@ define([
this.filterBar.addChild(this.autoRefreshButton);
this.filterBar.addChild(this.refreshButton);
+
+ if (this.displayLastUpdateTime)
+ {
+ var updateStatusPanel = domConstruct.create("div");
+ var updateTimeLabel = domConstruct.create("span", {innerHTML: "Update time: ", "class": "formLabel-labelCell", "style": "padding-right: 5px;padding-left: 5px"}, updateStatusPanel);
+ var updateTimeLabelPreferredTZ = domConstruct.create("span", {innerHTML: "Preferred timezone:", "style": "padding-right: 5px"}, updateStatusPanel);
+ var updateTimePreferredTZ = domConstruct.create("span", {"style": "padding-right: 5px"}, updateStatusPanel);
+ var updateTimeLabelBrowserTZ = domConstruct.create("span", {innerHTML: "Browser timezone:", "style": "padding-right: 5px"}, updateStatusPanel);
+ var updateTimeBrowserTZ = domConstruct.create("span", {"style": "padding-right: 5px"}, updateStatusPanel);
+
+ var lastUpdateTimeUpdater = function(data)
+ {
+ var userTimeZone = UserPreferences.timeZone;
+ var displayStyle = userTimeZone? "inline" : "none";
+ updateTimeLabelPreferredTZ.style.display = displayStyle;
+ updateTimePreferredTZ.style.display = displayStyle;
+ var formatOptions = {selector: "time", timePattern: "HH:mm:ss.SSS", appendTimeZone: true, addOffset: true};
+ var updateTime = new Date();
+ updateTimePreferredTZ.innerHTML = UserPreferences.formatDateTime(updateTime.getTime(), formatOptions);
+ updateTimeBrowserTZ.innerHTML = locale.format(updateTime, formatOptions);
+ };
+
+ if (self.grid.updater.store)
+ {
+ // data have been already provided/or fetched
+ // set last update time to current time
+ lastUpdateTimeUpdater();
+ }
+
+ self.grid.updater.addOnUpdate(lastUpdateTimeUpdater);
+ domConstruct.place(updateStatusPanel, this.grid.viewsHeaderNode, "before");
+ }
},
_addRowLimitButton: function(defaulGridRowLimit)
@@ -240,6 +277,9 @@ define([
this.filterDefButton.on("click", function(e){
_stopEvent(e);
+
+ // a bit of a hack to force dialog to rebuild the criteria controls in order to get rid from empty rule controls
+ self.filterDefDialog._criteriasChanged = true;
self.filterDefDialog.showDialog();
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js
index 7016e4eb5b..8d58b6dec0 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js
@@ -39,7 +39,12 @@ define(["dojo/_base/xhr",
this.updatable = args.hasOwnProperty("updatable") ? args.updatable : true ;
this.serviceUrl = args.serviceUrl;
- this.onUpdate = args.onUpdate;
+ this.onUpdate = [];
+ if (args.onUpdate)
+ {
+ this.onUpdate.push(args.onUpdate);
+ }
+ this.dataTransformer = args.dataTransformer;
this.appendData = args.append;
this.appendLimit = args.appendLimit;
@@ -122,6 +127,10 @@ define(["dojo/_base/xhr",
function processData(data)
{
+ if (self.dataTransformer)
+ {
+ data = self.dataTransformer(data);
+ }
var dataSet = false;
if (!store)
{
@@ -141,17 +150,10 @@ define(["dojo/_base/xhr",
if (data)
{
- try
- {
- if ((dataSet || self.updateOrAppend(data)) && self.onUpdate)
- {
- self.onUpdate(data);
- }
- }
- catch(e)
- {
- console.error(e);
- }
+ if ((dataSet || self.updateOrAppend(data)) && self.onUpdate.length > 0)
+ {
+ self.fireUpdate(data);
+ }
}
};
@@ -186,6 +188,7 @@ define(["dojo/_base/xhr",
this.store = null;
this.memoryStore = null;
this.grid = null;
+ this.onUpdate = null;
};
GridUpdater.prototype.updateOrAppend = function(data)
@@ -197,6 +200,10 @@ define(["dojo/_base/xhr",
GridUpdater.prototype.refresh = function(data)
{
+ if (this.dataTransformer && data)
+ {
+ data = this.dataTransformer(data);
+ }
this.updating = true;
try
{
@@ -223,10 +230,7 @@ define(["dojo/_base/xhr",
finally
{
this.updating = false;
- if (this.onUpdate)
- {
- this.onUpdate(data);
- }
+ this.fireUpdate(data);
}
}
@@ -254,5 +258,40 @@ define(["dojo/_base/xhr",
}
};
+ GridUpdater.prototype.fireUpdate=function(data)
+ {
+ if (this.onUpdate.length > 0)
+ {
+ for(var i=0; i<this.onUpdate.length;i++)
+ {
+ var onUpdate= this.onUpdate[i];
+ try
+ {
+ onUpdate(data);
+ }
+ catch(e)
+ {
+ if (console && console.error)
+ {
+ console.error(e);
+ }
+ }
+ }
+ }
+ };
+
+ GridUpdater.prototype.addOnUpdate = function(obj) {
+ this.onUpdate.push(obj);
+ };
+
+ GridUpdater.prototype.removeOnUpdate = function(obj) {
+ for(var i = 0; i < this.onUpdate.length; i++) {
+ if(this.onUpdate[i] === obj) {
+ this.onUpdate.splice(i,1);
+ return;
+ }
+ }
+ };
+
return GridUpdater;
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js
new file mode 100644
index 0000000000..d03b44843a
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js
@@ -0,0 +1,95 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+define(["dojo/_base/xhr"], function (xhr) {
+
+ var timezones = {};
+
+ var timeZoneSortFunction = function(a, b){
+ if (a.region == b.region)
+ {
+ if (a.city == b.city)
+ {
+ return 0;
+ }
+ return a.city < b.city ? -1 : 1;
+ }
+ return a.region < b.region ? -1 : 1;
+ }
+
+ function loadTimezones()
+ {
+ xhr.get({
+ url: "rest/helper?action=ListTimeZones",
+ sync: true,
+ handleAs: "json",
+ load: function(zones)
+ {
+ zones.sort(timeZoneSortFunction);
+ timezones.data = zones;
+ },
+ error: function(error)
+ {
+ if (console && console.error)
+ {
+ console.error(error);
+ }
+ }
+ });
+ }
+
+ return {
+ getAllTimeZones: function()
+ {
+ if (!timezones.data)
+ {
+ loadTimezones();
+ }
+ return timezones.data;
+ },
+ getTimeZoneInfo: function(timeZone) {
+ if (timeZone == "UTC")
+ {
+ return {
+ "id" : "UTC",
+ "name" : "UTC",
+ "offset" : 0
+ }
+ }
+ var tzi = timezones[timeZone];
+ if (!tzi)
+ {
+ var data = this.getAllTimeZones();
+ for(var i = 0; i < data.length; i++)
+ {
+ var zone = data[i];
+ if (zone.id == timeZone)
+ {
+ tzi = zone;
+ timezones[timeZone] = zone;
+ break;
+ }
+ }
+ }
+ return tzi;
+ }
+ };
+}); \ No newline at end of file
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js
index 86bbaa46ba..f31fd1aa1f 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js
@@ -18,15 +18,35 @@
* under the License.
*
*/
-define(function () {
+define(["qpid/management/UserPreferences"], function (UserPreferences) {
var updateList = new Array();
- setInterval(function() {
- for(var i = 0; i < updateList.length; i++) {
- var obj = updateList[i];
- obj.update();
- }
- }, 5000); // TODO: Should make this configurable
+ function invokeUpdates()
+ {
+ for(var i = 0; i < updateList.length; i++)
+ {
+ var obj = updateList[i];
+ obj.update();
+ }
+ }
+
+ var updatePeriod = UserPreferences.updatePeriod ? UserPreferences.updatePeriod: 5;
+
+ var timer = setInterval(invokeUpdates, updatePeriod * 1000);
+
+ var updateIntervalListener = {
+ onPreferencesChange: function(preferences)
+ {
+ if (preferences.updatePeriod && preferences.updatePeriod != updatePeriod)
+ {
+ updatePeriod = preferences.updatePeriod;
+ clearInterval(timer);
+ timer = setInterval(invokeUpdates, updatePeriod * 1000);
+ }
+ }
+ };
+
+ UserPreferences.addListener(updateIntervalListener);
return {
add: function(obj) {
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
index b5b4380a0d..4e96f2e5a4 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
@@ -237,18 +237,15 @@ define(["dojo/_base/xhr",
}
}
var preferencesProviderData = that.authProviderData.preferencesproviders? that.authProviderData.preferencesproviders[0]: null;
- if (preferencesProviderData)
+ try
{
- try
- {
- that.updatePreferencesProvider(preferencesProviderData);
- }
- catch(e)
+ that.updatePreferencesProvider(preferencesProviderData);
+ }
+ catch(e)
+ {
+ if (console)
{
- if (console)
- {
- console.error(e);
- }
+ console.error(e);
}
}
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Preferences.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Preferences.js
index 735a657c61..64299d62f6 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Preferences.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Preferences.js
@@ -34,6 +34,7 @@ define([
"qpid/common/TimeZoneSelector",
"dojo/text!../../showPreferences.html",
"qpid/common/util",
+ "qpid/management/UserPreferences",
"dijit/Dialog",
"dijit/form/NumberSpinner",
"dijit/form/CheckBox",
@@ -43,26 +44,26 @@ define([
"dijit/form/DropDownButton",
"dijit/form/Button",
"dijit/form/Form",
+ "dijit/layout/BorderContainer",
"dijit/layout/TabContainer",
"dijit/layout/ContentPane",
"dojox/grid/EnhancedGrid",
"dojox/validate/us",
"dojox/validate/web",
"dojo/domReady!"],
-function (declare, xhr, event, connect, dom, domConstruct, parser, json, Memory, ObjectStore, entities, registry, TimeZoneSelector, markup, util) {
+function (declare, xhr, event, connect, dom, domConstruct, parser, json, Memory, ObjectStore, entities, registry, TimeZoneSelector, markup, util, UserPreferences) {
- var preferenceNames = ["timeZone", "updatePeriod", "saveTabs"];
+ var preferenceNames = ["timeZone", "updatePeriod"];
return declare("qpid.management.Preferences", null, {
preferencesDialog: null,
- saveButton: null,
- cancelButton: null,
constructor: function()
{
var that = this;
+ this.userPreferences = {};
this.domNode = domConstruct.create("div", {innerHTML: markup});
this.preferencesDialog = parser.parse(this.domNode)[0];
@@ -70,84 +71,41 @@ function (declare, xhr, event, connect, dom, domConstruct, parser, json, Memory,
{
var name = preferenceNames[i];
this[name] = registry.byId("preferences." + name);
+ this[name].on("change", function(val){that._toggleSetButtons();});
}
- this.saveButton = registry.byId("preferences.saveButton");
- this.cancelButton = registry.byId("preferences.cancelButton");
+ this.setButton = registry.byId("preferences.setButton");
+ this.setAndCloseButton = registry.byId("preferences.setAndCloseButton");
+ this.setButton.on("click", function(e){that._savePreferences(e, false);});
+ this.setAndCloseButton.on("click", function(e){that._savePreferences(e, true);});
this.theForm = registry.byId("preferences.preferencesForm");
- this.users = registry.byId("preferences.users");
- this.users.set("structure", [ { name: "User", field: "name", width: "50%"},
+ this.usersGrid = registry.byId("preferences.users");
+ this.usersGrid.set("structure", [ { name: "User", field: "name", width: "50%"},
{ name: "Authentication Provider", field: "authenticationProvider", width: "50%"}]);
- this.cancelButton.on("click", function(){that.preferencesDialog.hide();});
- this.deletePreferencesButton = registry.byId("preferences.deletePreeferencesButton");
- this.deletePreferencesButton.on("click", function(){
- if (util.deleteGridSelections(
- null,
- that.users,
- "rest/userpreferences",
- "Are you sure you want to delete preferences for user",
- "user"))
- {
- that._updateUsersWithPreferences();
- }
- });
+ this.deleteButton = registry.byId("preferences.deleteButton");
+ this.deleteAndCloseButton = registry.byId("preferences.deleteAndCloseButton");
+ this.deleteButton.on("click", function(e){that._deletePreferences(false);});
+ this.deleteAndCloseButton.on("click", function(e){that._deletePreferences(true);});
+
var deletePreferencesButtonToggler = function(rowIndex){
- var data = that.users.selection.getSelected();
- that.deletePreferencesButton.set("disabled",!data.length );
+ var data = that.usersGrid.selection.getSelected();
+ that.deleteButton.set("disabled",!data.length );
+ that.deleteAndCloseButton.set("disabled",!data.length );
};
- connect.connect(this.users.selection, 'onSelected', deletePreferencesButtonToggler);
- connect.connect(this.users.selection, 'onDeselected', deletePreferencesButtonToggler);
- this.theForm.on("submit", function(e){
- event.stop(e);
- if(that.theForm.validate()){
- var preferences = {};
- for(var i=0; i<preferenceNames.length; i++)
- {
- var name = preferenceNames[i];
- var preferenceWidget = that[name];
- if (preferenceWidget)
- {
- preferences[name] = preferenceWidget.get("value");
- }
- }
- xhr.post({
- url: "rest/preferences",
- sync: true,
- handleAs: "json",
- headers: { "Content-Type": "application/json"},
- postData: json.stringify(preferences),
- load: function(x) {that.success = true; },
- error: function(error) {that.success = false; that.failureReason = error;}
- });
- if(that.success === true)
- {
- that.preferencesDialog.hide();
- }
- else
- {
- alert("Error:" + that.failureReason);
- }
- }
- return false;
- });
+ connect.connect(this.usersGrid.selection, 'onSelected', deletePreferencesButtonToggler);
+ connect.connect(this.usersGrid.selection, 'onDeselected', deletePreferencesButtonToggler);
+ this.theForm.on("submit", function(e){event.stop(e); return false;});
+
+ this._setValues();
+
+ deletePreferencesButtonToggler();
this.preferencesDialog.startup();
},
showDialog: function(){
- var that = this;
- xhr.get({
- url: "rest/preferences",
- sync: true,
- handleAs: "json",
- load: function(data) {
- that._updatePreferencesWidgets(data);
- that._updateUsersWithPreferences();
- that.preferencesDialog.show();
- },
- error: function(error){
- alert("Cannot load user preferences : " + error);
- }
- });
+ this._setValues();
+ this._loadUserPreferences();
+ this.preferencesDialog.show();
},
destroy: function()
@@ -159,24 +117,114 @@ function (declare, xhr, event, connect, dom, domConstruct, parser, json, Memory,
}
},
- _updatePreferencesWidgets: function(data)
+ _savePreferences: function(e, hideDialog)
{
- for(var i=0; i<preferenceNames.length; i++)
+ var that =this;
+ event.stop(e);
+ if(this.theForm.validate()){
+ var preferences = {};
+ for(var i=0; i<preferenceNames.length; i++)
+ {
+ var name = preferenceNames[i];
+ var preferenceWidget = this[name];
+ if (preferenceWidget)
+ {
+ preferences[name] = preferenceWidget.hasOwnProperty("checked") ? preferenceWidget.checked : preferenceWidget.get("value");
+ }
+ }
+
+ UserPreferences.setPreferences(
+ preferences,
+ function(preferences)
+ {
+ success = true;
+ if (hideDialog)
+ {
+ that.preferencesDialog.hide();
+ }
+ else
+ {
+ var reloadUsers = true;
+ if (that.users)
+ {
+ var authenticatedUser = dom.byId("authenticatedUser").innerHTML;
+ for(var i=0; i<that.users.length; i++)
+ {
+ if (that.users[i].name == authenticatedUser)
+ {
+ reloadUsers = false;
+ break;
+ }
+ }
+ }
+ if (reloadUsers)
+ {
+ that._loadUserPreferences();
+ }
+ }
+ that._toggleSetButtons();
+ },
+ function(error){alert("Error:" + error);}
+ );
+ }
+ },
+
+ _deletePreferences: function(hideDialog){
+ var data = this.usersGrid.selection.getSelected();
+ if (util.deleteGridSelections(
+ null,
+ this.usersGrid,
+ "rest/userpreferences",
+ "Are you sure you want to delete preferences for user",
+ "user"))
+ {
+ this._loadUserPreferences();
+ var authenticatedUser = dom.byId("authenticatedUser").innerHTML;
+ for(i = 0; i<data.length; i++)
+ {
+ if (data[i].name == authenticatedUser)
+ {
+ UserPreferences.resetPreferences();
+ this._setValues();
+ break;
+ }
+ }
+ if (hideDialog)
+ {
+ this.preferencesDialog.hide();
+ }
+ }
+ },
+
+ _setValues: function()
+ {
+ for(var i = 0; i < preferenceNames.length; i++)
{
- var preference = preferenceNames[i];
- if (this.hasOwnProperty(preference))
+ var name = preferenceNames[i];
+ var preferenceWidget = this[name];
+ if (preferenceWidget)
{
- var value = data ? data[preference] : null;
+ var value = UserPreferences[name]
if (typeof value == "string")
{
value = entities.encode(String(value))
}
- this[preference].set("value", value);
+ if (!value && name == "updatePeriod")
+ {
+ // set to default
+ value = 5;
+ }
+ preferenceWidget.set("value", value);
+ if (preferenceWidget.hasOwnProperty("checked"))
+ {
+ preferenceWidget.set("checked", UserPreferences[name] ? true : false);
+ }
}
}
+ this._toggleSetButtons();
},
- _updateUsersWithPreferences: function()
+ _loadUserPreferences : function()
{
var that = this;
xhr.get({
@@ -189,15 +237,37 @@ function (declare, xhr, event, connect, dom, domConstruct, parser, json, Memory,
{
users[i].id = users[i].authenticationProvider + "/" + users[i].name;
}
+ that.users = users;
var usersStore = new Memory({data: users, idProperty: "id"});
var usersDataStore = new ObjectStore({objectStore: usersStore});
- if (that.users.store)
+ if (that.usersGrid.store)
{
- that.users.store.close();
+ that.usersGrid.store.close();
}
- that.users.set("store", usersDataStore);
- that.users._refresh();
+ that.usersGrid.set("store", usersDataStore);
+ that.usersGrid._refresh();
});
+ },
+
+ _toggleSetButtons: function()
+ {
+ var changed = false;
+ for(var i=0; i<preferenceNames.length; i++)
+ {
+ var name = preferenceNames[i];
+ var preferenceWidget = this[name];
+ if (preferenceWidget)
+ {
+ var value = preferenceWidget.hasOwnProperty("checked") ? preferenceWidget.checked : preferenceWidget.get("value");
+ if (value != UserPreferences[name])
+ {
+ changed = true;
+ break;
+ }
+ }
+ }
+ this.setButton.set("disabled", !changed);
+ this.setAndCloseButton.set("disabled", !changed);
}
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
new file mode 100644
index 0000000000..ebf06377f4
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
@@ -0,0 +1,189 @@
+/*
+ *
+ * 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.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/dom",
+ "dojo/query",
+ "dojo/parser",
+ "dojo/string",
+ "dojo/json",
+ "dojo/store/Memory",
+ "dijit/registry",
+ "dijit/form/FilteringSelect",
+ "dijit/form/ValidationTextBox",
+ "dojox/html/entities",
+ "dojo/text!../../showPreferencesProviderFields.html",
+ "dojo/text!rest/helper?action=ListPreferencesProvidersTypes",
+ "dojox/validate/us",
+ "dojox/validate/web",
+ "dojo/domReady!"], function (xhr, dom, query, parser, string, json, Memory, registry, FilteringSelect, ValidationTextBox, entities, template, preferencesProvidersTypes) {
+
+ var PreferencesProviderFields = {};
+
+ var types = [{id: "", name: "None"}];
+ var typesArray = json.parse(preferencesProvidersTypes);
+ for (var i =0 ; i < typesArray.length; i++)
+ {
+ types.push({id: typesArray[i], name: typesArray[i]});
+ }
+
+ var selectPreferencesProviderType = function(type)
+ {
+ if(type && string.trim(type) != "")
+ {
+ var disableOnEditing = PreferencesProviderFields.data? true: false;
+ PreferencesProviderFields.name.set("disabled", disableOnEditing);
+ PreferencesProviderFields.type.set("disabled", disableOnEditing);
+ if (PreferencesProviderFields.currentType != type)
+ {
+ require(["qpid/management/authenticationprovider/preferences/" + type.toLowerCase() + "/add"],
+ function(typeFields)
+ {
+ PreferencesProviderFields.currentType = null;
+ if (PreferencesProviderFields.details )
+ {
+ PreferencesProviderFields.details.destroy();
+ }
+ PreferencesProviderFields.details = typeFields;
+ typeFields.show(PreferencesProviderFields.fieldsContainer, PreferencesProviderFields.data);
+ PreferencesProviderFields.currentType = type;
+ });
+ }
+ else
+ {
+ PreferencesProviderFields.details.disable(false);
+ }
+ }
+ else
+ {
+ PreferencesProviderFields.disable(true);
+ }
+ };
+
+ PreferencesProviderFields.init = function(data)
+ {
+ this.data = data;
+ this.id.value = data.id;
+ this.name.set("value", data.name);
+ this.type.set("value", data.type);
+ selectPreferencesProviderType(data.type);
+ };
+
+ PreferencesProviderFields.show = function(node, provider, authenticationProviderName)
+ {
+ this.currentType = null;
+ this.data = null;
+ node.innerHTML = template;
+ try
+ {
+ parser.parse(node);
+ }
+ catch(e)
+ {
+ console.error(e);
+ return;
+ }
+
+ if (this.container)
+ {
+ this.container.destroyRecursive();
+ }
+ if (this.details )
+ {
+ this.details.destroy();
+ delete this["details"];
+ }
+ this.container = registry.byNode(query(".preferencesProviderContainer", node)[0]);
+ this.fieldsContainer = query(".preferencesProviderFieldsContainer", node)[0];
+ this.type = registry.byNode(query(".preferencesProviderType", node)[0]);
+ this.name = registry.byNode(query(".preferencesProviderName", node)[0]);
+ this.id = query("input[name='preferencesProviderId']", node)[0];
+ this.id.value = null;
+ this.type.set("store", new Memory({ data: types, idProperty: "id"}));
+ this.type.on("change", selectPreferencesProviderType );
+ this.type.startup();
+
+ if (provider)
+ {
+ if (typeof provider == "object")
+ {
+ this.init(provider);
+ }
+ else if (typeof provider == "string")
+ {
+ var that = this;
+ xhr.get({
+ url: "rest/preferencesprovider/" +encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(provider),
+ sync: true,
+ handleAs: "json"
+ }).then(function(data){if (data && data[0]) { that.init(data[0]);}});
+ }
+ }
+ else
+ {
+ this.disable(true);
+ }
+ };
+
+ PreferencesProviderFields.disable = function(val)
+ {
+ this.name.set("disabled", val);
+ if (this.details)
+ {
+ this.details.disable(val);
+ }
+ };
+
+ PreferencesProviderFields.getValues = function()
+ {
+ var values = {};
+ if (this.details)
+ {
+ values = this.details.getValues() || {};
+ }
+ values.name = this.name.get("value");
+ if (this.id.value)
+ {
+ values.id = this.id.value;
+ }
+ values.type = this.type.get("value");
+ return values;
+ };
+
+ PreferencesProviderFields.save = function(authenticationProviderName)
+ {
+ var success = true;
+ if (this.type.value)
+ {
+ var data = this.getValues();
+ xhr.put({url: "rest/preferencesprovider/" +encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(data.name),
+ sync: true,
+ handleAs: "json",
+ headers: { "Content-Type": "application/json"},
+ putData: json.stringify(data),
+ load: function(x) {success = true;},
+ error: function(error) {success = false; alert("Preferences Provider Error: " + error);}});
+ }
+ return success;
+ };
+
+ return PreferencesProviderFields;
+
+}); \ No newline at end of file
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
index a47b24d1ab..83974535a1 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
@@ -33,6 +33,7 @@ define(["dojo/_base/xhr",
"qpid/management/addBinding",
"qpid/management/moveCopyMessages",
"qpid/management/showMessage",
+ "qpid/management/UserPreferences",
"dojo/store/JsonRest",
"dojox/grid/EnhancedGrid",
"dojo/data/ObjectStore",
@@ -41,7 +42,7 @@ define(["dojo/_base/xhr",
"dojox/grid/enhanced/plugins/IndirectSelection",
"dojo/domReady!"],
function (xhr, parser, query, registry, connect, event, json, properties, updater, util, formatter,
- UpdatableStore, addBinding, moveMessages, showMessage, JsonRest, EnhancedGrid, ObjectStore, entities) {
+ UpdatableStore, addBinding, moveMessages, showMessage, UserPreferences, JsonRest, EnhancedGrid, ObjectStore, entities) {
function Queue(name, parent, controller) {
this.name = name;
@@ -98,10 +99,7 @@ define(["dojo/_base/xhr",
{name:"Arrival", field:"arrivalTime", width: "100%",
formatter: function(val) {
- var d = new Date(0);
- d.setUTCSeconds(val/1000);
-
- return d.toLocaleString();
+ return UserPreferences.formatDateTime(val, {addOffset: true, appendTimeZone: true});
} }
],
plugins: {
@@ -164,6 +162,7 @@ define(["dojo/_base/xhr",
event.stop(evt);
that.deleteQueue();
});
+ UserPreferences.addListener(that);
}});
@@ -237,6 +236,12 @@ define(["dojo/_base/xhr",
Queue.prototype.close = function() {
updater.remove( this.queueUpdater );
+ UserPreferences.removeListener(this);
+ };
+
+ Queue.prototype.onPreferencesChange = function(data)
+ {
+ this.grid._refresh();
};
var queueTypeKeys = {
@@ -385,10 +390,12 @@ define(["dojo/_base/xhr",
var bindings = thisObj.queueData[ "bindings" ];
var consumers = thisObj.queueData[ "consumers" ];
- for(i=0; i < bindings.length; i++) {
+ if (bindings)
+ {
+ for(i=0; i < bindings.length; i++) {
bindings[i].argumentString = json.stringify(bindings[i].arguments);
+ }
}
-
thisObj.updateHeader();
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/UserPreferences.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/UserPreferences.js
new file mode 100644
index 0000000000..89a22a9e6e
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/UserPreferences.js
@@ -0,0 +1,252 @@
+/*
+ *
+ * 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.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/json",
+ "dojo/date",
+ "dojo/date/locale",
+ "dojo/number",
+ "qpid/common/timezone"], function (xhr, json, date, locale, number, timezone) {
+
+ var listeners = [];
+
+ var UserPreferences = {
+
+ /* set time zone to 'UTC' by default*/
+ timeZone: "UTC",
+
+ loadPreferences : function(callbackSuccessFunction, callbackErrorFunction)
+ {
+ var that = this;
+ xhr.get({
+ url: "rest/preferences",
+ sync: true,
+ handleAs: "json",
+ load: function(data)
+ {
+ for(var name in data)
+ {
+ that[name] = data[name];
+ }
+ if (callbackSuccessFunction)
+ {
+ callbackSuccessFunction();
+ }
+ },
+ error: function(error)
+ {
+ if (callbackErrorFunction)
+ {
+ callbackErrorFunction(error);
+ }
+ }
+ });
+ },
+
+ setPreferences : function(preferences, callbackSuccessFunction, callbackErrorFunction)
+ {
+ var that = this;
+ xhr.post({
+ url: "rest/preferences",
+ sync: true,
+ handleAs: "json",
+ headers: { "Content-Type": "application/json"},
+ postData: json.stringify(preferences),
+ load: function(x)
+ {
+ for(var name in preferences)
+ {
+ if (preferences.hasOwnProperty(name))
+ that[name] = preferences[name];
+ }
+ that._notifyListeners(preferences);
+ if (callbackSuccessFunction)
+ {
+ callbackSuccessFunction(preferences);
+ }
+ },
+ error: function(error)
+ {
+ if (callbackErrorFunction)
+ {
+ callbackErrorFunction(error);
+ }
+ }
+ });
+ },
+
+ resetPreferences : function()
+ {
+ var preferences = {};
+ for(var name in this)
+ {
+ if (this.hasOwnProperty(name) && typeof this[name] != "function")
+ {
+ if (name == "preferencesError")
+ {
+ continue;
+ }
+ this[name] = null;
+ preferences[name] = undefined;
+ delete preferences[name];
+ }
+ }
+ this._notifyListeners(preferences);
+ },
+
+ addListener : function(obj)
+ {
+ listeners.push(obj);
+ },
+
+ removeListener : function(obj)
+ {
+ for(var i = 0; i < listeners.length; i++)
+ {
+ if(listeners[i] === obj)
+ {
+ listeners.splice(i,1);
+ return;
+ }
+ }
+ },
+
+ _notifyListeners : function(preferences)
+ {
+ for(var i = 0; i < listeners.length; i++)
+ {
+ try
+ {
+ listeners[i].onPreferencesChange(preferences);
+ }
+ catch(e)
+ {
+ if (console && console.warn)
+ {
+ console.warn(e);
+ }
+ }
+ }
+ },
+
+ getTimeZoneInfo : function(timeZoneName)
+ {
+ if (!timeZoneName && this.timeZone)
+ {
+ timeZoneName = this.timeZone;
+ }
+
+ if (!timeZoneName)
+ {
+ return null;
+ }
+
+ return timezone.getTimeZoneInfo(timeZoneName);
+ },
+
+ addTimeZoneOffsetToUTC : function(utcTimeInMilliseconds, timeZone)
+ {
+ var tzi = null;
+ if (timeZone && timeZone.hasOwnProperty("offset"))
+ {
+ tzi = timeZone;
+ }
+ else
+ {
+ tzi = this.getTimeZoneInfo(timeZone);
+ }
+
+ if (tzi)
+ {
+ var browserTimeZoneOffsetInMinutes = -new Date().getTimezoneOffset();
+ return utcTimeInMilliseconds + ( tzi.offset - browserTimeZoneOffsetInMinutes ) * 60000;
+ }
+ return utcTimeInMilliseconds;
+ },
+
+ getTimeZoneDescription : function(timeZone)
+ {
+ var tzi = null;
+ if (timeZone && timeZone.hasOwnProperty("offset"))
+ {
+ tzi = timeZone;
+ }
+ else
+ {
+ tzi = this.getTimeZoneInfo(timeZone);
+ }
+
+ if (tzi)
+ {
+ var timeZoneOfsetInMinutes = tzi.offset;
+ return (timeZoneOfsetInMinutes>0? "+" : "")
+ + number.format(timeZoneOfsetInMinutes/60, {pattern: "00"})
+ + ":" + number.format(timeZoneOfsetInMinutes%60, {pattern: "00"})
+ + " " + tzi.name;
+ }
+ return date.getTimezoneName(new Date());
+ },
+
+ formatDateTime : function(utcTimeInMilliseconds, options)
+ {
+ var dateTimeOptions = options || {};
+ var tzi = this.getTimeZoneInfo(dateTimeOptions.timeZoneName);
+ var timeInMilliseconds = utcTimeInMilliseconds;
+
+ if (tzi && dateTimeOptions.addOffset)
+ {
+ timeInMilliseconds = this.addTimeZoneOffsetToUTC(utcTimeInMilliseconds, tzi);
+ }
+
+ var d = new Date(timeInMilliseconds);
+
+ var formatOptions = {
+ datePattern: dateTimeOptions.datePattern || "yyyy-MM-dd",
+ timePattern: dateTimeOptions.timePattern || "HH:mm:ss.SSS"
+ };
+
+ if ("date" == dateTimeOptions.selector)
+ {
+ formatOptions.selector = "date";
+ }
+ else if ("time" == dateTimeOptions.selector)
+ {
+ formatOptions.selector = "time";
+ }
+
+ var result = locale.format(d, formatOptions);
+ if(dateTimeOptions.appendTimeZone)
+ {
+ result += " (" + this.getTimeZoneDescription(tzi) + ")";
+ }
+ return result;
+ }
+
+ };
+
+ UserPreferences.loadPreferences(null,
+ function(error)
+ {
+ UserPreferences.preferencesError = error;
+ }
+ );
+
+ return UserPreferences;
+}); \ No newline at end of file
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
index 3737e41da4..428a26c3c9 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
@@ -31,7 +31,7 @@ define(["dojo/_base/xhr",
"dijit/form/FilteringSelect",
"dojo/_base/connect",
"dojo/dom-style",
- "qpid/management/addPreferencesProvider",
+ "qpid/management/PreferencesProviderFields",
/* dojox/ validate resources */
"dojox/validate/us", "dojox/validate/web",
/* basic dijit classes */
@@ -45,7 +45,7 @@ define(["dojo/_base/xhr",
"dojox/form/BusyButton", "dojox/form/CheckedMultiSelect",
"dojox/layout/TableContainer",
"dojo/domReady!"],
- function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, addPreferencesProvider) {
+ function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields) {
var addAuthenticationProvider = {};
@@ -66,6 +66,10 @@ define(["dojo/_base/xhr",
{
if(formValues.hasOwnProperty(propName))
{
+ if (propName.indexOf("preferencesProvider") == 0)
+ {
+ continue;
+ }
if(formValues[ propName ] !== "") {
newProvider[ propName ] = formValues[propName];
}
@@ -101,6 +105,21 @@ define(["dojo/_base/xhr",
return "ap_" + providerType + "Field" + attribute;
}
+ var showPreferencesProviderFields = function showPreferencesProviderFields(provider)
+ {
+ var preferencesProviderDiv = dojo.byId("addAuthenticationProvider.preferencesProvider");
+ var preferencesProviderPanel = dijit.byId("addAuthenticationProvider.preferencesProviderPanel");
+ if (provider && provider.type == "Anonymous")
+ {
+ preferencesProviderPanel.domNode.style.display = 'none';
+ }
+ else
+ {
+ preferencesProviderPanel.domNode.style.display = 'block';
+ PreferencesProviderFields.show(preferencesProviderDiv, provider && provider.preferencesproviders ? provider.preferencesproviders[0] : null);
+ }
+ }
+
var loadProviderAndDisplayForm = function loadProviderAndDisplayForm(providerName, dialog)
{
if (providerName)
@@ -129,11 +148,13 @@ define(["dojo/_base/xhr",
}
}
}
+ showPreferencesProviderFields(provider);
registry.byId("addAuthenticationProvider").show();
});
}
else
{
+ showPreferencesProviderFields();
registry.byId("addAuthenticationProvider").show();
}
}
@@ -163,15 +184,14 @@ define(["dojo/_base/xhr",
if(this.success === true)
{
+ if (PreferencesProviderFields.save(newAuthenticationManager.name))
+ {
registry.byId("addAuthenticationProvider").hide();
- if (newAuthenticationManager.type != "Anonymous" && dojo.byId("formAddAuthenticationProvider.id").value == "")
- {
- addPreferencesProvider.show(newAuthenticationManager.name);
- }
+ }
}
else
{
- alert("Error:" + this.failureReason);
+ alert("Authentication Provider Error:" + this.failureReason);
}
return false;
}else{
@@ -251,9 +271,10 @@ define(["dojo/_base/xhr",
name: "type",
store: providersStore,
searchAttr: "name"}, input);
- connect.connect(that.providerChooser, "onChange",
- function(event)
+ that.providerChooser.on("change",
+ function(value)
{
+ dijit.byId("addAuthenticationProvider.preferencesProviderPanel").domNode.style.display = (value == "Anonymous" ? "none" : "block");
showFieldSets(that.providerChooser.value, that.providerFieldSets);
}
);
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js
index 818dc32366..40f8f83fbb 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js
@@ -34,6 +34,7 @@ define(["dojo/_base/xhr",
"dojo/dom-style",
"dojo/string",
"dojox/html/entities",
+ "qpid/management/PreferencesProviderFields",
"dojox/validate/us",
"dojox/validate/web",
"dijit/Dialog",
@@ -47,47 +48,12 @@ define(["dojo/_base/xhr",
"dojox/form/CheckedMultiSelect",
"dojox/layout/TableContainer",
"dojo/domReady!"],
- function (xhr, dom, construct, query, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, string, entities) {
+ function (xhr, dom, construct, query, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, string, entities, PreferencesProviderFields) {
var addPreferencesProvider = {};
var node = construct.create("div", null, win.body(), "last");
- var convertToPreferencesProvider = function convertToPreferencesProvider(formValues)
- {
- var newProvider = {};
-
- newProvider.name = dijit.byId("preferencesProvider.name").value;
- newProvider.type = dijit.byId("preferencesProvider.type").value;
- var id = dojo.byId("preferencesProvider.id").value;
- if (id)
- {
- newProvider.id = id;
- }
- for(var propName in formValues)
- {
- if(formValues.hasOwnProperty(propName))
- {
- if(formValues[ propName ] !== "") {
- newProvider[ propName ] = formValues[propName];
- }
-
- }
- }
- return newProvider;
- }
-
- var selectPreferencesProviderType = function(type) {
- if(type && string.trim(type) != "")
- {
- require(["qpid/management/authenticationprovider/preferences/" + type.toLowerCase() + "/add"],
- function(addType)
- {
- addType.show(dom.byId("preferencesProvider.fieldsContainer"), addPreferencesProvider.data)
- });
- }
- }
-
xhr.get({url: "addPreferencesProvider.html",
sync: true,
load: function(data) {
@@ -104,94 +70,24 @@ define(["dojo/_base/xhr",
event.stop(e);
if(theForm.validate()){
- var newProvider = convertToPreferencesProvider(theForm.getValues());
- var that = this;
- var nameWidget = registry.byId("preferencesProvider.name")
- xhr.put({url: "rest/preferencesprovider/" +encodeURIComponent(addPreferencesProvider.authenticationProviderName) + "/" + encodeURIComponent(nameWidget.value),
- sync: true, handleAs: "json",
- headers: { "Content-Type": "application/json"},
- putData: json.toJson(newProvider),
- load: function(x) {that.success = true; },
- error: function(error) {that.success = false; that.failureReason = error;}});
- if(this.success === true)
+ if(PreferencesProviderFields.save(addPreferencesProvider.authenticationProviderName))
{
registry.byId("addPreferencesProvider").hide();
}
- else
- {
- alert("Error:" + this.failureReason);
- }
return false;
}else{
alert('Form contains invalid data. Please correct first');
return false;
}
});
- xhr.get({
- sync: true,
- url: "rest/helper?action=ListPreferencesProvidersTypes",
- handleAs: "json"
- }).then(
- function(data) {
- var preferencesProvidersTypes = data;
- var storeData = [];
- for (var i =0 ; i < preferencesProvidersTypes.length; i++)
- {
- storeData[i]= {id: preferencesProvidersTypes[i], name: preferencesProvidersTypes[i]};
- }
- var store = new Memory({ data: storeData });
- var preferencesProviderTypesDiv = dom.byId("addPreferencesProvider.selectPreferencesProviderDiv");
- var input = construct.create("input", {id: "preferencesProviderType", required: true}, preferencesProviderTypesDiv);
- addPreferencesProvider.preferencesProviderTypeChooser = new FilteringSelect({ id: "preferencesProvider.type",
- name: "type",
- store: store,
- searchAttr: "name",
- required: true,
- onChange: selectPreferencesProviderType }, input);
- addPreferencesProvider.preferencesProviderTypeChooser.startup();
- });
}});
addPreferencesProvider.show = function(authenticationProviderName, providerName) {
this.authenticationProviderName = authenticationProviderName;
- this.data = null;
- var that = this;
- var theForm = registry.byId("formAddPreferencesProvider");
- theForm.reset();
- dojo.byId("preferencesProvider.id").value="";
- var nameWidget = registry.byId("preferencesProvider.name");
- nameWidget.set("disabled", false);
- registry.byId("preferencesProvider.type").set("disabled", false);
- if (this.preferencesProviderTypeChooser)
- {
- this.preferencesProviderTypeChooser.set("disabled", false);
- this.preferencesProviderTypeChooser.set("value", null);
- }
+ PreferencesProviderFields.show(dom.byId("addPreferencesProvider.preferencesProvider"), providerName, authenticationProviderName)
var dialog = registry.byId("addPreferencesProvider");
- dialog.set("title", (providerName ? "Edit preference provider '" + entities.encode(String(providerName)) + "' " : "Add preferences provider ") + " for authentication provider '" + entities.encode(String(authenticationProviderName)) + "' ")
- if (providerName)
- {
- xhr.get({
- url: "rest/preferencesprovider/" +encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(providerName),
- sync: false,
- handleAs: "json"
- }).then(
- function(data) {
- var provider = data[0];
- var providerType = provider.type;
- that.data = provider;
- nameWidget.set("value", entities.encode(String(provider.name)));
- nameWidget.set("disabled", true);
- that.preferencesProviderTypeChooser.set("value", providerType);
- that.preferencesProviderTypeChooser.set("disabled", true);
- dojo.byId("preferencesProvider.id").value=provider.id;
- dialog.show();
- });
- }
- else
- {
- dialog.show();
- }
+ dialog.set("title", (providerName ? "Edit preferences provider '" + entities.encode(String(providerName)) + "' " : "Add preferences provider ") + " for '" + entities.encode(String(authenticationProviderName)) + "' ")
+ dialog.show();
}
return addPreferencesProvider;
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js
index 80b50fbbb8..06dd9dd0e3 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js
@@ -33,10 +33,10 @@ define(["dojo/_base/xhr",
"dojo/domReady!"],
function (xhr, dom, domConstruct, win, registry, parser, array, event, json, string, entities, template) {
return {
- show: function(node, data) {
- dojo.forEach(dijit.findWidgets(node), function(w) {
- w.destroyRecursive();
- });
+ show: function(node, data)
+ {
+ this.destroy();
+ this.node = node;
node.innerHTML = template;
parser.parse(node);
var pathWidget = registry.byId("preferencesProvider.path")
@@ -44,6 +44,23 @@ define(["dojo/_base/xhr",
{
pathWidget.set("value", entities.encode(String(data["path"])));
}
+ },
+ destroy: function()
+ {
+ if (this.node)
+ {
+ dojo.forEach(dijit.findWidgets(this.node), function(w) {w.destroyRecursive();});
+ this.node = null;
+ }
+ },
+ disable: function(val)
+ {
+ var pathWidget = registry.byId("preferencesProvider.path");
+ pathWidget.set("disabled", val);
+ },
+ getValues: function()
+ {
+ return {path: registry.byId("preferencesProvider.path").value};
}
};
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogFileDownloadDialog.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogFileDownloadDialog.js
index c25fd7c609..95870dadf7 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogFileDownloadDialog.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogFileDownloadDialog.js
@@ -28,7 +28,7 @@ define([
"dojo/parser",
"dojo/store/Memory",
"dojo/data/ObjectStore",
- "dojo/date/locale",
+ "qpid/management/UserPreferences",
"dojo/number",
"dijit/registry",
"dijit/Dialog",
@@ -36,7 +36,7 @@ define([
"dojox/grid/EnhancedGrid",
"dojo/text!../../../logs/showLogFileDownloadDialog.html",
"dojo/domReady!"
-], function(declare, event, xhr, connect, domConstruct, query, parser, Memory, ObjectStore, locale, number,
+], function(declare, event, xhr, connect, domConstruct, query, parser, Memory, ObjectStore, UserPreferences, number,
registry, Dialog, Button, EnhancedGrid, template){
@@ -79,8 +79,7 @@ return declare("qpid.management.logs.LogFileDownloadDialog", null, {
},
{ name: "Last Modified", field: "lastModified", width: "250px",
formatter: function(val) {
- var d = new Date(val);
- return locale.format(d, {selector:"date", datePattern: "EEE, MMM d yy, HH:mm:ss z (ZZZZ)"});
+ return UserPreferences.formatDateTime(val, {addOffset: true, appendTimeZone: true});
}
}
];
@@ -152,7 +151,7 @@ return declare("qpid.management.logs.LogFileDownloadDialog", null, {
showDialog: function(){
var self = this;
- var requestArguments = {url: "rest/logfiles", sync: true, handleAs: "json"};
+ var requestArguments = {url: "rest/logfilenames", sync: true, handleAs: "json"};
xhr.get(requestArguments).then(function(data){
try
{
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogViewer.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogViewer.js
index 56b37d0167..364d5403a3 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogViewer.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/logs/LogViewer.js
@@ -23,14 +23,25 @@ define(["dojo/_base/xhr",
"dojo/query",
"dojo/date/locale",
"dijit/registry",
+ "qpid/management/UserPreferences",
"qpid/common/grid/GridUpdater",
"qpid/common/grid/UpdatableGrid",
"qpid/management/logs/LogFileDownloadDialog",
"dojo/text!../../../logs/showLogViewer.html",
"dojo/domReady!"],
- function (xhr, parser, query, locale, registry, GridUpdater, UpdatableGrid, LogFileDownloadDialog, markup) {
+ function (xhr, parser, query, locale, registry, UserPreferences, GridUpdater, UpdatableGrid, LogFileDownloadDialog, markup) {
var defaulGridRowLimit = 4096;
+ var currentTimeZone;
+
+ function dataTransformer(data)
+ {
+ for(var i=0; i < data.length; i++)
+ {
+ data[i].time = UserPreferences.addTimeZoneOffsetToUTC(data[i].timestamp);
+ }
+ return data;
+ }
function LogViewer(name, parent, controller) {
var self = this;
@@ -64,10 +75,11 @@ define(["dojo/_base/xhr",
LogViewer.prototype._buildGrid = function() {
var self = this;
+ currentTimeZone = UserPreferences.getTimeZoneDescription();
var gridStructure = [
{
- hidden: true,
+ hidden: false,
name: "ID",
field: "id",
width: "50px",
@@ -75,28 +87,27 @@ define(["dojo/_base/xhr",
filterable: true
},
{
- name: "Date", field: "timestamp", width: "100px", datatype: "date",
+ name: "Date", field: "time", width: "100px", datatype: "date",
formatter: function(val) {
- var d = new Date(0);
- d.setUTCSeconds(val/1000);
- return locale.format(d, {selector:"date", datePattern: "EEE, MMM d yy"});
- },
- dataTypeArgs: {
- selector: "date",
- datePattern: "EEE MMMM d yyy"
+ return UserPreferences.formatDateTime(val, {selector:"date"});
}
},
- { name: "Time", field: "timestamp", width: "150px", datatype: "time",
+ { name: "Time ", field: "time", width: "100px", datatype: "time",
formatter: function(val) {
- var d = new Date(0);
- d.setUTCSeconds(val/1000);
- return locale.format(d, {selector:"time", timePattern: "HH:mm:ss z (ZZZZ)"});
- },
- dataTypeArgs: {
- selector: "time",
- timePattern: "HH:mm:ss ZZZZ"
+ return UserPreferences.formatDateTime(val, {selector:"time"});
}
},
+ {
+ name: "Time zone",
+ field: "time",
+ width: "80px",
+ datatype: "string",
+ hidden: true,
+ filterable: false,
+ formatter: function(val) {
+ return currentTimeZone;
+ },
+ },
{ name: "Level", field: "level", width: "50px", datatype: "string", autoComplete: true, hidden: true},
{ name: "Logger", field: "logger", width: "150px", datatype: "string", autoComplete: false, hidden: true},
{ name: "Thread", field: "thread", width: "100px", datatype: "string", hidden: true},
@@ -132,18 +143,20 @@ define(["dojo/_base/xhr",
}
},
append: true,
- appendLimit: defaulGridRowLimit
+ appendLimit: defaulGridRowLimit,
+ dataTransformer: dataTransformer
});
this.grid = new UpdatableGrid(updater.buildUpdatableGridArguments({
structure: gridStructure,
selectable: true,
selectionMode: "none",
sortInfo: -1,
- sortFields: [{attribute: 'timestamp', descending: true}],
+ sortFields: [{attribute: 'id', descending: true}],
plugins:{
nestedSorting:true,
- enhancedFilter:{defaulGridRowLimit: defaulGridRowLimit},
- indirectSelection: false
+ enhancedFilter:{defaulGridRowLimit: defaulGridRowLimit,displayLastUpdateTime:true},
+ indirectSelection: false,
+ pagination: {defaultPageSize: 10}
}
}), gridNode);
var onStyleRow = function(row)
@@ -170,14 +183,19 @@ define(["dojo/_base/xhr",
};
this.grid.on("styleRow", onStyleRow);
this.grid.startup();
+ UserPreferences.addListener(this);
}
catch(err)
{
- console.error(err);
+ if (console && console.error)
+ {
+ console.error(err);
+ }
}
};
LogViewer.prototype.close = function() {
+ UserPreferences.removeListener(this);
if (this.grid)
{
this.grid.destroy();
@@ -195,5 +213,12 @@ define(["dojo/_base/xhr",
}
};
+ LogViewer.prototype.onPreferencesChange = function(data)
+ {
+ currentTimeZone = UserPreferences.getTimeZoneDescription();
+ dataTransformer(this.grid.updater.memoryStore.data);
+ this.grid._refresh();
+ };
+
return LogViewer;
});
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js
index 59822ec535..1281e44166 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js
@@ -29,8 +29,9 @@ define(["dojo/_base/xhr",
"dojo/_base/connect",
"qpid/common/properties",
"dojox/html/entities",
+ "qpid/management/UserPreferences",
"dojo/domReady!"],
- function (xhr, dom, construct, domClass, win, registry, parser, array, event, json, query, connect, properties, entities) {
+ function (xhr, dom, construct, domClass, win, registry, parser, array, event, json, query, connect, properties, entities, UserPreferences) {
function encode(val){
@@ -88,9 +89,7 @@ define(["dojo/_base/xhr",
}
tableStr += "</table>";
} else if(domClass.contains(field,"datetime")) {
- var d = new Date(0);
- d.setUTCSeconds(val/1000);
- field.innerHTML = d.toLocaleString();
+ field.innerHTML = UserPreferences.formatDateTime(val, {addOffset: true, appendTimeZone: true});
} else {
field.innerHTML = encode(val);
}
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/logs/showLogViewer.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/logs/showLogViewer.html
index 10ac09a406..ab927153fa 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/logs/showLogViewer.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/logs/showLogViewer.html
@@ -23,7 +23,7 @@
<div id="broker-logfile"></div>
<br/>
<button data-dojo-type="dijit.form.Button" class="downloadLogs"
- data-dojo-props="iconClass: 'downloadLogsIcon', title:'Download Log Files', name: 'downloadLogs'">Download</button>
+ data-dojo-props="iconClass: 'downloadLogsIcon', title:'Download Log Files', name: 'downloadLogs'">Download Log Files</button>
<br/>
</div>
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showExchange.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showExchange.html
index f33b029026..cdc88ece6a 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showExchange.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showExchange.html
@@ -19,24 +19,43 @@
-
-->
<div class="exchange">
- <span style="">Name:</span><span class="name" style="position:absolute; left:6em"></span>
- <br/>
- <span style="">State:</span><span class="state" style="position:absolute; left:6em"></span>
- <br/>
- <span style="">Durable:</span><span class="durable" style="position:absolute; left:6em"></span>
- <span style="position:absolute; left:26em">Inbound:</span>
- <span class="msgInRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesInRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesInRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">Lifespan:</span><span style="position:absolute; left:6em" class="lifetimePolicy"></span>
- <span style="position:absolute; left:26em">Dropped:</span>
- <span class="msgDropRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesDropRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesDropRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Exchange Attributes', open: true">
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Name:</div>
+ <div class="name" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">State:</div>
+ <div class="state" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Durable:</div>
+ <div class="durable" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Lifespan:</div>
+ <div class="lifetimePolicy" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Inbound:</div>
+ <div style="float:left;">
+ <span class="msgInRate"></span>
+ <span> msg/s</span>
+ <span class="bytesInRate">(</span>
+ <span class="bytesInRateUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Dropped:</div>
+ <div style="float:left;">
+ <span class="msgDropRate"></span>
+ <span> msg/s</span>
+ <span class="bytesDropRate">(</span>
+ <span class="bytesDropRateUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both"></div>
+ </div>
<br/>
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Bindings'">
<div class="bindings"></div>
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferences.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferences.html
index ede111272a..ada919f5a5 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferences.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferences.html
@@ -22,15 +22,13 @@
<div data-dojo-type="dijit/layout/TabContainer" style="width: 600px; height: 400px">
<div data-dojo-type="dijit/layout/ContentPane" title="Own Preferences" data-dojo-props="selected:true" id="preferences.preferencesTab">
<form method="post" data-dojo-type="dijit/form/Form" id="preferences.preferencesForm">
- <table cellpadding="0" cellspacing="2" style="overflow: auto; height: 300px;">
+ <div style="height:300px">
+ <table cellpadding="0" cellspacing="2">
<tr>
- <td><strong>Time zone: </strong></td>
- <td>
- <span id="preferences.timeZone" data-dojo-type="qpid/common/TimeZoneSelector" data-dojo-props="name: 'timeZone'"></span>
- </td>
+ <td colspan="2"><span id="preferences.timeZone" data-dojo-type="qpid/common/TimeZoneSelector" data-dojo-props="name: 'timeZone', labelStyle: {width: '105px'}"></span></td>
</tr>
<tr>
- <td><strong>Update period:</strong></td>
+ <td style="width: 105px"><strong>Update period:</strong></td>
<td><input id="preferences.updatePeriod" name="updatePeriod" data-dojo-type="dijit/form/NumberSpinner" data-dojo-props="
invalidMessage: 'Invalid value',
required: false,
@@ -40,14 +38,11 @@
"/>
</td>
</tr>
- <tr>
- <td><strong>Save tabs:</strong></td>
- <td><input id="preferences.saveTabs" type="checkbox" data-dojo-type="dijit/form/CheckBox" name="saveTabs"/></td>
- </tr>
</table>
+ </div>
<div class="dijitDialogPaneActionBar">
- <input type="submit" value="Save Preferences" data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Save Preferences'" id="preferences.saveButton"/>
- <button value="Cancel" data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Cancel'" id="preferences.cancelButton"></button>
+ <button data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Set'" id="preferences.setButton">Set</button>
+ <button data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Set and Close'" id="preferences.setAndCloseButton">Set and Close</button>
</div>
</form>
</div>
@@ -76,7 +71,8 @@
</thead>
</table>
<div class="dijitDialogPaneActionBar">
- <button id="preferences.deletePreeferencesButton" data-dojo-type="dijit/form/Button" data-dojo-props="label:'Delete Preferences', title:'Delete preferences for selected users'">Delete Preferences</button>
+ <button id="preferences.deleteButton" data-dojo-type="dijit/form/Button" data-dojo-props="label:'Delete', title:'Delete preferences for selected users'">Delete</button>
+ <button id="preferences.deleteAndCloseButton" data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Delete and Close', title:'Delete preferences for selected users and close the dialog'">Delete and Close</button>
</div>
</div>
</div>
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html
new file mode 100644
index 0000000000..0da104821b
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html
@@ -0,0 +1,41 @@
+<!--
+ -
+ - 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.
+ -
+ -->
+<div data-dojo-type="dijit/layout/ContentPane" class="preferencesProviderContainer">
+ <table class="tableContainer-table tableContainer-table-horiz" width="100%" cellspacing="1">
+ <tr>
+ <td class="tableContainer-labelCell" style="width: 200px;"><strong>Type*:</strong></td>
+ <td class="tableContainer-valueCell">
+ <select class="preferencesProviderType" data-dojo-type="dijit/form/FilteringSelect"
+ data-dojo-props="name:'preferencesProviderType',label:'Type:', searchAttr: 'name', placeHolder: 'Select Provider Type', required: true">
+ <option value="">None</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="tableContainer-labelCell" style="width: 200px;"><strong>Name*:</strong></td>
+ <td class="tableContainer-valueCell"><input type="text" name="preferencesProviderName"
+ class="preferencesProviderName" data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="placeHolder: 'Name', required: true, missingMessage: 'A name must be supplied', title: 'Enter name', pattern: '^[\x20-\x2e\x30-\x7F]{1,255}$'" /></td>
+ </tr>
+ </table>
+ <div class="preferencesProviderFieldsContainer"></div>
+ <input type="hidden" name="preferencesProviderId"/>
+</div> \ No newline at end of file
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showQueue.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showQueue.html
index c31cae6f8a..8d6741a981 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showQueue.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showQueue.html
@@ -19,41 +19,81 @@
-
-->
<div class="queue">
- <span style="">Name:</span><span class="name" style="position:absolute; left:6em"></span>
- <span style="position:absolute; left:26em">Size:</span>
- <span class="queueDepthMessages" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msgs</span>
- <span class="queueDepthBytes" style="position:absolute; right: 3.3em">(</span>
- <span class="queueDepthBytesUnits" style="position:absolute; right: 0em; width: 3em">)</span>
- <br/>
- <span style="">State:</span><span class="state" style="position:absolute; left:6em"></span>
- <span style="position:absolute; left:26em">Pre-fetched:</span>
- <span class="unacknowledgedMessages" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msgs</span>
- <span class="unacknowledgedBytes" style="position:absolute; right: 3.3em"></span>
- <span class="unacknowledgedBytesUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">Durable:</span><span class="durable" style="position:absolute; left:6em"></span>
- <span style="position:absolute; left:26em">Inbound:</span>
- <span class="msgInRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesInRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesInRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">Lifespan:</span><span style="position:absolute; left:6em" class="lifetimePolicy"></span>
- <span style="position:absolute; left:26em">Outbound:</span>
- <span class="msgOutRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesOutRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesOutRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">AlternateExchange:</span><span class="alternateExchange" style="position:absolute; left:10em"></span>
- <span style="position:absolute; left:26em">Type:</span><span style="position:absolute; left:29em" class="type"></span>
- <span style="position:absolute; right:1em" class="typeQualifier"></span>
- <br/>
- <div class="messageGroups">
- <span style="" class="messageGroupKeyLabel">Message Group Key:</span><span class="messageGroupKey" style="position:absolute; left:11em"></span>
- <span style="position:absolute; left:26em" class="messageGroupSharedGroupsLabel">Shared Message Groups:</span><span style="position:absolute; left:39em" class="messageGroupSharedGroups"></span>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Queue Attributes', open: true">
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Name:</div>
+ <div class="name" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">State:</div>
+ <div class="state" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Durable:</div>
+ <div class="durable" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Lifespan:</div>
+ <div class="lifetimePolicy" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Type:</div>
+ <div style="float:left;">
+ <span class="type"></span>
+ <span class="typeQualifier"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Size:</div>
+ <div style="float:left;">
+ <span class="queueDepthMessages"></span>
+ <span> msgs</span>
+ <span class="queueDepthBytes">(</span>
+ <span class="queueDepthBytesUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Pre-fetched:</div>
+ <div style="float:left;">
+ <span class="unacknowledgedMessages"></span>
+ <span> msgs</span>
+ <span class="unacknowledgedBytes">(</span>
+ <span class="unacknowledgedBytesUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Inbound:</div>
+ <div style="float:left;">
+ <span class="msgInRate"></span>
+ <span> msg/s</span>
+ <span class="bytesInRate">(</span>
+ <span class="bytesInRateUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Outbound:</div>
+ <div style="float:left;">
+ <span class="msgOutRate"></span>
+ <span> msg/s</span>
+ <span class="bytesOutRate">(</span>
+ <span class="bytesOutRateUnits">)</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">AlternateExchange:</div>
+ <div class="alternateExchange" style="float:left;"></div>
+ </div>
+ <div class="messageGroups" style="clear:both">
+ <div style="clear:both">
+ <div style="float:left; width: 150px;" class="messageGroupKeyLabel formLabel-labelCell ">Message Group Key:</div>
+ <div style="float:left;" class="messageGroupKey"></div>
+ </div>
+ <div style="clear:both">
+ <div style="float:left; width: 150px;" class="messageGroupSharedGroupsLabel formLabel-labelCell">Shared Message Groups:</div>
+ <div style="float:left;" class="messageGroupSharedGroups"></div>
+ </div>
+ </div>
+ <div style="clear:both"></div>
</div>
<br/>
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Bindings'">
@@ -73,31 +113,42 @@
</div>
<br/>
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Alerting Thresholds', open: false">
- <span style="">Queue Depth:</span>
- <span class="alertThresholdQueueDepthMessages"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span style="position:absolute; left:12.2em">msgs</span>
-
- <span style="position:absolute; left:21em">Queue Depth:</span>
- <span class="alertThresholdQueueDepthBytes"
- style="position:absolute; left:22em; width:8em; text-align:right"></span>
- <span class="alertThresholdQueueDepthBytesUnits" style="position:absolute; left:30.2em"></span>
- <br>
- <span style="">Message Age:</span>
- <span class="alertThresholdMessageAge"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span class="alertThresholdMessageAgeUnits" style="position:absolute; left:12.2em"></span>
-
- <span style="position:absolute; left:21em">Message Size: </span>
- <span class="alertThresholdMessageSize"
- style="position:absolute; left:25em; width:5em; text-align:right"></span>
- <span class="alertThresholdMessageSizeUnits" style="position:absolute; left:30.2em"></span>
- <br/>
- <br/>
- <span style="">Alert frequency:</span>
- <span class="alertRepeatGap"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span class="alertRepeatGapUnits" style="position:absolute; left:12.2em"></span>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Queue Depth:</div>
+ <div style="float:left;">
+ <span class="alertThresholdQueueDepthMessages"></span>
+ <span>msgs</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Queue Depth:</div>
+ <div style="float:left;">
+ <span class="alertThresholdQueueDepthBytes"></span>
+ <span class="alertThresholdQueueDepthBytesUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Message Age:</div>
+ <div style="float:left;">
+ <span class="alertThresholdMessageAge"></span>
+ <span class="alertThresholdMessageAgeUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Message Size:</div>
+ <div style="float:left;">
+ <span class="alertThresholdMessageSize"></span>
+ <span class="alertThresholdMessageSizeUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Alert frequency:</div>
+ <div style="float:left;">
+ <span class="alertRepeatGap"></span>
+ <span class="alertRepeatGapUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both"></div>
</div>
<div class="dijitDialogPaneActionBar">
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html
index 14833e0d2e..69856365db 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html
@@ -21,31 +21,55 @@
-->
<div class="virtualhost">
- <span style="">Name:</span><span class="name" style="position:absolute; left:6em"></span>
- <br/>
- <span style="">State:</span><span class="state" style="position:absolute; left:6em"></span>
- <br/>
- <span style="">Durable:</span><span class="durable" style="position:absolute; left:6em"></span>
- <span style="position:absolute; left:26em">Inbound:</span>
- <span class="msgInRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesInRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesInRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">Lifespan:</span><span style="position:absolute; left:6em" class="lifetimePolicy"></span>
- <span style="position:absolute; left:26em">Outbound:</span>
- <span class="msgOutRate" style="position:absolute; right:9.5em"></span>
- <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
- <span class="bytesOutRate" style="position:absolute; right: 3.3em"></span>
- <span class="bytesOutRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
- <br/>
- <span style="">Store Type:</span><span style="position:absolute; left:6em" class="storeType"></span>
- <span style="position:absolute; left:26em">Store Path:</span>
- <span class="storePath" style="position:absolute; right: 1em"></span>
- <div class="configPathDiv">
- <span style="">ConfigPath:</span><span style="position:absolute; left:6em" class="configPath"></span>
- </div>
-
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Virtual Host Attributes', open: true">
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Name:</div>
+ <div class="name" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">State:</div>
+ <div class="state" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Durable:</div>
+ <div class="durable" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Lifespan:</div>
+ <div class="lifetimePolicy" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Inbound:</div>
+ <div style="float:left;">
+ <span class="msgInRate"></span>
+ <span> msg/s</span>
+ <span class="bytesInRate"></span>
+ <span class="bytesInRateUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Outbound:</div>
+ <div style="float:left;">
+ <span class="msgOutRate"></span>
+ <span> msg/s</span>
+ <span class="bytesOutRate"></span>
+ <span class="bytesOutRateUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Type:</div>
+ <div class="storeType" style="float:left;"></div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Path:</div>
+ <div class="storePath" style="float:left;"></div>
+ </div>
+ <div class="configPathDiv" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 100px;">Config Path:</div>
+ <div class="configPath" style="float:left;"></div>
+ </div>
+ <div style="clear:both"></div>
+ </div>
<br/>
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Exchanges'">
<div class="exchanges"></div>
@@ -64,31 +88,42 @@
</div>
<br/>
<div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Alerting Thresholds', open: false">
- <span style="">Queue Depth:</span>
- <span class="alertThresholdQueueDepthMessages"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span style="position:absolute; left:12.2em">msgs</span>
-
- <span style="position:absolute; left:21em">Queue Depth:</span>
- <span class="alertThresholdQueueDepthBytes"
- style="position:absolute; left:22em; width:8em; text-align:right"></span>
- <span class="alertThresholdQueueDepthBytesUnits" style="position:absolute; left:30.2em"></span>
- <br>
- <span style="">Message Age:</span>
- <span class="alertThresholdMessageAge"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span class="alertThresholdMessageAgeUnits" style="position:absolute; left:12.2em"></span>
-
- <span style="position:absolute; left:21em">Message Size: </span>
- <span class="alertThresholdMessageSize"
- style="position:absolute; left:25em; width:5em; text-align:right"></span>
- <span class="alertThresholdMessageSizeUnits" style="position:absolute; left:30.2em"></span>
- <br/>
- <br/>
- <span style="">Alert frequency:</span>
- <span class="alertRepeatGap"
- style="position:absolute; left:4em; width:8em; text-align:right"></span>
- <span class="alertRepeatGapUnits" style="position:absolute; left:12.2em"></span>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Queue Depth:</div>
+ <div style="float:left;">
+ <span class="alertThresholdQueueDepthMessages"></span>
+ <span>msgs</span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Queue Depth:</div>
+ <div style="float:left;">
+ <span class="alertThresholdQueueDepthBytes"></span>
+ <span class="alertThresholdQueueDepthBytesUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Message Age:</div>
+ <div style="float:left;">
+ <span class="alertThresholdMessageAge"></span>
+ <span class="alertThresholdMessageAgeUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Message Size:</div>
+ <div style="float:left;">
+ <span class="alertThresholdMessageSize"></span>
+ <span class="alertThresholdMessageSizeUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 150px;">Alert frequency:</div>
+ <div style="float:left;">
+ <span class="alertRepeatGap"></span>
+ <span class="alertRepeatGapUnits"></span>
+ </div>
+ </div>
+ <div style="clear:both"></div>
</div>
</div>
diff --git a/qpid/java/broker-plugins/management-http/src/main/resources-maven/dojoconfig.properties b/qpid/java/broker-plugins/management-http/src/main/resources-maven/dojoconfig.properties
new file mode 100644
index 0000000000..153b568482
--- /dev/null
+++ b/qpid/java/broker-plugins/management-http/src/main/resources-maven/dojoconfig.properties
@@ -0,0 +1,5 @@
+dojo-version=${dojo-version}
+dojo-path=/dojo-${dojo-version}/dojo
+dijit-path=/dojo-${dojo-version}/dijit
+dojox-path=/dojo-${dojo-version}/dojox
+
diff --git a/qpid/java/broker-plugins/management-jmx/build.xml b/qpid/java/broker-plugins/management-jmx/build.xml
index 9d212cf39a..0209ecbd7a 100644
--- a/qpid/java/broker-plugins/management-jmx/build.xml
+++ b/qpid/java/broker-plugins/management-jmx/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins Management JMX" default="build">
- <property name="module.depends" value="common broker management/common" />
- <property name="module.test.depends" value="broker/tests common/tests management/common client" />
+ <property name="module.depends" value="common broker-core management/common" />
+ <property name="module.test.depends" value="broker-core/tests qpid-test-utils management/common client" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided -Sqpid-management-common=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided -Sqpid-management-common=provided"/>
<property name="broker.plugin" value="true"/>
diff --git a/qpid/java/broker-plugins/management-jmx/pom.xml b/qpid/java/broker-plugins/management-jmx/pom.xml
new file mode 100644
index 0000000000..8fd525e7d6
--- /dev/null
+++ b/qpid/java/broker-plugins/management-jmx/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-management-jmx</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-management-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker-plugins/memory-store/build.xml b/qpid/java/broker-plugins/memory-store/build.xml
index f265e68e94..6d107b7803 100644
--- a/qpid/java/broker-plugins/memory-store/build.xml
+++ b/qpid/java/broker-plugins/memory-store/build.xml
@@ -17,11 +17,11 @@
- under the License.
-->
<project name="Qpid Broker-Plugins Memory Store" default="build">
- <property name="module.depends" value="common broker" />
- <property name="module.test.depends" value="common/tests broker/tests" />
+ <property name="module.depends" value="common broker-core" />
+ <property name="module.test.depends" value="qpid-test-utils broker-core/tests" />
<property name="module.genpom" value="true"/>
- <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker=provided"/>
+ <property name="module.genpom.args" value="-Sqpid-common=provided -Sqpid-broker-core=provided"/>
<property name="broker.plugin" value="true"/>
<property name="broker-plugins-memory-store.libs" value="" />
diff --git a/qpid/java/broker-plugins/memory-store/pom.xml b/qpid/java/broker-plugins/memory-store/pom.xml
new file mode 100644
index 0000000000..1cef06c1f0
--- /dev/null
+++ b/qpid/java/broker-plugins/memory-store/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker-plugins-memory-store</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/broker/bin/qpid-passwd b/qpid/java/broker/bin/qpid-passwd
index 69246974fa..cc55c7e2f2 100755
--- a/qpid/java/broker/bin/qpid-passwd
+++ b/qpid/java/broker/bin/qpid-passwd
@@ -23,8 +23,8 @@ if [ -z "$QPID_HOME" ]; then
export QPID_HOME=`cd "$WHEREAMI/../" && pwd`
fi
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
+# Set classpath to include jars from lib dir
+QPID_LIBS=$QPID_HOME/lib/*
# Set other variables used by the qpid-run script before calling
export JAVA=java \
diff --git a/qpid/java/broker/bin/qpid-server b/qpid/java/broker/bin/qpid-server
index 206ae6a225..a922e0bdba 100755
--- a/qpid/java/broker/bin/qpid-server
+++ b/qpid/java/broker/bin/qpid-server
@@ -33,8 +33,8 @@ if [ -z "$QPID_PNAME" ]; then
export QPID_PNAME=" -DPNAME=QPBRKR"
fi
-# Set classpath to include the qpid-all manifest jar, plus jars in lib/plugins and lib/opt
-QPID_LIBS="$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/plugins/*:$QPID_HOME/lib/opt/*"
+# Set classpath to include the jars in lib/, lib/plugins, and lib/opt
+QPID_LIBS="$QPID_HOME/lib/*:$QPID_HOME/lib/plugins/*:$QPID_HOME/lib/opt/*"
# Set other variables used by the qpid-run script before calling
export JAVA=java \
diff --git a/qpid/java/broker/bin/qpid-server.bat b/qpid/java/broker/bin/qpid-server.bat
index 96965b0b42..ea76a54479 100644..100755
--- a/qpid/java/broker/bin/qpid-server.bat
+++ b/qpid/java/broker/bin/qpid-server.bat
@@ -76,8 +76,8 @@ echo Using CLASSPATH: %CLASSPATH%
goto afterQpidClasspath
:noQpidClasspath
-echo Warning: Qpid classpath not set. CLASSPATH set to %QPID_HOME%\lib\qpid-all.jar;%QPID_HOME%\lib\plugins\*;%QPID_HOME%\lib\opt\*
-set CLASSPATH=%QPID_HOME%\lib\qpid-all.jar;%QPID_HOME%\lib\plugins\*;%QPID_HOME%\lib\opt\*
+echo Warning: Qpid classpath not set. CLASSPATH set to %QPID_HOME%\lib\*;%QPID_HOME%\lib\plugins\*;%QPID_HOME%\lib\opt\*
+set CLASSPATH=%QPID_HOME%\lib\*;%QPID_HOME%\lib\plugins\*;%QPID_HOME%\lib\opt\*
:afterQpidClasspath
REM start parsing -run arguments
diff --git a/qpid/java/broker/build.xml b/qpid/java/broker/build.xml
index da51e4ffa5..91a020b41d 100644
--- a/qpid/java/broker/build.xml
+++ b/qpid/java/broker/build.xml
@@ -18,22 +18,19 @@
- under the License.
-
-->
-<project name="AMQ Broker" default="build">
- <property name="module.depends" value="management/common common"/>
- <property name="module.test.depends" value="common/tests" />
+<project name="Broker" default="build">
+ <property name="module.depends" value="broker-core common management/common"/>
+ <property name="module.test.depends" value="qpid-test-utils" />
<property name="module.main" value="org.apache.qpid.server.Main"/>
<property name="module.genpom" value="true"/>
- <!-- Add dependencies to the broker pom for the broker-plugins and bdbstore modules -->
- <property name="module.maven.depends" value="broker-plugins/access-control broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 broker-plugins/derby-store broker-plugins/jdbc-provider-bone broker-plugins/jdbc-store broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store bdbstore bdbstore/jmx"/>
- <!-- Make them runtime dependencies, make bdbstore modules optional -->
+ <!-- Add dependencies to the broker pom for the broker-core, broker-plugins and bdbstore modules -->
+ <property name="module.maven.depends" value="broker-core broker-plugins/access-control broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 broker-plugins/derby-store broker-plugins/jdbc-provider-bone broker-plugins/jdbc-store broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store bdbstore bdbstore/jmx"/>
+ <!-- Make the plugins runtime dependencies, make bdbstore modules optional -->
<property name="module.genpom.args" value="-Sqpid-broker-plugins-access-control=runtime -Sqpid-broker-plugins-amqp-0-8-protocol=runtime -Sqpid-broker-plugins-amqp-0-10-protocol=runtime -Sqpid-broker-plugins-amqp-1-0-protocol=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-8-to-0-10=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-8-to-1-0=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-10-to-1-0=runtime -Sqpid-broker-plugins-derby-store=runtime -Sqpid-broker-plugins-jdbc-provider-bone=runtime -Sqpid-broker-plugins-jdbc-store=runtime -Sqpid-broker-plugins-management-http=runtime -Sqpid-broker-plugins-management-jmx=runtime -Sbroker-plugins-memory-store=runtime -Sqpid-bdbstore=runtime -Sqpid-bdbstore-jmx=runtime -Oqpid-bdbstore -Oqpid-bdbstore-jmx"/>
<import file="../module.xml"/>
- <property name="output.dir" value="${module.precompiled}/org/apache/qpid/server/filter/jms/selector"/>
-
- <target name="precompile" depends="gen_logging"/>
<target name="copy-etc-release" if="module.etc.exists" description="copy etc directory if it exists to build tree">
<copy todir="${module.release}/etc" failonerror="false" flatten="true">
@@ -84,4 +81,5 @@
<target name="release-bin" depends="release-bin-tasks"/>
<target name="bundle" depends="bundle-tasks"/>
+
</project>
diff --git a/qpid/java/broker/pom.xml b/qpid/java/broker/pom.xml
new file mode 100644
index 0000000000..7f09d5c046
--- /dev/null
+++ b/qpid/java/broker/pom.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-broker</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-access-control</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-0-10</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-1-0</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-10-to-1-0</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-derby-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-jdbc-provider-bone</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-jdbc-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-management-http</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-management-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-memory-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- optional modules -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/qpid-broker-bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/broker/python-test.xml b/qpid/java/broker/python-test.xml
index 5c263e3169..5c263e3169 100755..100644
--- a/qpid/java/broker/python-test.xml
+++ b/qpid/java/broker/python-test.xml
diff --git a/qpid/java/broker/src/main/assembly/qpid-broker-bin.xml b/qpid/java/broker/src/main/assembly/qpid-broker-bin.xml
new file mode 100644
index 0000000000..c7a190bbf2
--- /dev/null
+++ b/qpid/java/broker/src/main/assembly/qpid-broker-bin.xml
@@ -0,0 +1,48 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <baseDirectory>qpid-broker/${project.version}</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ <include>etc/</include>
+ </includes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>bin/</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}/../common</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>bin/qpid-run</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
deleted file mode 100644
index 4923565e26..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.startup;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import org.apache.qpid.server.BrokerOptions;
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.logging.LogRecorder;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.KeyStore;
-import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
-import org.apache.qpid.server.model.adapter.BrokerAdapter;
-import org.apache.qpid.server.model.adapter.GroupProviderFactory;
-import org.apache.qpid.server.model.adapter.PortFactory;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.util.MapValueConverter;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class BrokerRecoverer implements ConfiguredObjectRecoverer<Broker>
-{
- private static final Pattern MODEL_VERSION_PATTERN = Pattern.compile("^\\d+\\.\\d+$");
-
- private final StatisticsGatherer _statisticsGatherer;
- private final VirtualHostRegistry _virtualHostRegistry;
- private final LogRecorder _logRecorder;
- private final RootMessageLogger _rootMessageLogger;
- private final AuthenticationProviderFactory _authenticationProviderFactory;
- private final AccessControlProviderFactory _accessControlProviderFactory;
- private final PortFactory _portFactory;
- private final TaskExecutor _taskExecutor;
- private final BrokerOptions _brokerOptions;
- private final GroupProviderFactory _groupProviderFactory;
- private final StoreConfigurationChangeListener _storeChangeListener;
- private final PreferencesProviderCreator _preferencesProviderCreator;
-
- public BrokerRecoverer(AuthenticationProviderFactory authenticationProviderFactory, GroupProviderFactory groupProviderFactory,
- AccessControlProviderFactory accessControlProviderFactory, PortFactory portFactory, PreferencesProviderCreator preferencesProviderFactory, StatisticsGatherer statisticsGatherer,
- VirtualHostRegistry virtualHostRegistry, LogRecorder logRecorder, RootMessageLogger rootMessageLogger, TaskExecutor taskExecutor,
- BrokerOptions brokerOptions, StoreConfigurationChangeListener storeChangeListener)
- {
- _groupProviderFactory = groupProviderFactory;
- _portFactory = portFactory;
- _authenticationProviderFactory = authenticationProviderFactory;
- _accessControlProviderFactory = accessControlProviderFactory;
- _statisticsGatherer = statisticsGatherer;
- _virtualHostRegistry = virtualHostRegistry;
- _logRecorder = logRecorder;
- _rootMessageLogger = rootMessageLogger;
- _taskExecutor = taskExecutor;
- _brokerOptions = brokerOptions;
- _storeChangeListener = storeChangeListener;
- _preferencesProviderCreator = preferencesProviderFactory;
- }
-
- @Override
- public Broker create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject... parents)
- {
- //Map<String, Object> attributes = entry.getAttributes();
- Map<String, Object> attributesCopy = validateAttributes(entry);
-
- attributesCopy.put(Broker.MODEL_VERSION, Model.MODEL_VERSION);
-
- BrokerAdapter broker = new BrokerAdapter(entry.getId(), attributesCopy, _statisticsGatherer, _virtualHostRegistry,
- _logRecorder, _rootMessageLogger, _authenticationProviderFactory,_groupProviderFactory, _accessControlProviderFactory,
- _portFactory , _preferencesProviderCreator, _taskExecutor, entry.getStore(), _brokerOptions);
-
- broker.addChangeListener(_storeChangeListener);
-
- //Recover the SSL keystores / truststores first, then others that depend on them
- Map<String, Collection<ConfigurationEntry>> childEntries = new HashMap<String, Collection<ConfigurationEntry>>(entry.getChildren());
- Map<String, Collection<ConfigurationEntry>> priorityChildEntries = new HashMap<String, Collection<ConfigurationEntry>>(childEntries);
- List<String> types = new ArrayList<String>(childEntries.keySet());
-
- for(String type : types)
- {
- if(KeyStore.class.getSimpleName().equals(type) || TrustStore.class.getSimpleName().equals(type)
- || AuthenticationProvider.class.getSimpleName().equals(type))
- {
- childEntries.remove(type);
- }
- else
- {
- priorityChildEntries.remove(type);
- }
- }
-
- for (String type : priorityChildEntries.keySet())
- {
- recoverType(recovererProvider, _storeChangeListener, broker, priorityChildEntries, type);
- }
- for (String type : childEntries.keySet())
- {
- recoverType(recovererProvider, _storeChangeListener, broker, childEntries, type);
- }
-
- return broker;
- }
-
- private Map<String, Object> validateAttributes(ConfigurationEntry entry)
- {
- Map<String, Object> attributes = entry.getAttributes();
-
- String modelVersion = null;
- if (attributes.containsKey(Broker.MODEL_VERSION))
- {
- modelVersion = MapValueConverter.getStringAttribute(Broker.MODEL_VERSION, attributes, null);
- }
-
- if (modelVersion == null)
- {
- throw new IllegalConfigurationException("Broker " + Broker.MODEL_VERSION + " must be specified");
- }
-
- if (!MODEL_VERSION_PATTERN.matcher(modelVersion).matches())
- {
- throw new IllegalConfigurationException("Broker " + Broker.MODEL_VERSION + " is specified in incorrect format: "
- + modelVersion);
- }
-
- int versionSeparatorPosition = modelVersion.indexOf(".");
- String majorVersionPart = modelVersion.substring(0, versionSeparatorPosition);
- int majorModelVersion = Integer.parseInt(majorVersionPart);
- int minorModelVersion = Integer.parseInt(modelVersion.substring(versionSeparatorPosition + 1));
-
- if (majorModelVersion != Model.MODEL_MAJOR_VERSION || minorModelVersion > Model.MODEL_MINOR_VERSION)
- {
- throw new IllegalConfigurationException("The model version '" + modelVersion
- + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'");
- }
-
- if(!Model.MODEL_VERSION.equals(modelVersion))
- {
- String oldVersion;
- do
- {
- oldVersion = modelVersion;
- StoreUpgrader.upgrade(entry.getStore());
- entry = entry.getStore().getRootEntry();
- attributes = entry.getAttributes();
- modelVersion = MapValueConverter.getStringAttribute(Broker.MODEL_VERSION, attributes, null);
- }
- while(!(modelVersion.equals(oldVersion) || modelVersion.equals(Model.MODEL_VERSION)));
- }
-
- return new HashMap<String, Object>(attributes);
- }
-
- private void recoverType(RecovererProvider recovererProvider,
- StoreConfigurationChangeListener storeChangeListener,
- BrokerAdapter broker,
- Map<String, Collection<ConfigurationEntry>> childEntries,
- String type)
- {
- ConfiguredObjectRecoverer<?> recoverer = recovererProvider.getRecoverer(type);
- if (recoverer == null)
- {
- throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
- }
- Collection<ConfigurationEntry> entries = childEntries.get(type);
- for (ConfigurationEntry childEntry : entries)
- {
- ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
- if (object == null)
- {
- throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
- }
- broker.recoverChild(object);
- object.addChangeListener(storeChangeListener);
- }
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java
deleted file mode 100644
index 67268c9854..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProvider.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.startup;
-
-import org.apache.qpid.server.BrokerOptions;
-import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.logging.LogRecorder;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.model.AccessControlProvider;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.GroupProvider;
-import org.apache.qpid.server.model.KeyStore;
-import org.apache.qpid.server.model.Plugin;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
-import org.apache.qpid.server.model.adapter.GroupProviderFactory;
-import org.apache.qpid.server.model.adapter.PortFactory;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.plugin.AccessControlFactory;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.plugin.GroupManagerFactory;
-import org.apache.qpid.server.plugin.PluginFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class DefaultRecovererProvider implements RecovererProvider
-{
-
- private final StatisticsGatherer _brokerStatisticsGatherer;
- private final VirtualHostRegistry _virtualHostRegistry;
- private final LogRecorder _logRecorder;
- private final RootMessageLogger _rootMessageLogger;
- private final AuthenticationProviderFactory _authenticationProviderFactory;
- private final AccessControlProviderFactory _accessControlProviderFactory;
- private final PortFactory _portFactory;
- private final GroupProviderFactory _groupProviderFactory;
- private final QpidServiceLoader<PluginFactory> _pluginFactoryServiceLoader;
- private final TaskExecutor _taskExecutor;
- private final BrokerOptions _brokerOptions;
- private final StoreConfigurationChangeListener _storeChangeListener;
- private final PreferencesProviderCreator _preferencesProviderCreator;
-
- public DefaultRecovererProvider(StatisticsGatherer brokerStatisticsGatherer, VirtualHostRegistry virtualHostRegistry,
- LogRecorder logRecorder, RootMessageLogger rootMessageLogger, TaskExecutor taskExecutor, BrokerOptions brokerOptions, StoreConfigurationChangeListener storeChangeListener)
- {
- _preferencesProviderCreator = new PreferencesProviderCreator();
- _authenticationProviderFactory = new AuthenticationProviderFactory(new QpidServiceLoader<AuthenticationManagerFactory>(), _preferencesProviderCreator);
- _accessControlProviderFactory = new AccessControlProviderFactory(new QpidServiceLoader<AccessControlFactory>());
- _groupProviderFactory = new GroupProviderFactory(new QpidServiceLoader<GroupManagerFactory>());
- _portFactory = new PortFactory();
- _brokerStatisticsGatherer = brokerStatisticsGatherer;
- _virtualHostRegistry = virtualHostRegistry;
- _logRecorder = logRecorder;
- _rootMessageLogger = rootMessageLogger;
- _pluginFactoryServiceLoader = new QpidServiceLoader<PluginFactory>();
- _taskExecutor = taskExecutor;
- _brokerOptions = brokerOptions;
- _storeChangeListener = storeChangeListener;
- }
-
- @Override
- public ConfiguredObjectRecoverer<?> getRecoverer(String type)
- {
- if (Broker.class.getSimpleName().equals(type))
- {
- return new BrokerRecoverer(_authenticationProviderFactory, _groupProviderFactory, _accessControlProviderFactory, _portFactory, _preferencesProviderCreator,
- _brokerStatisticsGatherer, _virtualHostRegistry, _logRecorder, _rootMessageLogger, _taskExecutor, _brokerOptions, _storeChangeListener);
- }
- else if(VirtualHost.class.getSimpleName().equals(type))
- {
- return new VirtualHostRecoverer(_brokerStatisticsGatherer);
- }
- else if(AccessControlProvider.class.getSimpleName().equals(type))
- {
- return new AccessControlProviderRecoverer(_accessControlProviderFactory);
- }
- else if(AuthenticationProvider.class.getSimpleName().equals(type))
- {
- return new AuthenticationProviderRecoverer(_authenticationProviderFactory, _storeChangeListener);
- }
- else if(Port.class.getSimpleName().equals(type))
- {
- return new PortRecoverer(_portFactory);
- }
- else if(GroupProvider.class.getSimpleName().equals(type))
- {
- return new GroupProviderRecoverer(_groupProviderFactory);
- }
- else if(KeyStore.class.getSimpleName().equals(type))
- {
- return new KeyStoreRecoverer();
- }
- else if(TrustStore.class.getSimpleName().equals(type))
- {
- return new TrustStoreRecoverer();
- }
- else if(PreferencesProvider.class.getSimpleName().equals(type))
- {
- return new PreferencesProviderRecoverer(_preferencesProviderCreator);
- }
- else if(Plugin.class.getSimpleName().equals(type))
- {
- return new PluginRecoverer(_pluginFactoryServiceLoader);
- }
-
- return null;
- }
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java
deleted file mode 100644
index a455a61fee..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.qpid.server.configuration.startup;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-
-public class PreferencesProviderRecoverer implements ConfiguredObjectRecoverer<PreferencesProvider>
-{
-
- private PreferencesProviderCreator _preferencesProviderCreator;
-
- public PreferencesProviderRecoverer(PreferencesProviderCreator preferencesProviderCreator)
- {
- _preferencesProviderCreator = preferencesProviderCreator;
- }
-
- @Override
- public PreferencesProvider create(RecovererProvider recovererProvider, ConfigurationEntry entry,
- ConfiguredObject... parents)
- {
- if (parents == null || parents.length == 0)
- {
- throw new IllegalArgumentException("AuthenticationProvider parent is not passed!");
- }
- if (parents.length != 1)
- {
- throw new IllegalArgumentException("Only one parent is expected!");
- }
- if (!(parents[0] instanceof AuthenticationProvider))
- {
- throw new IllegalArgumentException("Parent is not a AuthenticationProvider");
- }
- AuthenticationProvider authenticationProvider = (AuthenticationProvider)parents[0];
- return _preferencesProviderCreator.recover(entry.getId(), entry.getAttributes(), authenticationProvider);
- }
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java
deleted file mode 100644
index b60c9c289f..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/RecovererHelper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.startup;
-
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-
-public class RecovererHelper
-{
- public static Broker verifyOnlyBrokerIsParent(ConfiguredObject... parents)
- {
- if (parents == null || parents.length == 0)
- {
- throw new IllegalArgumentException("Broker parent is not passed!");
- }
- if (parents.length != 1)
- {
- throw new IllegalArgumentException("Only one parent is expected!");
- }
- if (!(parents[0] instanceof Broker))
- {
- throw new IllegalArgumentException("Parent is not a broker");
- }
- return (Broker)parents[0];
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java
deleted file mode 100644
index 0789664dd8..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.qpid.server.configuration.startup;/*
- *
- * 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.
- *
- */
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.model.Broker;
-
-public abstract class StoreUpgrader
-{
-
- private static Map<String, StoreUpgrader> _upgraders = new HashMap<String, StoreUpgrader>();
-
- // Note: don't use externally defined constants in upgraders in case they change, the values here MUST stay the same
- // no matter what changes are made to the code in the future
-
- private final static StoreUpgrader UPGRADE_1_0 = new StoreUpgrader("1.0")
- {
- @Override
- protected void doUpgrade(ConfigurationEntryStore store)
- {
- ConfigurationEntry root = store.getRootEntry();
- Map<String, Collection<ConfigurationEntry>> children = root.getChildren();
- Collection<ConfigurationEntry> vhosts = children.get("VirtualHost");
- Collection<ConfigurationEntry> changed = new HashSet<ConfigurationEntry>();
- for(ConfigurationEntry vhost : vhosts)
- {
- Map<String, Object> attributes = vhost.getAttributes();
- if(attributes.containsKey("storeType"))
- {
- attributes = new HashMap<String, Object>(attributes);
- attributes.put("type", "STANDARD");
-
- changed.add(new ConfigurationEntry(vhost.getId(),vhost.getType(),attributes,vhost.getChildrenIds(),store));
-
- }
-
- }
- Map<String, Object> attributes = new HashMap<String, Object>(root.getAttributes());
- attributes.put(Broker.MODEL_VERSION, "1.1");
- changed.add(new ConfigurationEntry(root.getId(),root.getType(),attributes,root.getChildrenIds(),store));
-
- store.save(changed.toArray(new ConfigurationEntry[changed.size()]));
-
- }
- };
-
- private StoreUpgrader(String version)
- {
- _upgraders.put(version, this);
- }
-
- public static void upgrade(ConfigurationEntryStore store)
- {
- StoreUpgrader upgrader = _upgraders.get(store.getRootEntry().getAttributes().get(Broker.MODEL_VERSION).toString());
- if(upgrader != null)
- {
- upgrader.doUpgrade(store);
- }
- }
-
- protected abstract void doUpgrade(ConfigurationEntryStore store);
-
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
deleted file mode 100644
index 92d170fad9..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
+++ /dev/null
@@ -1,709 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.store;
-
-import static org.apache.qpid.server.configuration.ConfigurationEntry.ATTRIBUTE_NAME;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.util.Strings;
-import org.apache.qpid.util.Strings.ChainedResolver;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializationConfig;
-import org.codehaus.jackson.node.ArrayNode;
-
-public class MemoryConfigurationEntryStore implements ConfigurationEntryStore
-{
- public static final String STORE_TYPE = "memory";
-
- private static final String DEFAULT_BROKER_NAME = "Broker";
- private static final String ID = "id";
- private static final String TYPE = "@type";
-
- static final int STORE_VERSION = 1;
-
- private final ObjectMapper _objectMapper;
- private final Map<UUID, ConfigurationEntry> _entries;
- private final Map<String, Class<? extends ConfiguredObject>> _relationshipClasses;
- private final ConfigurationEntryStoreUtil _util = new ConfigurationEntryStoreUtil();
-
- private String _storeLocation;
- private UUID _rootId;
-
- private boolean _generatedObjectIdDuringLoad;
-
- private ChainedResolver _resolver;
-
- protected MemoryConfigurationEntryStore(Map<String, String> configProperties)
- {
- _objectMapper = new ObjectMapper();
- _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- _objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
- _entries = new HashMap<UUID, ConfigurationEntry>();
- _relationshipClasses = buildRelationshipClassMap();
- _resolver = new Strings.ChainedResolver(Strings.SYSTEM_RESOLVER,
- new Strings.MapResolver(configProperties));
- }
-
- MemoryConfigurationEntryStore(String json, Map<String, String> configProperties)
- {
- this(configProperties);
- if (json == null || "".equals(json))
- {
- createRootEntry();
- }
- else
- {
- loadFromJson(json);
- }
- }
-
- public MemoryConfigurationEntryStore(String initialStoreLocation, ConfigurationEntryStore initialStore, Map<String, String> configProperties)
- {
- this(configProperties);
- if (initialStore == null && (initialStoreLocation == null || "".equals(initialStoreLocation) ))
- {
- throw new IllegalConfigurationException("Cannot instantiate the memory broker store as neither initial store nor initial store location is provided");
- }
-
- if (initialStore != null)
- {
- if (initialStore instanceof MemoryConfigurationEntryStore)
- {
- _storeLocation = initialStore.getStoreLocation();
- }
- _rootId = initialStore.getRootEntry().getId();
- copyEntry(_rootId, initialStore, _entries);
- }
- else
- {
- _storeLocation = initialStoreLocation;
- load(_util.toURL(_storeLocation));
- }
- }
-
- @Override
- public synchronized UUID[] remove(UUID... entryIds)
- {
- List<UUID> removedIds = new ArrayList<UUID>();
- for (UUID uuid : entryIds)
- {
- if (_rootId.equals(uuid))
- {
- throw new IllegalConfigurationException("Cannot remove root entry");
- }
- }
- for (UUID uuid : entryIds)
- {
- if (removeInternal(uuid))
- {
- // remove references to the entry from parent entries
- for (ConfigurationEntry entry : _entries.values())
- {
- if (entry.hasChild(uuid))
- {
- Set<UUID> children = new HashSet<UUID>(entry.getChildrenIds());
- children.remove(uuid);
- ConfigurationEntry referal = new ConfigurationEntry(entry.getId(), entry.getType(),
- entry.getAttributes(), children, this);
- _entries.put(entry.getId(), referal);
- }
- }
- removedIds.add(uuid);
- }
- }
-
- return removedIds.toArray(new UUID[removedIds.size()]);
- }
-
- @Override
- public synchronized void save(ConfigurationEntry... entries)
- {
- replaceEntries(entries);
- }
-
- @Override
- public ConfigurationEntry getRootEntry()
- {
- return getEntry(_rootId);
- }
-
- @Override
- public synchronized ConfigurationEntry getEntry(UUID id)
- {
- return _entries.get(id);
- }
-
- /**
- * Copies the store into the given location
- *
- * @param target location to copy store into
- * @throws IllegalConfigurationException if store cannot be copied into given location
- */
- public void copyTo(String copyLocation)
- {
- File file = new File(copyLocation);
- if (!file.exists())
- {
- createFileIfNotExist(file);
- }
- saveAsTree(file);
- }
-
- @Override
- public String getStoreLocation()
- {
- return _storeLocation;
- }
-
- @Override
- public int getVersion()
- {
- return STORE_VERSION;
- }
-
- @Override
- public String getType()
- {
- return STORE_TYPE;
- }
-
- @Override
- public String toString()
- {
- return "MemoryConfigurationEntryStore [_rootId=" + _rootId + "]";
- }
-
- protected boolean replaceEntries(ConfigurationEntry... entries)
- {
- boolean anySaved = false;
- for (ConfigurationEntry entry : entries)
- {
- ConfigurationEntry oldEntry = _entries.put(entry.getId(), entry);
- if (!entry.equals(oldEntry))
- {
- anySaved = true;
- }
- }
- return anySaved;
- }
-
- protected ObjectMapper getObjectMapper()
- {
- return _objectMapper;
- }
-
- protected void saveAsTree(File file)
- {
- saveAsTree(_rootId, _entries, _objectMapper, file, STORE_VERSION);
- }
-
- protected void saveAsTree(UUID rootId, Map<UUID, ConfigurationEntry> entries, ObjectMapper mapper, File file, int version)
- {
- Map<String, Object> tree = toTree(rootId, entries);
- tree.put(Broker.STORE_VERSION, version);
- try
- {
- mapper.writeValue(file, tree);
- }
- catch (JsonGenerationException e)
- {
- throw new IllegalConfigurationException("Cannot generate json!", e);
- }
- catch (JsonMappingException e)
- {
- throw new IllegalConfigurationException("Cannot map objects for json serialization!", e);
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot save configuration into " + file + "!", e);
- }
- }
-
- protected void load(URL url)
- {
- InputStream is = null;
- try
- {
- is = url.openStream();
- JsonNode node = loadJsonNodes(is, _objectMapper);
-
- int storeVersion = 0;
- JsonNode storeVersionNode = node.get(Broker.STORE_VERSION);
- if (storeVersionNode == null || storeVersionNode.isNull())
- {
- throw new IllegalConfigurationException("Broker " + Broker.STORE_VERSION + " attribute must be specified");
- }
- else
- {
- storeVersion = storeVersionNode.getIntValue();
- }
-
- if (storeVersion != STORE_VERSION)
- {
- throw new IllegalConfigurationException("The data of version " + storeVersion
- + " can not be loaded by store of version " + STORE_VERSION);
- }
-
- ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries, null);
- _rootId = brokerEntry.getId();
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot load store from: " + url, e);
- }
- finally
- {
- if (is != null)
- {
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot close input stream for: " + url, e);
- }
- }
- }
- }
- }
-
- protected void createFileIfNotExist(File file)
- {
- File parent = file.getParentFile();
- if (!parent.exists())
- {
- if (!parent.mkdirs())
- {
- throw new IllegalConfigurationException("Cannot create folders " + parent);
- }
- }
- try
- {
- file.createNewFile();
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot create file " + file, e);
- }
- }
-
- protected void copyEntry(UUID entryId, ConfigurationEntryStore initialStore, Map<UUID,ConfigurationEntry> entries)
- {
- ConfigurationEntry entry = initialStore.getEntry(entryId);
- if (entry != null)
- {
- if (entries.containsKey(entryId))
- {
- throw new IllegalConfigurationException("Duplicate id is found: " + entryId
- + "! The following configuration entries have the same id: " + entries.get(entryId) + ", " + entry);
- }
-
- Set<UUID> children = entry.getChildrenIds();
- Set<UUID> childrenCopy = children == null? null : new HashSet<UUID>(children);
- ConfigurationEntry copy = new ConfigurationEntry(entryId, entry.getType(), new HashMap<String, Object>(entry.getAttributes()), childrenCopy, this);
- entries.put(entryId, copy);
- if (children != null)
- {
- for (UUID uuid : children)
- {
- copyEntry(uuid, initialStore, entries);
- }
- }
- }
- }
-
- private void loadFromJson(String json)
- {
- ByteArrayInputStream bais = null;
- try
- {
- byte[] bytes = json.getBytes("UTF-8");
- bais = new ByteArrayInputStream(bytes);
- JsonNode node = loadJsonNodes(bais, _objectMapper);
- ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries, null);
- _rootId = brokerEntry.getId();
- }
- catch(Exception e)
- {
- throw new IllegalConfigurationException("Cannot create store from json:" + json);
- }
- finally
- {
- if (bais != null)
- {
- try
- {
- bais.close();
- }
- catch (IOException e)
- {
- // ByteArrayInputStream#close() is an empty method
- }
- }
- }
- }
-
- private void createRootEntry()
- {
- ConfigurationEntry brokerEntry = new ConfigurationEntry(UUIDGenerator.generateRandomUUID(),
- Broker.class.getSimpleName(), Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), this);
- _rootId = brokerEntry.getId();
- _entries.put(_rootId, brokerEntry);
- }
-
- private Map<String, Object> toTree(UUID rootId, Map<UUID, ConfigurationEntry> entries)
- {
- ConfigurationEntry entry = entries.get(rootId);
- if (entry == null || !entry.getId().equals(rootId))
- {
- throw new IllegalConfigurationException("Cannot find entry with id " + rootId + "!");
- }
- Map<String, Object> tree = new TreeMap<String, Object>();
- Map<String, Object> attributes = entry.getAttributes();
- if (attributes != null)
- {
- tree.putAll(attributes);
- }
- tree.put(ID, entry.getId());
- Set<UUID> childrenIds = entry.getChildrenIds();
- if (childrenIds != null && !childrenIds.isEmpty())
- {
- for (UUID relationship : childrenIds)
- {
- ConfigurationEntry child = entries.get(relationship);
- if (child != null)
- {
- String relationshipName = child.getType().toLowerCase() + "s";
-
- @SuppressWarnings("unchecked")
- Collection<Map<String, Object>> children = (Collection<Map<String, Object>>) tree.get(relationshipName);
- if (children == null)
- {
- children = new ArrayList<Map<String, Object>>();
- tree.put(relationshipName, children);
- }
- Map<String, Object> childAsMap = toTree(relationship, entries);
- children.add(childAsMap);
- }
- }
- }
- return tree;
- }
-
- private Map<String, Class<? extends ConfiguredObject>> buildRelationshipClassMap()
- {
- Map<String, Class<? extends ConfiguredObject>> relationships = new HashMap<String, Class<? extends ConfiguredObject>>();
-
- Collection<Class<? extends ConfiguredObject>> children = Model.getInstance().getChildTypes(Broker.class);
- for (Class<? extends ConfiguredObject> childClass : children)
- {
- String name = childClass.getSimpleName().toLowerCase();
- String relationshipName = name + (name.endsWith("s") ? "es" : "s");
- relationships.put(relationshipName, childClass);
- }
- return relationships;
- }
-
- private boolean removeInternal(UUID entryId)
- {
- ConfigurationEntry oldEntry = _entries.remove(entryId);
- if (oldEntry != null)
- {
- Set<UUID> children = oldEntry.getChildrenIds();
- if (children != null && !children.isEmpty())
- {
- for (UUID childId : children)
- {
- removeInternal(childId);
- }
- }
- return true;
- }
- return false;
- }
-
- private JsonNode loadJsonNodes(InputStream is, ObjectMapper mapper)
- {
- JsonNode root = null;
- try
- {
- root = mapper.readTree(is);
- }
- catch (JsonProcessingException e)
- {
- throw new IllegalConfigurationException("Cannot parse json", e);
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot read json", e);
- }
- return root;
- }
-
- private ConfigurationEntry toEntry(JsonNode parent, Class<? extends ConfiguredObject> expectedConfiguredObjectClass, Map<UUID, ConfigurationEntry> entries, Class<? extends ConfiguredObject> parentClass)
- {
- Map<String, Object> attributes = null;
- Set<UUID> childrenIds = new TreeSet<UUID>();
- Iterator<String> fieldNames = parent.getFieldNames();
- String type = null;
- String idAsString = null;
- while (fieldNames.hasNext())
- {
- String fieldName = fieldNames.next();
- JsonNode fieldNode = parent.get(fieldName);
- if (fieldName.equals(ID))
- {
- idAsString = fieldNode.asText();
- }
- else if (fieldName.equals(TYPE))
- {
- type = fieldNode.asText();
- }
- else if (fieldNode.isArray())
- {
- // array containing either broker children or attribute values
- Iterator<JsonNode> elements = fieldNode.getElements();
- List<Object> fieldValues = null;
- while (elements.hasNext())
- {
- JsonNode element = elements.next();
- if (element.isObject())
- {
- Class<? extends ConfiguredObject> expectedChildConfiguredObjectClass = _relationshipClasses.get(fieldName);
- if (expectedChildConfiguredObjectClass == null && expectedConfiguredObjectClass != null)
- {
- Collection<Class<? extends ConfiguredObject>> childTypes = Model.getInstance().getChildTypes(expectedConfiguredObjectClass);
- for (Class<? extends ConfiguredObject> childType : childTypes)
- {
- String relationship = childType.getSimpleName().toLowerCase();
- relationship += relationship.endsWith("s") ? "es": "s";
- if (fieldName.equals(relationship))
- {
- expectedChildConfiguredObjectClass = childType;
- break;
- }
- }
- }
- // assuming it is a child node
- ConfigurationEntry entry = toEntry(element, expectedChildConfiguredObjectClass, entries, expectedConfiguredObjectClass);
- childrenIds.add(entry.getId());
- }
- else
- {
- if (fieldValues == null)
- {
- fieldValues = new ArrayList<Object>();
- }
- fieldValues.add(toObject(element));
- }
- }
- if (fieldValues != null)
- {
- Object[] array = fieldValues.toArray(new Object[fieldValues.size()]);
- if (attributes == null)
- {
- attributes = new HashMap<String, Object>();
- }
- attributes.put(fieldName, array);
- }
- }
- else if (fieldNode.isObject())
- {
- // ignore, in-line objects are not supported yet
- }
- else
- {
- // primitive attribute
- Object value = toObject(fieldNode);
- if (attributes == null)
- {
- attributes = new HashMap<String, Object>();
- }
- attributes.put(fieldName, value);
- }
- }
-
- if (type == null)
- {
- if (expectedConfiguredObjectClass == null)
- {
- throw new IllegalConfigurationException("Type attribute is not provided for configuration entry " + parent);
- }
- else
- {
- type = expectedConfiguredObjectClass.getSimpleName();
- }
- }
- String name = null;
- if (attributes != null)
- {
- name = (String) attributes.get(ATTRIBUTE_NAME);
- }
- if ((name == null || "".equals(name)))
- {
- if (expectedConfiguredObjectClass == Broker.class)
- {
- name = DEFAULT_BROKER_NAME;
- }
- else
- {
- throw new IllegalConfigurationException("Name attribute is not provided for configuration entry " + parent);
- }
- }
- UUID id = null;
- if (idAsString == null)
- {
- id = UUIDGenerator.generateRandomUUID();
-
- _generatedObjectIdDuringLoad = true;
- }
- else
- {
- try
- {
- id = UUID.fromString(idAsString);
- }
- catch (Exception e)
- {
- throw new IllegalConfigurationException(
- "ID attribute value does not conform to UUID format for configuration entry " + parent);
- }
- }
- ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, childrenIds, this);
- if (entries.containsKey(id))
- {
- throw new IllegalConfigurationException("Duplicate id is found: " + id
- + "! The following configuration entries have the same id: " + entries.get(id) + ", " + entry);
- }
- entries.put(id, entry);
- return entry;
- }
-
- private Object toObject(JsonNode node)
- {
- if (node.isValueNode())
- {
- if (node.isBoolean())
- {
- return node.asBoolean();
- }
- else if (node.isDouble())
- {
- return node.asDouble();
- }
- else if (node.isInt())
- {
- return node.asInt();
- }
- else if (node.isLong())
- {
- return node.asLong();
- }
- else if (node.isNull())
- {
- return null;
- }
- else
- {
- return Strings.expand(node.asText(), _resolver);
- }
- }
- else if (node.isArray())
- {
- return toArray(node);
- }
- else if (node.isObject())
- {
- return toMap(node);
- }
- else
- {
- throw new IllegalConfigurationException("Unexpected node: " + node);
- }
- }
-
- private Map<String, Object> toMap(JsonNode node)
- {
- Map<String, Object> object = new TreeMap<String, Object>();
- Iterator<String> fieldNames = node.getFieldNames();
- while (fieldNames.hasNext())
- {
- String name = fieldNames.next();
- Object value = toObject(node.get(name));
- object.put(name, value);
- }
- return object;
- }
-
- private Object toArray(JsonNode node)
- {
- ArrayNode arrayNode = (ArrayNode) node;
- Object[] array = new Object[arrayNode.size()];
- Iterator<JsonNode> elements = arrayNode.getElements();
- for (int i = 0; i < array.length; i++)
- {
- array[i] = toObject(elements.next());
- }
- return array;
- }
-
- protected boolean isGeneratedObjectIdDuringLoad()
- {
- return _generatedObjectIdDuringLoad;
- }
-
- protected ConfigurationEntryStoreUtil getConfigurationEntryStoreUtil()
- {
- return _util;
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Model.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Model.java
deleted file mode 100644
index 45fadbdbcb..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Model.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-public class Model
-{
- /*
- * API version for the broker model
- *
- * 1.0 Initial version
- * 1.1 Addition of mandatory virtual host type / different types of virtual host
- *
- */
- public static final int MODEL_MAJOR_VERSION = 1;
- public static final int MODEL_MINOR_VERSION = 1;
- public static final String MODEL_VERSION = MODEL_MAJOR_VERSION + "." + MODEL_MINOR_VERSION;
-
- private static final Model MODEL_INSTANCE = new Model();
-
- private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>
- _parents = new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
-
- private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>
- _children = new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
-
- public static Model getInstance()
- {
- return MODEL_INSTANCE;
- }
-
- private Model()
- {
- addRelationship(Broker.class, VirtualHost.class);
- addRelationship(Broker.class, Port.class);
- addRelationship(Broker.class, AccessControlProvider.class);
- addRelationship(Broker.class, AuthenticationProvider.class);
- addRelationship(Broker.class, GroupProvider.class);
- addRelationship(Broker.class, TrustStore.class);
- addRelationship(Broker.class, KeyStore.class);
- addRelationship(Broker.class, Plugin.class);
-
- addRelationship(VirtualHost.class, Exchange.class);
- addRelationship(VirtualHost.class, Queue.class);
- addRelationship(VirtualHost.class, Connection.class);
- addRelationship(VirtualHost.class, VirtualHostAlias.class);
-
- addRelationship(AuthenticationProvider.class, User.class);
- addRelationship(AuthenticationProvider.class, PreferencesProvider.class);
- addRelationship(User.class, GroupMember.class);
-
- addRelationship(GroupProvider.class, Group.class);
- addRelationship(Group.class, GroupMember.class);
-
- addRelationship(Connection.class, Session.class);
-
- addRelationship(Queue.class, Binding.class);
- addRelationship(Queue.class, Consumer.class);
-
- addRelationship(Exchange.class, Binding.class);
- addRelationship(Exchange.class, Publisher.class);
-
- addRelationship(Session.class, Consumer.class);
- addRelationship(Session.class, Publisher.class);
- }
-
- public Collection<Class<? extends ConfiguredObject>> getParentTypes(Class<? extends ConfiguredObject> child)
- {
- Collection<Class<? extends ConfiguredObject>> parentTypes = _parents.get(child);
- return parentTypes == null ? Collections.<Class<? extends ConfiguredObject>>emptyList()
- : Collections.unmodifiableCollection(parentTypes);
- }
-
- public Collection<Class<? extends ConfiguredObject>> getChildTypes(Class<? extends ConfiguredObject> parent)
- {
- Collection<Class<? extends ConfiguredObject>> childTypes = _children.get(parent);
- return childTypes == null ? Collections.<Class<? extends ConfiguredObject>>emptyList()
- : Collections.unmodifiableCollection(childTypes);
- }
-
- private void addRelationship(Class<? extends ConfiguredObject> parent, Class<? extends ConfiguredObject> child)
- {
- Collection<Class<? extends ConfiguredObject>> parents = _parents.get(child);
- if(parents == null)
- {
- parents = new ArrayList<Class<? extends ConfiguredObject>>();
- _parents.put(child, parents);
- }
- parents.add(parent);
-
- Collection<Class<? extends ConfiguredObject>> children = _children.get(parent);
- if(children == null)
- {
- children = new ArrayList<Class<? extends ConfiguredObject>>();
- _children.put(parent, children);
- }
- children.add(child);
- }
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java
deleted file mode 100644
index 96d02b2ef6..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/PreferencesProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.model;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-public interface PreferencesProvider extends ConfiguredObject
-{
- String ID = "id";
- String NAME = "name";
- String TYPE = "type";
- String CREATED = "created";
- String UPDATED = "updated";
- String DURABLE = "durable";
- String LIFETIME_POLICY = "lifetimePolicy";
- String STATE = "state";
- String TIME_TO_LIVE = "timeToLive";
-
- Collection<String> AVAILABLE_ATTRIBUTES =
- Collections.unmodifiableList(
- Arrays.asList(
- ID,
- NAME,
- STATE,
- TYPE,
- CREATED,
- UPDATED,
- DURABLE,
- LIFETIME_POLICY,
- TIME_TO_LIVE
- ));
-
- /**
- * Returns preferences {@link Map} for a given user ID
- * @param userId user ID to retrieve preferences for
- * @return preferences {@link Map}
- */
- Map<String, Object> getPreferences(String userId);
-
- /**
- * Set user preferences as specified in a given {@link Map}
- * @param userId user ID to set preferences for
- * @param preferences new preferences
- * @return existing user preferences
- */
- Map<String, Object> setPreferences(String userId, Map<String, Object> preferences);
-
- /**
- * Delete preferences for a given user ID
- * @param userId user ID to delete preferences for
- * @return user preferences before the deletion
- */
- Map<String, Object> deletePreferences(String userId);
-
- /**
- * Returns set of the user IDs having preferences set
- * @return user IDs
- */
- Set<String> listUserIDs();
-
- /**
- * Returns authentication provider associated with this preferences provider
- * @return authentication provider
- */
- AuthenticationProvider getAuthenticationProvider();
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/User.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/User.java
deleted file mode 100644
index f9d6f17ffd..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/User.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.model;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-public interface User extends ConfiguredObject
-{
- String CREATED = "created";
- String DURABLE = "durable";
- String ID = "id";
- String LIFETIME_POLICY = "lifetimePolicy";
- String NAME = "name";
- String STATE = "state";
- String TIME_TO_LIVE = "timeToLive";
- String UPDATED = "updated";
- String PASSWORD = "password";
-
- // Attributes
- public static final Collection<String> AVAILABLE_ATTRIBUTES =
- Collections.unmodifiableList(
- Arrays.asList(
- ID,
- NAME,
- STATE,
- DURABLE,
- LIFETIME_POLICY,
- TIME_TO_LIVE,
- CREATED,
- UPDATED,
- PASSWORD
- ));
-
- public void setPassword(String password);
-
- public Map<String, Object> getPreferences();
-
- public Object getPreference(String name);
-
- public Map<String, Object> setPreferences(Map<String, Object> preferences);
-
- public Map<String, Object> replacePreferences(Map<String, Object> newPreferences);
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
deleted file mode 100644
index cbf8e1ba30..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import java.io.IOException;
-import java.security.AccessControlException;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.security.auth.login.AccountNotFoundException;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.IllegalStateTransitionException;
-import org.apache.qpid.server.model.IntegrityViolationException;
-import org.apache.qpid.server.model.LifetimePolicy;
-import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.Statistics;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.User;
-import org.apache.qpid.server.model.VirtualHostAlias;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.security.SubjectCreator;
-import org.apache.qpid.server.security.access.Operation;
-import org.apache.qpid.server.security.auth.UsernamePrincipal;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.SecurityManager;
-import org.apache.qpid.server.util.MapValueConverter;
-
-public abstract class AuthenticationProviderAdapter<T extends AuthenticationManager> extends AbstractAdapter implements AuthenticationProvider
-{
- private static final Logger LOGGER = Logger.getLogger(AuthenticationProviderAdapter.class);
-
- protected T _authManager;
- protected final Broker _broker;
-
- protected Collection<String> _supportedAttributes;
- protected Map<String, AuthenticationManagerFactory> _factories;
- private final AtomicReference<State> _state;
- private PreferencesProviderCreator _preferencesProviderCreator;
- private PreferencesProvider _preferencesProvider;
-
- private AuthenticationProviderAdapter(UUID id, Broker broker, final T authManager, Map<String, Object> attributes, Collection<String> attributeNames, PreferencesProviderCreator preferencesProviderCreator)
- {
- super(id, null, null, broker.getTaskExecutor());
- _authManager = authManager;
- _broker = broker;
- _supportedAttributes = createSupportedAttributes(attributeNames);
- _factories = getAuthenticationManagerFactories();
-
- State state = MapValueConverter.getEnumAttribute(State.class, STATE, attributes, State.INITIALISING);
- _state = new AtomicReference<State>(state);
- addParent(Broker.class, broker);
-
- _preferencesProviderCreator = preferencesProviderCreator;
-
- // set attributes now after all attribute names are known
- if (attributes != null)
- {
- for (String name : _supportedAttributes)
- {
- if (attributes.containsKey(name))
- {
- changeAttribute(name, null, attributes.get(name));
- }
- }
- }
- }
-
- T getAuthManager()
- {
- return _authManager;
- }
-
- @Override
- public Collection<VirtualHostAlias> getVirtualHostPortBindings()
- {
- return Collections.emptyList();
- }
-
- @Override
- public String getName()
- {
- return (String)getAttribute(AuthenticationProvider.NAME);
- }
-
- @Override
- public String setName(String currentName, String desiredName) throws IllegalStateException, AccessControlException
- {
- return null;
- }
-
- @Override
- public State getActualState()
- {
- return _state.get();
- }
-
- @Override
- public boolean isDurable()
- {
- return true;
- }
-
- @Override
- public void setDurable(boolean durable)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- }
-
- @Override
- public LifetimePolicy getLifetimePolicy()
- {
- return LifetimePolicy.PERMANENT;
- }
-
- @Override
- public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- return null;
- }
-
- @Override
- public long getTimeToLive()
- {
- return 0;
- }
-
- @Override
- public long setTimeToLive(long expected, long desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- return 0;
- }
-
- @Override
- public Statistics getStatistics()
- {
- return NoStatistics.getInstance();
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return _supportedAttributes;
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if(CREATED.equals(name))
- {
- // TODO
- }
- else if(DURABLE.equals(name))
- {
- return true;
- }
- else if(ID.equals(name))
- {
- return getId();
- }
- else if(LIFETIME_POLICY.equals(name))
- {
- return LifetimePolicy.PERMANENT;
- }
- else if(STATE.equals(name))
- {
- return getActualState();
- }
- else if(TIME_TO_LIVE.equals(name))
- {
- // TODO
- }
- else if(UPDATED.equals(name))
- {
- // TODO
- }
- return super.getAttribute(name);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- if (clazz == PreferencesProvider.class && _preferencesProvider != null)
- {
- return (Collection<C>)Collections.<PreferencesProvider>singleton(_preferencesProvider);
- }
- return Collections.emptySet();
- }
-
- @Override
- public boolean setState(State currentState, State desiredState)
- throws IllegalStateTransitionException, AccessControlException
- {
- State state = _state.get();
- if(desiredState == State.DELETED)
- {
- String providerName = getName();
-
- // verify that provider is not in use
- Collection<Port> ports = new ArrayList<Port>(_broker.getPorts());
- for (Port port : ports)
- {
- if (providerName.equals(port.getAttribute(Port.AUTHENTICATION_PROVIDER)))
- {
- throw new IntegrityViolationException("Authentication provider '" + providerName + "' is set on port " + port.getName());
- }
- }
-
- if ((state == State.INITIALISING || state == State.ACTIVE || state == State.STOPPED || state == State.QUIESCED || state == State.ERRORED)
- && _state.compareAndSet(state, State.DELETED))
- {
- _authManager.close();
- _authManager.onDelete();
- if (_preferencesProvider != null)
- {
- _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.DELETED);
- }
- return true;
- }
- else
- {
- throw new IllegalStateException("Cannot delete authentication provider in state: " + state);
- }
- }
- else if(desiredState == State.ACTIVE)
- {
- if ((state == State.INITIALISING || state == State.QUIESCED || state == State.STOPPED) && _state.compareAndSet(state, State.ACTIVE))
- {
- try
- {
- _authManager.initialise();
- if (_preferencesProvider != null)
- {
- _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.ACTIVE);
- }
- return true;
- }
- catch(RuntimeException e)
- {
- _state.compareAndSet(State.ACTIVE, State.ERRORED);
- if (_broker.isManagementMode())
- {
- LOGGER.warn("Failed to activate authentication provider: " + getName(), e);
- }
- else
- {
- throw e;
- }
- }
- }
- else
- {
- throw new IllegalStateException("Cannot activate authentication provider in state: " + state);
- }
- }
- else if (desiredState == State.QUIESCED)
- {
- if (state == State.INITIALISING && _state.compareAndSet(state, State.QUIESCED))
- {
- return true;
- }
- }
- else if(desiredState == State.STOPPED)
- {
- if (_state.compareAndSet(state, State.STOPPED))
- {
- _authManager.close();
- if (_preferencesProvider != null)
- {
- _preferencesProvider.setDesiredState(_preferencesProvider.getActualState(), State.STOPPED);
- }
- return true;
- }
- else
- {
- throw new IllegalStateException("Cannot stop authentication provider in state: " + state);
- }
- }
-
- return false;
- }
-
- @Override
- public SubjectCreator getSubjectCreator()
- {
- return new SubjectCreator(_authManager, _broker.getGroupProviders());
- }
-
- @Override
- protected void changeAttributes(Map<String, Object> attributes)
- {
- Map<String, Object> effectiveAttributes = super.generateEffectiveAttributes(attributes);
- AuthenticationManager manager = validateAttributes(effectiveAttributes);
- manager.initialise();
- super.changeAttributes(attributes);
- _authManager = (T)manager;
-
- // if provider was previously in ERRORED state then set its state to ACTIVE
- _state.compareAndSet(State.ERRORED, State.ACTIVE);
- }
-
- private Map<String, AuthenticationManagerFactory> getAuthenticationManagerFactories()
- {
- QpidServiceLoader<AuthenticationManagerFactory> loader = new QpidServiceLoader<AuthenticationManagerFactory>();
- Iterable<AuthenticationManagerFactory> factories = loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class);
- Map<String, AuthenticationManagerFactory> factoryMap = new HashMap<String, AuthenticationManagerFactory>();
- for (AuthenticationManagerFactory factory : factories)
- {
- factoryMap.put(factory.getType(), factory);
- }
- return factoryMap;
- }
-
- protected Collection<String> createSupportedAttributes(Collection<String> factoryAttributes)
- {
- List<String> attributesNames = new ArrayList<String>(AVAILABLE_ATTRIBUTES);
- if (factoryAttributes != null)
- {
- attributesNames.addAll(factoryAttributes);
- }
- return Collections.unmodifiableCollection(attributesNames);
- }
-
- protected AuthenticationManager validateAttributes(Map<String, Object> attributes)
- {
- super.validateChangeAttributes(attributes);
-
- String newName = (String)attributes.get(NAME);
- String currentName = getName();
- if (!currentName.equals(newName))
- {
- throw new IllegalConfigurationException("Changing the name of authentication provider is not supported");
- }
- String newType = (String)attributes.get(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
- String currentType = (String)getAttribute(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
- if (!currentType.equals(newType))
- {
- throw new IllegalConfigurationException("Changing the type of authentication provider is not supported");
- }
- AuthenticationManagerFactory managerFactory = _factories.get(newType);
- if (managerFactory == null)
- {
- throw new IllegalConfigurationException("Cannot find authentication provider factory for type " + newType);
- }
- AuthenticationManager manager = managerFactory.createInstance(attributes);
- if (manager == null)
- {
- throw new IllegalConfigurationException("Cannot change authentication provider " + newName + " of type " + newType + " with the given attributes");
- }
- return manager;
- }
-
- @Override
- protected void authoriseSetDesiredState(State currentState, State desiredState) throws AccessControlException
- {
- if(desiredState == State.DELETED)
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.DELETE))
- {
- throw new AccessControlException("Deletion of authentication provider is denied");
- }
- }
- }
-
- @Override
- protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of authentication provider attributes is denied");
- }
- }
-
- @Override
- protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), AuthenticationProvider.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of authentication provider attributes is denied");
- }
- }
-
- public PreferencesProvider getPreferencesProvider()
- {
- return _preferencesProvider;
- }
-
- public void setPreferencesProvider(PreferencesProvider provider)
- {
- if (AnonymousAuthenticationManagerFactory.PROVIDER_TYPE.equals(getAttribute(TYPE)))
- {
- throw new IllegalConfigurationException("Cannot set preferences provider for anonymous authentication provider");
- }
- _preferencesProvider = provider;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
- {
- if(childClass == PreferencesProvider.class)
- {
- String name = MapValueConverter.getStringAttribute(PreferencesProvider.NAME, attributes);
- PreferencesProvider pp = _preferencesProviderCreator.create(UUIDGenerator.generatePreferencesProviderUUID(name, getName()), attributes, this);
- pp.setDesiredState(State.INITIALISING, State.ACTIVE);
- _preferencesProvider = pp;
- return (C)pp;
- }
- throw new IllegalArgumentException("Cannot create child of class " + childClass.getSimpleName());
- }
-
- public static class SimpleAuthenticationProviderAdapter extends AuthenticationProviderAdapter<AuthenticationManager>
- {
-
- public SimpleAuthenticationProviderAdapter(
- UUID id, Broker broker, AuthenticationManager authManager, Map<String, Object> attributes, Collection<String> attributeNames, PreferencesProviderCreator preferencesProviderCreator)
- {
- super(id, broker,authManager, attributes, attributeNames, preferencesProviderCreator);
- }
- }
-
- public static class PrincipalDatabaseAuthenticationManagerAdapter
- extends AuthenticationProviderAdapter<PrincipalDatabaseAuthenticationManager>
- implements PasswordCredentialManagingAuthenticationProvider
- {
- public PrincipalDatabaseAuthenticationManagerAdapter(
- UUID id, Broker broker, PrincipalDatabaseAuthenticationManager authManager, Map<String, Object> attributes, Collection<String> attributeNames, PreferencesProviderCreator preferencesProviderCreator)
- {
- super(id, broker, authManager, attributes, attributeNames, preferencesProviderCreator);
- }
-
- @Override
- public boolean createUser(String username, String password, Map<String, String> attributes)
- {
- if(getSecurityManager().authoriseUserOperation(Operation.CREATE, username))
- {
- return getPrincipalDatabase().createPrincipal(new UsernamePrincipal(username), password.toCharArray());
- }
- else
- {
- throw new AccessControlException("Do not have permission to create new user");
- }
- }
-
- @Override
- public void deleteUser(String username) throws AccountNotFoundException
- {
- if(getSecurityManager().authoriseUserOperation(Operation.DELETE, username))
- {
- getPrincipalDatabase().deletePrincipal(new UsernamePrincipal(username));
- }
- else
- {
- throw new AccessControlException("Cannot delete user " + username);
- }
- }
-
- private SecurityManager getSecurityManager()
- {
- return _broker.getSecurityManager();
- }
-
- private PrincipalDatabase getPrincipalDatabase()
- {
- return getAuthManager().getPrincipalDatabase();
- }
-
- @Override
- public void setPassword(String username, String password) throws AccountNotFoundException
- {
- if(getSecurityManager().authoriseUserOperation(Operation.UPDATE, username))
- {
- getPrincipalDatabase().updatePassword(new UsernamePrincipal(username), password.toCharArray());
- }
- else
- {
- throw new AccessControlException("Do not have permission to set password");
- }
- }
-
- @Override
- public Map<String, Map<String, String>> getUsers()
- {
-
- Map<String, Map<String,String>> users = new HashMap<String, Map<String, String>>();
- for(Principal principal : getPrincipalDatabase().getUsers())
- {
- users.put(principal.getName(), Collections.<String, String>emptyMap());
- }
- return users;
- }
-
- public void reload() throws IOException
- {
- getPrincipalDatabase().reload();
- }
-
- @Override
- public <C extends ConfiguredObject> C addChild(Class<C> childClass,
- Map<String, Object> attributes,
- ConfiguredObject... otherParents)
- {
- if(childClass == User.class)
- {
- String username = (String) attributes.get("name");
- String password = (String) attributes.get("password");
- Principal p = new UsernamePrincipal(username);
-
- if(createUser(username, password,null))
- {
- @SuppressWarnings("unchecked")
- C pricipalAdapter = (C) new PrincipalAdapter(p);
- return pricipalAdapter;
- }
- else
- {
- //TODO? Silly interface on the PrincipalDatabase at fault
- throw new RuntimeException("Failed to create user");
- }
- }
-
- return super.addChild(childClass, attributes, otherParents);
- }
-
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- if(clazz == User.class)
- {
- List<Principal> users = getPrincipalDatabase().getUsers();
- Collection<User> principals = new ArrayList<User>(users.size());
- for(Principal user : users)
- {
- principals.add(new PrincipalAdapter(user));
- }
- @SuppressWarnings("unchecked")
- Collection<C> unmodifiablePrincipals = (Collection<C>) Collections.unmodifiableCollection(principals);
- return unmodifiablePrincipals;
- }
- else
- {
- return super.getChildren(clazz);
- }
- }
-
- @Override
- protected void childAdded(ConfiguredObject child)
- {
- if (child instanceof User)
- {
- // no-op, prevent storing users in the broker store
- return;
- }
- super.childAdded(child);
- }
-
- @Override
- protected void childRemoved(ConfiguredObject child)
- {
- if (child instanceof User)
- {
- // no-op, as per above, users are not in the store
- return;
- }
- super.childRemoved(child);
- }
-
- private class PrincipalAdapter extends AbstractAdapter implements User
- {
- private final Principal _user;
-
- public PrincipalAdapter(Principal user)
- {
- super(UUIDGenerator.generateUserUUID(PrincipalDatabaseAuthenticationManagerAdapter.this.getName(), user.getName()),
- PrincipalDatabaseAuthenticationManagerAdapter.this.getTaskExecutor());
- _user = user;
-
- }
-
- @Override
- public void setPassword(String password)
- {
- try
- {
- PrincipalDatabaseAuthenticationManagerAdapter.this.setPassword(_user.getName(), password);
- }
- catch (AccountNotFoundException e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public String getName()
- {
- return _user.getName();
- }
-
- @Override
- public String setName(String currentName, String desiredName)
- throws IllegalStateException, AccessControlException
- {
- throw new IllegalStateException("Names cannot be updated");
- }
-
- @Override
- public State getActualState()
- {
- return State.ACTIVE;
- }
-
- @Override
- public boolean isDurable()
- {
- return true;
- }
-
- @Override
- public void setDurable(boolean durable)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException("Durability cannot be updated");
- }
-
- @Override
- public LifetimePolicy getLifetimePolicy()
- {
- return LifetimePolicy.PERMANENT;
- }
-
- @Override
- public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException("LifetimePolicy cannot be updated");
- }
-
- @Override
- public long getTimeToLive()
- {
- return 0;
- }
-
- @Override
- public long setTimeToLive(long expected, long desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException("ttl cannot be updated");
- }
-
- @Override
- public Statistics getStatistics()
- {
- return NoStatistics.getInstance();
- }
-
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- return null;
- }
-
- @Override
- public <C extends ConfiguredObject> C createChild(Class<C> childClass,
- Map<String, Object> attributes,
- ConfiguredObject... otherParents)
- {
- return null;
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return User.AVAILABLE_ATTRIBUTES;
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if(ID.equals(name))
- {
- return getId();
- }
- else if(PASSWORD.equals(name))
- {
- return null; // for security reasons we don't expose the password
- }
- else if(NAME.equals(name))
- {
- return getName();
- }
- return super.getAttribute(name);
- }
-
- @Override
- public boolean changeAttribute(String name, Object expected, Object desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- if(name.equals(PASSWORD))
- {
- setPassword((String)desired);
- return true;
- }
- return super.changeAttribute(name, expected, desired);
- }
-
- @Override
- protected boolean setState(State currentState, State desiredState)
- throws IllegalStateTransitionException, AccessControlException
- {
- if(desiredState == State.DELETED)
- {
- try
- {
- String userName = _user.getName();
- deleteUser(userName);
- PreferencesProvider preferencesProvider = getPreferencesProvider();
- if (preferencesProvider != null)
- {
- preferencesProvider.deletePreferences(userName);
- }
- }
- catch (AccountNotFoundException e)
- {
- LOGGER.warn("Failed to delete user " + _user, e);
- }
- return true;
- }
- return false;
- }
-
- @Override
- public Map<String, Object> getPreferences()
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider();
- if (preferencesProvider == null)
- {
- return null;
- }
- return preferencesProvider.getPreferences(this.getName());
- }
-
- @Override
- public Object getPreference(String name)
- {
- Map<String, Object> preferences = getPreferences();
- if (preferences == null)
- {
- return null;
- }
- return preferences.get(name);
- }
-
- @Override
- public Map<String, Object> setPreferences(Map<String, Object> preferences)
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider();
- if (preferencesProvider == null)
- {
- return null;
- }
- return preferencesProvider.setPreferences(this.getName(), preferences);
- }
-
- @Override
- public Map<String, Object> replacePreferences(Map<String, Object> newPreferences)
- {
- PreferencesProvider preferencesProvider = getPreferencesProvider();
- if (preferencesProvider == null)
- {
- return null;
- }
- Map<String, Object> preferences = preferencesProvider.deletePreferences(this.getName());
- preferencesProvider.setPreferences(this.getName(), newPreferences);
- return preferences;
- }
-
- private PreferencesProvider getPreferencesProvider()
- {
- return PrincipalDatabaseAuthenticationManagerAdapter.this.getPreferencesProvider();
- }
-
- }
-
- }
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
deleted file mode 100644
index 71bc3c631d..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.PrincipalDatabaseAuthenticationManagerAdapter;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.SimpleAuthenticationProviderAdapter;
-
-public class AuthenticationProviderFactory
-{
- private final Iterable<AuthenticationManagerFactory> _factories;
- private Collection<String> _supportedAuthenticationProviders;
- private final PreferencesProviderCreator _preferencesProviderCreator;
-
- public AuthenticationProviderFactory(QpidServiceLoader<AuthenticationManagerFactory> authManagerFactoryServiceLoader, PreferencesProviderCreator preferencesProviderCreator)
- {
- _preferencesProviderCreator = preferencesProviderCreator;
- _factories = authManagerFactoryServiceLoader.atLeastOneInstanceOf(AuthenticationManagerFactory.class);
- List<String> supportedAuthenticationProviders = new ArrayList<String>();
- for (AuthenticationManagerFactory factory : _factories)
- {
- supportedAuthenticationProviders.add(factory.getType());
- }
- _supportedAuthenticationProviders = Collections.unmodifiableCollection(supportedAuthenticationProviders);
- }
-
- /**
- * Creates {@link AuthenticationProvider} for given ID, {@link Broker} and attributes.
- * <p>
- * The configured {@link AuthenticationManagerFactory}'s are used to try to create the {@link AuthenticationProvider}.
- * The first non-null instance is returned. The factories are used in non-deterministic order.
- */
- public AuthenticationProvider create(UUID id, Broker broker, Map<String, Object> attributes)
- {
- AuthenticationProviderAdapter<?> provider = createAuthenticationProvider(id, broker, attributes);
- provider.getAuthManager().onCreate();
- return provider;
- }
-
- /**
- * Recovers {@link AuthenticationProvider} for given ID, attributes and {@link Broker}.
- * <p>
- * The configured {@link AuthenticationManagerFactory}'s are used to try to create the {@link AuthenticationProvider}.
- * The first non-null instance is returned. The factories are used in non-deterministic order.
- */
- public AuthenticationProvider recover(UUID id, Map<String, Object> attributes, Broker broker)
- {
- return createAuthenticationProvider(id, broker, attributes);
- }
-
- private AuthenticationProviderAdapter<?> createAuthenticationProvider(UUID id, Broker broker, Map<String, Object> attributes)
- {
- for (AuthenticationManagerFactory factory : _factories)
- {
- AuthenticationManager manager = factory.createInstance(attributes);
- if (manager != null)
- {
- AuthenticationProviderAdapter<?> authenticationProvider;
- if (manager instanceof PrincipalDatabaseAuthenticationManager)
- {
- authenticationProvider = new PrincipalDatabaseAuthenticationManagerAdapter(id, broker,
- (PrincipalDatabaseAuthenticationManager) manager, attributes, factory.getAttributeNames(), _preferencesProviderCreator);
- }
- else
- {
- authenticationProvider = new SimpleAuthenticationProviderAdapter(id, broker, manager, attributes, factory.getAttributeNames(), _preferencesProviderCreator);
- }
- return authenticationProvider;
- }
- }
-
- throw new IllegalArgumentException("No authentication provider factory found for configuration attributes " + attributes);
- }
-
- public Collection<String> getSupportedAuthenticationProviders()
- {
- return _supportedAuthenticationProviders;
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
deleted file mode 100644
index aec78ba414..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
+++ /dev/null
@@ -1,1267 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import java.lang.reflect.Type;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.security.AccessControlException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.common.QpidProperties;
-import org.apache.qpid.server.BrokerOptions;
-import org.apache.qpid.server.configuration.BrokerConfigurationStoreCreator;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.logging.LogRecorder;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.actors.BrokerActor;
-import org.apache.qpid.server.logging.actors.CurrentActor;
-import org.apache.qpid.server.logging.messages.BrokerMessages;
-import org.apache.qpid.server.model.AccessControlProvider;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfigurationChangeListener;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.GroupProvider;
-import org.apache.qpid.server.model.KeyStore;
-import org.apache.qpid.server.model.LifetimePolicy;
-import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.Plugin;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.Statistics;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderAdapter.SimpleAuthenticationProviderAdapter;
-import org.apache.qpid.server.plugin.VirtualHostFactory;
-import org.apache.qpid.server.security.SecurityManager;
-import org.apache.qpid.server.security.SubjectCreator;
-import org.apache.qpid.server.security.access.Operation;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.SimpleAuthenticationManager;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.store.MessageStoreCreator;
-import org.apache.qpid.server.util.MapValueConverter;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class BrokerAdapter extends AbstractAdapter implements Broker, ConfigurationChangeListener
-{
- private static final Logger LOGGER = Logger.getLogger(BrokerAdapter.class);
-
- @SuppressWarnings("serial")
- public static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>(){{
- put(QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, Long.class);
- put(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, Long.class);
- put(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, Long.class);
- put(QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, Long.class);
- put(QUEUE_ALERT_REPEAT_GAP, Long.class);
- put(QUEUE_FLOW_CONTROL_SIZE_BYTES, Long.class);
- put(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, Long.class);
- put(VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, Long.class);
-
- put(QUEUE_DEAD_LETTER_QUEUE_ENABLED, Boolean.class);
- put(STATISTICS_REPORTING_RESET_ENABLED, Boolean.class);
-
- put(QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, Integer.class);
- put(CONNECTION_SESSION_COUNT_LIMIT, Integer.class);
- put(CONNECTION_HEART_BEAT_DELAY, Integer.class);
- put(CONNECTION_CLOSE_WHEN_NO_ROUTE, Boolean.class);
- put(STATISTICS_REPORTING_PERIOD, Integer.class);
-
- put(NAME, String.class);
- put(DEFAULT_VIRTUAL_HOST, String.class);
-
- put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, Long.class);
- put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, Long.class);
- put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, Long.class);
- put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, Long.class);
- put(MODEL_VERSION, String.class);
- put(STORE_VERSION, String.class);
- }});
-
- public static final int DEFAULT_STATISTICS_REPORTING_PERIOD = 0;
- public static final boolean DEFAULT_STATISTICS_REPORTING_RESET_ENABLED = false;
- public static final long DEFAULT_ALERT_REPEAT_GAP = 30000l;
- public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE = 0l;
- public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT = 0l;
- public static final long DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE = 0l;
- public static final long DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH = 0l;
- public static final boolean DEFAULT_DEAD_LETTER_QUEUE_ENABLED = false;
- public static final int DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS = 0;
- public static final long DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES = 0l;
- public static final long DEFAULT_FLOW_CONTROL_SIZE_BYTES = 0l;
- public static final long DEFAULT_HOUSEKEEPING_CHECK_PERIOD = 30000l;
- public static final int DEFAULT_HEART_BEAT_DELAY = 0;
- public static final int DEFAULT_SESSION_COUNT_LIMIT = 256;
- public static final String DEFAULT_NAME = "QpidBroker";
- public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE = 0l;
- public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN = 0l;
- public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE = 0l;
- public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN = 0l;
- public static final boolean DEFAULT_CONNECTION_CLOSE_WHEN_NO_ROUTE = true;
-
- @SuppressWarnings("serial")
- private static final Map<String, Object> DEFAULTS = Collections.unmodifiableMap(new HashMap<String, Object>(){{
- put(Broker.STATISTICS_REPORTING_PERIOD, DEFAULT_STATISTICS_REPORTING_PERIOD);
- put(Broker.STATISTICS_REPORTING_RESET_ENABLED, DEFAULT_STATISTICS_REPORTING_RESET_ENABLED);
- put(Broker.QUEUE_ALERT_REPEAT_GAP, DEFAULT_ALERT_REPEAT_GAP);
- put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE);
- put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT);
- put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE);
- put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH);
- put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, DEFAULT_DEAD_LETTER_QUEUE_ENABLED);
- put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS);
- put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES);
- put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, DEFAULT_FLOW_CONTROL_SIZE_BYTES);
- put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, DEFAULT_HOUSEKEEPING_CHECK_PERIOD);
- put(Broker.CONNECTION_HEART_BEAT_DELAY, DEFAULT_HEART_BEAT_DELAY);
- put(Broker.CONNECTION_SESSION_COUNT_LIMIT, DEFAULT_SESSION_COUNT_LIMIT);
- put(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE, DEFAULT_CONNECTION_CLOSE_WHEN_NO_ROUTE);
- put(Broker.NAME, DEFAULT_NAME);
- put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE);
- put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN);
- put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE);
- put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN);
- }});
-
- private String[] POSITIVE_NUMERIC_ATTRIBUTES = { QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES,
- QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, QUEUE_ALERT_REPEAT_GAP, QUEUE_FLOW_CONTROL_SIZE_BYTES,
- QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, CONNECTION_SESSION_COUNT_LIMIT,
- CONNECTION_HEART_BEAT_DELAY, STATISTICS_REPORTING_PERIOD, VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE,
- VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE,
- VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN};
-
-
- private final StatisticsGatherer _statisticsGatherer;
- private final VirtualHostRegistry _virtualHostRegistry;
- private final LogRecorder _logRecorder;
- private final RootMessageLogger _rootMessageLogger;
- private StatisticsAdapter _statistics;
-
- private final Map<String, VirtualHost> _vhostAdapters = new HashMap<String, VirtualHost>();
- private final Map<UUID, Port> _portAdapters = new HashMap<UUID, Port>();
- private final Map<Port, Integer> _stillInUsePortNumbers = new HashMap<Port, Integer>();
- private final Map<UUID, AuthenticationProvider> _authenticationProviders = new HashMap<UUID, AuthenticationProvider>();
- private final Map<String, GroupProvider> _groupProviders = new HashMap<String, GroupProvider>();
- private final Map<UUID, ConfiguredObject> _plugins = new HashMap<UUID, ConfiguredObject>();
- private final Map<String, KeyStore> _keyStores = new HashMap<String, KeyStore>();
- private final Map<String, TrustStore> _trustStores = new HashMap<String, TrustStore>();
- private final Map<UUID, AccessControlProvider> _accessControlProviders = new HashMap<UUID, AccessControlProvider>();
-
- private final GroupProviderFactory _groupProviderFactory;
- private final AuthenticationProviderFactory _authenticationProviderFactory;
- private final AccessControlProviderFactory _accessControlProviderFactory;
- private final PreferencesProviderCreator _preferencesProviderCreator;
- private final PortFactory _portFactory;
- private final SecurityManager _securityManager;
-
- private final Collection<String> _supportedVirtualHostStoreTypes;
- private Collection<String> _supportedBrokerStoreTypes;
- private final ConfigurationEntryStore _brokerStore;
-
- private AuthenticationProvider _managementAuthenticationProvider;
- private BrokerOptions _brokerOptions;
-
- public BrokerAdapter(UUID id, Map<String, Object> attributes, StatisticsGatherer statisticsGatherer, VirtualHostRegistry virtualHostRegistry,
- LogRecorder logRecorder, RootMessageLogger rootMessageLogger, AuthenticationProviderFactory authenticationProviderFactory,
- GroupProviderFactory groupProviderFactory, AccessControlProviderFactory accessControlProviderFactory, PortFactory portFactory,
- PreferencesProviderCreator preferencesProviderCreatory, TaskExecutor taskExecutor, ConfigurationEntryStore brokerStore, BrokerOptions brokerOptions)
- {
- super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), taskExecutor);
- _statisticsGatherer = statisticsGatherer;
- _virtualHostRegistry = virtualHostRegistry;
- _logRecorder = logRecorder;
- _rootMessageLogger = rootMessageLogger;
- _statistics = new StatisticsAdapter(statisticsGatherer);
- _authenticationProviderFactory = authenticationProviderFactory;
- _preferencesProviderCreator = preferencesProviderCreatory;
- _groupProviderFactory = groupProviderFactory;
- _accessControlProviderFactory = accessControlProviderFactory;
- _portFactory = portFactory;
- _brokerOptions = brokerOptions;
- _securityManager = new SecurityManager(this, _brokerOptions.isManagementMode());
- _supportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
- _supportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
- _brokerStore = brokerStore;
- if (_brokerOptions.isManagementMode())
- {
- AuthenticationManager authManager = new SimpleAuthenticationManager(BrokerOptions.MANAGEMENT_MODE_USER_NAME, _brokerOptions.getManagementModePassword());
- AuthenticationProvider authenticationProvider = new SimpleAuthenticationProviderAdapter(UUID.randomUUID(), this,
- authManager, Collections.<String, Object> emptyMap(), Collections.<String> emptySet(), _preferencesProviderCreator);
- _managementAuthenticationProvider = authenticationProvider;
- }
- }
-
- public Collection<VirtualHost> getVirtualHosts()
- {
- synchronized(_vhostAdapters)
- {
- return new ArrayList<VirtualHost>(_vhostAdapters.values());
- }
- }
-
- public Collection<Port> getPorts()
- {
- synchronized (_portAdapters)
- {
- final ArrayList<Port> ports = new ArrayList<Port>(_portAdapters.values());
- return ports;
- }
- }
-
- public Collection<AuthenticationProvider> getAuthenticationProviders()
- {
- synchronized (_authenticationProviders)
- {
- return new ArrayList<AuthenticationProvider>(_authenticationProviders.values());
- }
- }
-
- public AuthenticationProvider findAuthenticationProviderByName(String authenticationProviderName)
- {
- if (isManagementMode())
- {
- return _managementAuthenticationProvider;
- }
- Collection<AuthenticationProvider> providers = getAuthenticationProviders();
- for (AuthenticationProvider authenticationProvider : providers)
- {
- if (authenticationProvider.getName().equals(authenticationProviderName))
- {
- return authenticationProvider;
- }
- }
- return null;
- }
-
- public KeyStore findKeyStoreByName(String keyStoreName)
- {
- synchronized(_keyStores)
- {
- return _keyStores.get(keyStoreName);
- }
- }
-
- public TrustStore findTrustStoreByName(String trustStoreName)
- {
- synchronized(_trustStores)
- {
- return _trustStores.get(trustStoreName);
- }
- }
-
- @Override
- public Collection<GroupProvider> getGroupProviders()
- {
- synchronized (_groupProviders)
- {
- final ArrayList<GroupProvider> groupManagers =
- new ArrayList<GroupProvider>(_groupProviders.values());
- return groupManagers;
- }
- }
-
- private VirtualHost createVirtualHost(final Map<String, Object> attributes)
- throws AccessControlException, IllegalArgumentException
- {
- final VirtualHostAdapter virtualHostAdapter = new VirtualHostAdapter(UUID.randomUUID(), attributes, this,
- _statisticsGatherer, getTaskExecutor());
- addVirtualHost(virtualHostAdapter);
-
- // permission has already been granted to create the virtual host
- // disable further access check on other operations, e.g. create exchange
- SecurityManager.setAccessChecksDisabled(true);
- try
- {
- virtualHostAdapter.setDesiredState(State.INITIALISING, State.ACTIVE);
- }
- finally
- {
- SecurityManager.setAccessChecksDisabled(false);
- }
- return virtualHostAdapter;
- }
-
- private boolean deleteVirtualHost(final VirtualHost vhost) throws AccessControlException, IllegalStateException
- {
- synchronized (_vhostAdapters)
- {
- _vhostAdapters.remove(vhost.getName());
- }
- vhost.removeChangeListener(this);
- return true;
- }
-
- public String getName()
- {
- return (String)getAttribute(NAME);
- }
-
- public String setName(final String currentName, final String desiredName)
- throws IllegalStateException, AccessControlException
- {
- return null; //TODO
- }
-
-
- public State getActualState()
- {
- return null; //TODO
- }
-
-
- public boolean isDurable()
- {
- return true;
- }
-
- public void setDurable(final boolean durable)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public LifetimePolicy getLifetimePolicy()
- {
- return LifetimePolicy.PERMANENT;
- }
-
- public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public long getTimeToLive()
- {
- return 0;
- }
-
- public long setTimeToLive(final long expected, final long desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public Statistics getStatistics()
- {
- return _statistics;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- if(clazz == VirtualHost.class)
- {
- return (Collection<C>) getVirtualHosts();
- }
- else if(clazz == Port.class)
- {
- return (Collection<C>) getPorts();
- }
- else if(clazz == AccessControlProvider.class)
- {
- return (Collection<C>) getAccessControlProviders();
- }
- else if(clazz == AuthenticationProvider.class)
- {
- return (Collection<C>) getAuthenticationProviders();
- }
- else if(clazz == GroupProvider.class)
- {
- return (Collection<C>) getGroupProviders();
- }
- else if(clazz == KeyStore.class)
- {
- return (Collection<C>) getKeyStores();
- }
- else if(clazz == TrustStore.class)
- {
- return (Collection<C>) getTrustStores();
- }
- else if(clazz == Plugin.class)
- {
- return (Collection<C>) getPlugins();
- }
-
- return Collections.emptySet();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
- {
- if(childClass == VirtualHost.class)
- {
- return (C) createVirtualHost(attributes);
- }
- else if(childClass == Port.class)
- {
- return (C) createPort(attributes);
- }
- else if(childClass == AccessControlProvider.class)
- {
- return (C) createAccessControlProvider(attributes);
- }
- else if(childClass == AuthenticationProvider.class)
- {
- return (C) createAuthenticationProvider(attributes);
- }
- else if(childClass == KeyStore.class)
- {
- return (C) createKeyStore(attributes);
- }
- else if(childClass == TrustStore.class)
- {
- return (C) createTrustStore(attributes);
- }
- else if(childClass == GroupProvider.class)
- {
- return (C) createGroupProvider(attributes);
- }
- else
- {
- throw new IllegalArgumentException("Cannot create child of class " + childClass.getSimpleName());
- }
- }
-
- /**
- * Called when adding a new port via the management interface
- */
- private Port createPort(Map<String, Object> attributes)
- {
- Port port = _portFactory.createPort(UUID.randomUUID(), this, attributes);
- addPort(port);
-
- //1. AMQP ports are disabled during ManagementMode.
- //2. The management plugins can currently only start ports at broker startup and
- // not when they are newly created via the management interfaces.
- //3. When active ports are deleted, or their port numbers updated, the broker must be
- // restarted for it to take effect so we can't reuse port numbers until it is.
- boolean quiesce = isManagementMode() || !(port instanceof AmqpPortAdapter) || isPreviouslyUsedPortNumber(port);
-
- port.setDesiredState(State.INITIALISING, quiesce ? State.QUIESCED : State.ACTIVE);
-
- return port;
- }
-
- private void addPort(Port port)
- {
- synchronized (_portAdapters)
- {
- int portNumber = port.getPort();
- String portName = port.getName();
- UUID portId = port.getId();
-
- for(Port p : _portAdapters.values())
- {
- if(portNumber == p.getPort())
- {
- throw new IllegalConfigurationException("Can't add port " + portName + " because port number " + portNumber + " is already configured for port " + p.getName());
- }
-
- if(portName == p.getName())
- {
- throw new IllegalConfigurationException("Can't add Port because one with name " + portName + " already exists");
- }
-
- if(portId == p.getId())
- {
- throw new IllegalConfigurationException("Can't add Port because one with id " + portId + " already exists");
- }
- }
-
- _portAdapters.put(port.getId(), port);
- }
- port.addChangeListener(this);
- }
-
- private AccessControlProvider createAccessControlProvider(Map<String, Object> attributes)
- {
- AccessControlProvider accessControlProvider = null;
- synchronized (_accessControlProviders)
- {
- accessControlProvider = _accessControlProviderFactory.create(UUID.randomUUID(), this, attributes);
- addAccessControlProvider(accessControlProvider);
- }
-
- boolean quiesce = isManagementMode() ;
- accessControlProvider.setDesiredState(State.INITIALISING, quiesce ? State.QUIESCED : State.ACTIVE);
-
- return accessControlProvider;
- }
-
- /**
- * @throws IllegalConfigurationException if an AuthenticationProvider with the same name already exists
- */
- private void addAccessControlProvider(AccessControlProvider accessControlProvider)
- {
- String name = accessControlProvider.getName();
- synchronized (_authenticationProviders)
- {
- if (_accessControlProviders.containsKey(accessControlProvider.getId()))
- {
- throw new IllegalConfigurationException("Can't add AccessControlProvider because one with id " + accessControlProvider.getId() + " already exists");
- }
- for (AccessControlProvider provider : _accessControlProviders.values())
- {
- if (provider.getName().equals(name))
- {
- throw new IllegalConfigurationException("Can't add AccessControlProvider because one with name " + name + " already exists");
- }
- }
- _accessControlProviders.put(accessControlProvider.getId(), accessControlProvider);
- }
-
- accessControlProvider.addChangeListener(this);
- accessControlProvider.addChangeListener(_securityManager);
- }
-
- private boolean deleteAccessControlProvider(AccessControlProvider accessControlProvider)
- {
- AccessControlProvider removedAccessControlProvider = null;
- synchronized (_accessControlProviders)
- {
- removedAccessControlProvider = _accessControlProviders.remove(accessControlProvider.getId());
- }
-
- if(removedAccessControlProvider != null)
- {
- removedAccessControlProvider.removeChangeListener(this);
- removedAccessControlProvider.removeChangeListener(_securityManager);
- }
-
- return removedAccessControlProvider != null;
- }
-
- private AuthenticationProvider createAuthenticationProvider(Map<String, Object> attributes)
- {
- AuthenticationProvider authenticationProvider = _authenticationProviderFactory.create(UUID.randomUUID(), this, attributes);
- authenticationProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
- addAuthenticationProvider(authenticationProvider);
- return authenticationProvider;
- }
-
- /**
- * @throws IllegalConfigurationException if an AuthenticationProvider with the same name already exists
- */
- private void addAuthenticationProvider(AuthenticationProvider authenticationProvider)
- {
- String name = authenticationProvider.getName();
- synchronized (_authenticationProviders)
- {
- if (_authenticationProviders.containsKey(authenticationProvider.getId()))
- {
- throw new IllegalConfigurationException("Cannot add AuthenticationProvider because one with id " + authenticationProvider.getId() + " already exists");
- }
- for (AuthenticationProvider provider : _authenticationProviders.values())
- {
- if (provider.getName().equals(name))
- {
- throw new IllegalConfigurationException("Cannot add AuthenticationProvider because one with name " + name + " already exists");
- }
- }
- _authenticationProviders.put(authenticationProvider.getId(), authenticationProvider);
- }
- authenticationProvider.addChangeListener(this);
- }
-
- private GroupProvider createGroupProvider(Map<String, Object> attributes)
- {
- GroupProvider groupProvider = _groupProviderFactory.create(UUID.randomUUID(), this, attributes);
- groupProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
- addGroupProvider(groupProvider);
- return groupProvider;
- }
-
- private void addGroupProvider(GroupProvider groupProvider)
- {
- synchronized (_groupProviders)
- {
- String name = groupProvider.getName();
- if(_groupProviders.containsKey(name))
- {
- throw new IllegalConfigurationException("Cannot add GroupProvider because one with name " + name + " already exists");
- }
- _groupProviders.put(name, groupProvider);
- }
- groupProvider.addChangeListener(this);
- }
-
- private boolean deleteGroupProvider(GroupProvider groupProvider)
- {
- GroupProvider removedGroupProvider = null;
- synchronized (_groupProviders)
- {
- removedGroupProvider = _groupProviders.remove(groupProvider.getName());
- }
-
- if(removedGroupProvider != null)
- {
- removedGroupProvider.removeChangeListener(this);
- }
-
- return removedGroupProvider != null;
- }
-
- private KeyStore createKeyStore(Map<String, Object> attributes)
- {
- KeyStore keyStore = new KeyStoreAdapter(UUIDGenerator.generateRandomUUID(), this, attributes);
- addKeyStore(keyStore);
-
- return keyStore;
- }
-
- private TrustStore createTrustStore(Map<String, Object> attributes)
- {
- TrustStore trustStore = new TrustStoreAdapter(UUIDGenerator.generateRandomUUID(), this, attributes);
- addTrustStore(trustStore);
-
- return trustStore;
- }
-
- private void addKeyStore(KeyStore keyStore)
- {
- synchronized (_keyStores)
- {
- if(_keyStores.containsKey(keyStore.getName()))
- {
- throw new IllegalConfigurationException("Can't add KeyStore because one with name " + keyStore.getName() + " already exists");
- }
- _keyStores.put(keyStore.getName(), keyStore);
- }
- keyStore.addChangeListener(this);
- }
-
- private boolean deleteKeyStore(KeyStore object)
- {
- synchronized(_keyStores)
- {
- String name = object.getName();
- KeyStore removedKeyStore = _keyStores.remove(name);
- if(removedKeyStore != null)
- {
- removedKeyStore.removeChangeListener(this);
- }
-
- return removedKeyStore != null;
- }
- }
-
- private void addTrustStore(TrustStore trustStore)
- {
- synchronized (_trustStores)
- {
- if(_trustStores.containsKey(trustStore.getName()))
- {
- throw new IllegalConfigurationException("Can't add TrustStore because one with name " + trustStore.getName() + " already exists");
- }
- _trustStores.put(trustStore.getName(), trustStore);
- }
- trustStore.addChangeListener(this);
- }
-
- private boolean deleteTrustStore(TrustStore object)
- {
- synchronized(_trustStores)
- {
- String name = object.getName();
- TrustStore removedTrustStore = _trustStores.remove(name);
- if(removedTrustStore != null)
- {
- removedTrustStore.removeChangeListener(this);
- }
-
- return removedTrustStore != null;
- }
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return AVAILABLE_ATTRIBUTES;
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if(ID.equals(name))
- {
- return getId();
- }
- else if(STATE.equals(name))
- {
- return State.ACTIVE;
- }
- else if(DURABLE.equals(name))
- {
- return isDurable();
- }
- else if(LIFETIME_POLICY.equals(name))
- {
- return LifetimePolicy.PERMANENT;
- }
- else if(TIME_TO_LIVE.equals(name))
- {
- // TODO
- }
- else if(CREATED.equals(name))
- {
- // TODO
- }
- else if(UPDATED.equals(name))
- {
- // TODO
- }
- else if(BUILD_VERSION.equals(name))
- {
- return QpidProperties.getBuildVersion();
- }
- else if(BYTES_RETAINED.equals(name))
- {
- // TODO
- }
- else if(OPERATING_SYSTEM.equals(name))
- {
- return System.getProperty("os.name") + " "
- + System.getProperty("os.version") + " "
- + System.getProperty("os.arch");
- }
- else if(PLATFORM.equals(name))
- {
- return System.getProperty("java.vendor") + " "
- + System.getProperty("java.runtime.version", System.getProperty("java.version"));
- }
- else if(PROCESS_PID.equals(name))
- {
- // TODO
- }
- else if(PRODUCT_VERSION.equals(name))
- {
- return QpidProperties.getReleaseVersion();
- }
- else if(SUPPORTED_BROKER_STORE_TYPES.equals(name))
- {
- return _supportedBrokerStoreTypes;
- }
- else if(SUPPORTED_VIRTUALHOST_STORE_TYPES.equals(name))
- {
- return _supportedVirtualHostStoreTypes;
- }
- else if(SUPPORTED_VIRTUALHOST_TYPES.equals(name))
- {
- return VirtualHostFactory.TYPES.get();
- }
- else if(SUPPORTED_AUTHENTICATION_PROVIDERS.equals(name))
- {
- return _authenticationProviderFactory.getSupportedAuthenticationProviders();
- }
- else if (SUPPORTED_PREFERENCES_PROVIDERS_TYPES.equals(name))
- {
- return _preferencesProviderCreator.getSupportedPreferencesProviders();
- }
- else if (MODEL_VERSION.equals(name))
- {
- return Model.MODEL_VERSION;
- }
- else if (STORE_VERSION.equals(name))
- {
- return _brokerStore.getVersion();
- }
- else if (STORE_TYPE.equals(name))
- {
- return _brokerStore.getType();
- }
- else if (STORE_PATH.equals(name))
- {
- return _brokerStore.getStoreLocation();
- }
- return super.getAttribute(name);
- }
-
- private boolean deletePort(State oldState, Port portAdapter)
- {
- Port removedPort = null;
- synchronized (_portAdapters)
- {
- removedPort = _portAdapters.remove(portAdapter.getId());
- }
-
- if (removedPort != null)
- {
- removedPort.removeChangeListener(this);
-
- if(oldState == State.ACTIVE)
- {
- //Record the originally used port numbers of previously-active ports being deleted, to ensure
- //when creating new ports we don't try to re-bind a port number that we are currently still using
- recordPreviouslyUsedPortNumberIfNecessary(removedPort, removedPort.getPort());
- }
- }
-
- return removedPort != null;
- }
-
- private boolean deleteAuthenticationProvider(AuthenticationProvider authenticationProvider)
- {
- AuthenticationProvider removedAuthenticationProvider = null;
- synchronized (_authenticationProviders)
- {
- removedAuthenticationProvider = _authenticationProviders.remove(authenticationProvider.getId());
- }
-
- if(removedAuthenticationProvider != null)
- {
- removedAuthenticationProvider.removeChangeListener(this);
- }
-
- return removedAuthenticationProvider != null;
- }
-
- private void addVirtualHost(VirtualHost virtualHost)
- {
- synchronized (_vhostAdapters)
- {
- String name = virtualHost.getName();
- if (_vhostAdapters.containsKey(name))
- {
- throw new IllegalConfigurationException("Virtual host with name " + name + " is already specified!");
- }
- _vhostAdapters.put(name, virtualHost);
- }
- virtualHost.addChangeListener(this);
- }
-
- @Override
- public boolean setState(State currentState, State desiredState)
- {
- if (desiredState == State.ACTIVE)
- {
- changeState(_groupProviders, currentState, State.ACTIVE, false);
- changeState(_authenticationProviders, currentState, State.ACTIVE, false);
- changeState(_accessControlProviders, currentState, State.ACTIVE, false);
-
- CurrentActor.set(new BrokerActor(getRootMessageLogger()));
- try
- {
- changeState(_vhostAdapters, currentState, State.ACTIVE, false);
- }
- finally
- {
- CurrentActor.remove();
- }
-
- changeState(_portAdapters, currentState,State.ACTIVE, false);
- changeState(_plugins, currentState,State.ACTIVE, false);
-
- if (isManagementMode())
- {
- CurrentActor.get().message(BrokerMessages.MANAGEMENT_MODE(BrokerOptions.MANAGEMENT_MODE_USER_NAME, _brokerOptions.getManagementModePassword()));
- }
- return true;
- }
- else if (desiredState == State.STOPPED)
- {
- changeState(_plugins, currentState,State.STOPPED, true);
- changeState(_portAdapters, currentState, State.STOPPED, true);
- changeState(_vhostAdapters,currentState, State.STOPPED, true);
- changeState(_authenticationProviders, currentState, State.STOPPED, true);
- changeState(_groupProviders, currentState, State.STOPPED, true);
- return true;
- }
- return false;
- }
-
- private void changeState(Map<?, ? extends ConfiguredObject> configuredObjectMap, State currentState, State desiredState, boolean swallowException)
- {
- synchronized(configuredObjectMap)
- {
- Collection<? extends ConfiguredObject> adapters = configuredObjectMap.values();
- for (ConfiguredObject configuredObject : adapters)
- {
- if (State.ACTIVE.equals(desiredState) && State.QUIESCED.equals(configuredObject.getActualState()))
- {
- if (LOGGER.isDebugEnabled())
- {
- LOGGER.debug(configuredObject + " cannot be activated as it is " +State.QUIESCED);
- }
- continue;
- }
- try
- {
- configuredObject.setDesiredState(currentState, desiredState);
- }
- catch(RuntimeException e)
- {
- if (swallowException)
- {
- LOGGER.error("Failed to stop " + configuredObject, e);
- }
- else
- {
- throw e;
- }
- }
- }
- }
- }
-
- @Override
- public void stateChanged(ConfiguredObject object, State oldState, State newState)
- {
- if(newState == State.DELETED)
- {
- boolean childDeleted = false;
- if(object instanceof AuthenticationProvider)
- {
- childDeleted = deleteAuthenticationProvider((AuthenticationProvider)object);
- }
- else if(object instanceof AccessControlProvider)
- {
- childDeleted = deleteAccessControlProvider((AccessControlProvider)object);
- }
- else if(object instanceof Port)
- {
- childDeleted = deletePort(oldState, (Port)object);
- }
- else if(object instanceof VirtualHost)
- {
- childDeleted = deleteVirtualHost((VirtualHost)object);
- }
- else if(object instanceof GroupProvider)
- {
- childDeleted = deleteGroupProvider((GroupProvider)object);
- }
- else if(object instanceof KeyStore)
- {
- childDeleted = deleteKeyStore((KeyStore)object);
- }
- else if(object instanceof TrustStore)
- {
- childDeleted = deleteTrustStore((TrustStore)object);
- }
-
- if(childDeleted)
- {
- childRemoved(object);
- }
- }
- }
-
- @Override
- public void childAdded(ConfiguredObject object, ConfiguredObject child)
- {
- // no-op
- }
-
- @Override
- public void childRemoved(ConfiguredObject object, ConfiguredObject child)
- {
- // no-op
- }
-
- @Override
- public void attributeSet(ConfiguredObject object, String attributeName, Object oldAttributeValue, Object newAttributeValue)
- {
- if(object instanceof Port)
- {
- //Record all the originally used port numbers of active ports, to ensure that when
- //creating new ports we don't try to re-bind a port number that we are still using
- if(attributeName == Port.PORT && object.getActualState() == State.ACTIVE)
- {
- recordPreviouslyUsedPortNumberIfNecessary((Port) object, (Integer)oldAttributeValue);
- }
- }
- }
-
- private void addPlugin(ConfiguredObject plugin)
- {
- synchronized(_plugins)
- {
- if (_plugins.containsKey(plugin.getId()))
- {
- throw new IllegalConfigurationException("Plugin with id '" + plugin.getId() + "' is already registered!");
- }
- _plugins.put(plugin.getId(), plugin);
- }
- plugin.addChangeListener(this);
- }
-
-
- private Collection<ConfiguredObject> getPlugins()
- {
- synchronized(_plugins)
- {
- return Collections.unmodifiableCollection(_plugins.values());
- }
- }
-
- public void recoverChild(ConfiguredObject object)
- {
- if(object instanceof AuthenticationProvider)
- {
- addAuthenticationProvider((AuthenticationProvider)object);
- }
- else if(object instanceof AccessControlProvider)
- {
- addAccessControlProvider((AccessControlProvider)object);
- }
- else if(object instanceof Port)
- {
- addPort((Port)object);
- }
- else if(object instanceof VirtualHost)
- {
- addVirtualHost((VirtualHost)object);
- }
- else if(object instanceof GroupProvider)
- {
- addGroupProvider((GroupProvider)object);
- }
- else if(object instanceof KeyStore)
- {
- addKeyStore((KeyStore)object);
- }
- else if(object instanceof TrustStore)
- {
- addTrustStore((TrustStore)object);
- }
- else if(object instanceof Plugin)
- {
- addPlugin(object);
- }
- else
- {
- throw new IllegalArgumentException("Attempted to recover unexpected type of configured object: " + object.getClass().getName());
- }
- }
-
- @Override
- public RootMessageLogger getRootMessageLogger()
- {
- return _rootMessageLogger;
- }
-
- @Override
- public SecurityManager getSecurityManager()
- {
- return _securityManager;
- }
-
- @Override
- public LogRecorder getLogRecorder()
- {
- return _logRecorder;
- }
-
- @Override
- public VirtualHost findVirtualHostByName(String name)
- {
- return _vhostAdapters.get(name);
- }
-
- @Override
- public SubjectCreator getSubjectCreator(SocketAddress localAddress)
- {
- AuthenticationProvider provider = getAuthenticationProvider(localAddress);
-
- if(provider == null)
- {
- throw new IllegalConfigurationException("Unable to determine authentication provider for address: " + localAddress);
- }
-
- return provider.getSubjectCreator();
- }
-
- @Override
- public AuthenticationProvider getAuthenticationProvider(SocketAddress localAddress)
- {
- InetSocketAddress inetSocketAddress = (InetSocketAddress)localAddress;
- AuthenticationProvider provider = null;
- Collection<Port> ports = getPorts();
- for (Port p : ports)
- {
- if (inetSocketAddress.getPort() == p.getPort())
- {
- provider = p.getAuthenticationProvider();
- break;
- }
- }
- return provider;
- }
-
- @Override
- public Collection<KeyStore> getKeyStores()
- {
- synchronized(_keyStores)
- {
- return Collections.unmodifiableCollection(_keyStores.values());
- }
- }
-
- @Override
- public Collection<TrustStore> getTrustStores()
- {
- synchronized(_trustStores)
- {
- return Collections.unmodifiableCollection(_trustStores.values());
- }
- }
-
- @Override
- public VirtualHostRegistry getVirtualHostRegistry()
- {
- return _virtualHostRegistry;
- }
-
- @Override
- public TaskExecutor getTaskExecutor()
- {
- return super.getTaskExecutor();
- }
-
- @Override
- protected void changeAttributes(Map<String, Object> attributes)
- {
- Map<String, Object> convertedAttributes = MapValueConverter.convert(attributes, ATTRIBUTE_TYPES);
- validateAttributes(convertedAttributes);
-
- super.changeAttributes(convertedAttributes);
- }
-
- private void validateAttributes(Map<String, Object> convertedAttributes)
- {
- if (convertedAttributes.containsKey(MODEL_VERSION) && !Model.MODEL_VERSION.equals(convertedAttributes.get(MODEL_VERSION)))
- {
- throw new IllegalConfigurationException("Cannot change the model version");
- }
-
- if (convertedAttributes.containsKey(STORE_VERSION)
- && !new Integer(_brokerStore.getVersion()).equals(convertedAttributes.get(STORE_VERSION)))
- {
- throw new IllegalConfigurationException("Cannot change the store version");
- }
-
- String defaultVirtualHost = (String) convertedAttributes.get(DEFAULT_VIRTUAL_HOST);
- if (defaultVirtualHost != null)
- {
- VirtualHost foundHost = findVirtualHostByName(defaultVirtualHost);
- if (foundHost == null)
- {
- throw new IllegalConfigurationException("Virtual host with name " + defaultVirtualHost
- + " cannot be set as a default as it does not exist");
- }
- }
- Long queueFlowControlSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_SIZE_BYTES);
- Long queueFlowControlResumeSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
- if (queueFlowControlSize != null || queueFlowControlResumeSize != null )
- {
- if (queueFlowControlSize == null)
- {
- queueFlowControlSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_SIZE_BYTES);
- }
- if (queueFlowControlResumeSize == null)
- {
- queueFlowControlResumeSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
- }
- if (queueFlowControlResumeSize > queueFlowControlSize)
- {
- throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size");
- }
- }
- for (String attributeName : POSITIVE_NUMERIC_ATTRIBUTES)
- {
- Number value = (Number) convertedAttributes.get(attributeName);
- if (value != null && value.longValue() < 0)
- {
- throw new IllegalConfigurationException("Only positive integer value can be specified for the attribute "
- + attributeName);
- }
- }
- }
-
- @Override
- protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
- {
- if (!_securityManager.authoriseConfiguringBroker(getName(), Broker.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of broker attributes is denied");
- }
- }
-
- @Override
- protected <C extends ConfiguredObject> void authoriseCreateChild(Class<C> childClass, Map<String, Object> attributes,
- ConfiguredObject... otherParents) throws AccessControlException
- {
- if (!_securityManager.authoriseConfiguringBroker(String.valueOf(attributes.get(NAME)), childClass, Operation.CREATE))
- {
- throw new AccessControlException("Creation of new broker level entity is denied");
- }
- }
-
- @Override
- protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
- {
- if (!_securityManager.authoriseConfiguringBroker(getName(), Broker.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of broker attributes is denied");
- }
- }
-
- @Override
- public boolean isManagementMode()
- {
- return _brokerOptions.isManagementMode();
- }
-
- @Override
- public Collection<AccessControlProvider> getAccessControlProviders()
- {
- synchronized (_accessControlProviders)
- {
- return new ArrayList<AccessControlProvider>(_accessControlProviders.values());
- }
- }
-
- private void recordPreviouslyUsedPortNumberIfNecessary(Port port, Integer portNumber)
- {
- //If we haven't previously recorded its original port number, record it now
- if(!_stillInUsePortNumbers.containsKey(port))
- {
- _stillInUsePortNumbers.put(port, portNumber);
- }
- }
-
- private boolean isPreviouslyUsedPortNumber(Port port)
- {
- return _stillInUsePortNumbers.containsValue(port.getPort());
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
deleted file mode 100644
index 8efce39ea2..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import java.security.AccessControlException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInternalException;
-import org.apache.qpid.AMQSecurityException;
-import org.apache.qpid.server.binding.Binding;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.Exchange;
-import org.apache.qpid.server.model.LifetimePolicy;
-import org.apache.qpid.server.model.Publisher;
-import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.Statistics;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.util.MapValueConverter;
-import org.apache.qpid.server.virtualhost.RequiredExchangeException;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-final class ExchangeAdapter extends AbstractAdapter implements Exchange, org.apache.qpid.server.exchange.Exchange.BindingListener
-{
-
- private final org.apache.qpid.server.exchange.Exchange _exchange;
- private final Map<Binding, BindingAdapter> _bindingAdapters =
- new HashMap<Binding, BindingAdapter>();
- private VirtualHostAdapter _vhost;
- private final ExchangeStatistics _statistics;
-
- public ExchangeAdapter(final VirtualHostAdapter virtualHostAdapter,
- final org.apache.qpid.server.exchange.Exchange exchange)
- {
- super(exchange.getId(), virtualHostAdapter.getTaskExecutor());
- _statistics = new ExchangeStatistics();
- _vhost = virtualHostAdapter;
- _exchange = exchange;
- addParent(org.apache.qpid.server.model.VirtualHost.class, virtualHostAdapter);
-
- exchange.addBindingListener(this);
- populateBindings();
- }
-
- private void populateBindings()
- {
- Collection<Binding> actualBindings = _exchange.getBindings();
- synchronized (_bindingAdapters)
- {
- for(Binding binding : actualBindings)
- {
- if(!_bindingAdapters.containsKey(binding))
- {
- QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
- BindingAdapter adapter = new BindingAdapter(binding, this, queueAdapter);
- _bindingAdapters.put(binding, adapter);
-
- queueAdapter.bindingRegistered(binding, adapter);
- }
- }
- }
-
- }
-
- public String getExchangeType()
- {
- return _exchange.getType().getType();
- }
-
- public Collection<org.apache.qpid.server.model.Binding> getBindings()
- {
- synchronized (_bindingAdapters)
- {
- return new ArrayList<org.apache.qpid.server.model.Binding>(_bindingAdapters.values());
- }
-
- }
-
- public Collection<Publisher> getPublishers()
- {
- // TODO
- return Collections.emptyList();
- }
-
-
- public org.apache.qpid.server.model.Binding createBinding(Queue queue,
- Map<String, Object> attributes)
- throws AccessControlException, IllegalStateException
- {
- attributes = new HashMap<String, Object>(attributes);
- String bindingKey = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Binding.NAME, attributes, "");
- Map<String, Object> bindingArgs = MapValueConverter.getMapAttribute(org.apache.qpid.server.model.Binding.ARGUMENTS, attributes, Collections.<String,Object>emptyMap());
-
- attributes.remove(org.apache.qpid.server.model.Binding.NAME);
- attributes.remove(org.apache.qpid.server.model.Binding.ARGUMENTS);
-
- return createBinding(bindingKey, queue, bindingArgs, attributes);
-
- }
-
- public org.apache.qpid.server.model.Binding createBinding(String bindingKey, Queue queue,
- Map<String, Object> bindingArguments,
- Map<String, Object> attributes)
- throws AccessControlException, IllegalStateException
- {
- VirtualHost virtualHost = _vhost.getVirtualHost();
-
-
- AMQQueue amqQueue = ((QueueAdapter)queue).getAMQQueue();
-
- try
- {
- if(!_exchange.addBinding(bindingKey, amqQueue, bindingArguments))
- {
- Binding oldBinding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);
-
- Map<String, Object> oldArgs = oldBinding.getArguments();
- if((oldArgs == null && !bindingArguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(bindingArguments)))
- {
- _exchange.replaceBinding(oldBinding.getId(), bindingKey, amqQueue, bindingArguments);
- }
- }
- Binding binding = _exchange.getBinding(bindingKey, amqQueue, bindingArguments);
-
- synchronized (_bindingAdapters)
- {
- return binding == null ? null : _bindingAdapters.get(binding);
- }
- }
- catch(AMQSecurityException e)
- {
- throw new AccessControlException(e.toString());
- }
- catch(AMQInternalException e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- public void delete()
- {
- try
- {
- _vhost.getVirtualHost().removeExchange(_exchange, true);
- }
- catch(RequiredExchangeException e)
- {
- throw new UnsupportedOperationException("'" + getName() + "' is a reserved exchange and can't be deleted");
- }
- catch(AMQException e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- public String getName()
- {
- return _exchange.getName();
- }
-
- public String setName(final String currentName, final String desiredName)
- throws IllegalStateException, AccessControlException
- {
- return null; //TODO
- }
-
- public State getActualState()
- {
- return null; //TODO
- }
-
- public boolean isDurable()
- {
- return _exchange.isDurable();
- }
-
- public void setDurable(final boolean durable)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- //TODO
- }
-
- public LifetimePolicy getLifetimePolicy()
- {
- return _exchange.isAutoDelete() ? LifetimePolicy.AUTO_DELETE : LifetimePolicy.PERMANENT;
- }
-
- public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- return null; //TODO
- }
-
- public long getTimeToLive()
- {
- return 0; //TODO
- }
-
- public long setTimeToLive(final long expected, final long desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- return 0; //TODO
- }
-
- public Statistics getStatistics()
- {
- return _statistics;
- }
-
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- if(clazz == org.apache.qpid.server.model.Binding.class)
- {
- return (Collection<C>) getBindings();
- }
- else
- {
- return Collections.emptySet();
- }
- }
-
- @Override
- public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
- {
- if(childClass == org.apache.qpid.server.model.Binding.class)
- {
- if(otherParents != null && otherParents.length == 1 && otherParents[0] instanceof Queue)
- {
- Queue queue = (Queue) otherParents[0];
- if(queue.getParent(org.apache.qpid.server.model.VirtualHost.class) == getParent(org.apache.qpid.server.model.VirtualHost.class))
- {
- return (C) createBinding(queue, attributes);
- }
- else
- {
- throw new IllegalArgumentException("Queue and Exchange parents of a binding must be on same virtual host");
- }
- }
- else
- {
- throw new IllegalArgumentException("Other parent must be a queue");
- }
- }
- else
- {
- throw new IllegalArgumentException();
- }
- }
-
- public void bindingAdded(org.apache.qpid.server.exchange.Exchange exchange, Binding binding)
- {
- BindingAdapter adapter = null;
- synchronized (_bindingAdapters)
- {
- if(!_bindingAdapters.containsKey(binding))
- {
- QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
- adapter = new BindingAdapter(binding, this, queueAdapter);
- _bindingAdapters.put(binding,adapter);
- queueAdapter.bindingRegistered(binding,adapter);
- }
- }
- if(adapter != null)
- {
- childAdded(adapter);
- }
- }
-
- public void bindingRemoved(org.apache.qpid.server.exchange.Exchange exchange, Binding binding)
- {
- BindingAdapter adapter = null;
- synchronized (_bindingAdapters)
- {
- adapter = _bindingAdapters.remove(binding);
- }
- if(adapter != null)
- {
- QueueAdapter queueAdapter = _vhost.getQueueAdapter(binding.getQueue());
- if(queueAdapter != null)
- {
- queueAdapter.bindingUnregistered(binding);
- childRemoved(adapter);
- }
- }
- }
-
- org.apache.qpid.server.exchange.Exchange getExchange()
- {
- return _exchange;
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if(ID.equals(name))
- {
- return getId();
- }
- else if(NAME.equals(name))
- {
- return getName();
- }
- else if(STATE.equals(name))
- {
- return State.ACTIVE;
- }
- else if(DURABLE.equals(name))
- {
- return isDurable();
- }
- else if(LIFETIME_POLICY.equals(name))
- {
- return _exchange.isAutoDelete() ? LifetimePolicy.AUTO_DELETE : LifetimePolicy.PERMANENT;
- }
- else if(TIME_TO_LIVE.equals(name))
- {
-
- }
- else if(CREATED.equals(name))
- {
-
- }
- else if(UPDATED.equals(name))
- {
-
- }
- else if(ALTERNATE_EXCHANGE.equals(name))
- {
- return _exchange.getAlternateExchange();
- }
- else if(TYPE.equals(name))
- {
- return _exchange.getTypeName();
- }
- return super.getAttribute(name);
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return AVAILABLE_ATTRIBUTES;
- }
-
- @Override
- protected boolean setState(State currentState, State desiredState)
- {
- if (desiredState == State.DELETED)
- {
- delete();
- return true;
- }
- return false;
- }
-
- @Override
- protected void changeAttributes(Map<String, Object> attributes)
- {
- throw new UnsupportedOperationException("Changing attributes on exchange is not supported.");
- }
-
- @Override
- protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
- {
- if (!_vhost.getSecurityManager().authoriseUpdate(_exchange))
- {
- throw new AccessControlException("Setting of exchange attribute is denied");
- }
- }
-
- @Override
- protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
- {
- if (!_vhost.getSecurityManager().authoriseUpdate(_exchange))
- {
- throw new AccessControlException("Setting of exchange attributes is denied");
- }
- }
-
- private class ExchangeStatistics implements Statistics
- {
-
- public Collection<String> getStatisticNames()
- {
- return AVAILABLE_STATISTICS;
- }
-
- public Object getStatistic(String name)
- {
- if(BINDING_COUNT.equals(name))
- {
- return _exchange.getBindingCount();
- }
- else if(BYTES_DROPPED.equals(name))
- {
- return _exchange.getByteDrops();
- }
- else if(BYTES_IN.equals(name))
- {
- return _exchange.getByteReceives();
- }
- else if(MESSAGES_DROPPED.equals(name))
- {
- return _exchange.getMsgDrops();
- }
- else if(MESSAGES_IN.equals(name))
- {
- return _exchange.getMsgReceives();
- }
- else if(PRODUCER_COUNT.equals(name))
- {
-
- }
- else if(STATE_CHANGED.equals(name))
- {
-
- }
- return null; // TODO - Implement
- }
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java
deleted file mode 100644
index f7560a0dfa..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProvider.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.model.adapter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.lang.reflect.Type;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.OverlappingFileLockException;
-import java.security.AccessControlException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQStoreException;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.IllegalStateTransitionException;
-import org.apache.qpid.server.model.LifetimePolicy;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.Statistics;
-import org.apache.qpid.server.util.MapValueConverter;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializationConfig;
-import org.codehaus.jackson.type.TypeReference;
-
-public class FileSystemPreferencesProvider extends AbstractAdapter implements PreferencesProvider
-{
- private static final Logger LOGGER = Logger.getLogger(FileSystemPreferencesProvider.class);
- public static String PATH = "path";
- public static final String PROVIDER_TYPE = "FileSystemPreferences";
-
- // TODO: use resolver to resolve path from
- // '${qpid.work_dir}/preferences/${authenticationProviderName}'
- @SuppressWarnings("serial")
- private static final Map<String, Object> DEFAULTS = Collections.unmodifiableMap(new HashMap<String, Object>()
- {{
- put(PATH, System.getProperty("user.home") + File.separator + ".qpid" + File.separator + "preferences.json");
- put(TYPE, FileSystemPreferencesProvider.class.getSimpleName());
- }});
-
- @SuppressWarnings("serial")
- private static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>()
- {{
- put(NAME, String.class);
- put(PATH, String.class);
- put(TYPE, String.class);
- }});
-
- @SuppressWarnings("serial")
- private static Collection<String> AVAILABLE_ATTRIBUTES = Collections.unmodifiableList(new ArrayList<String>(
- PreferencesProvider.AVAILABLE_ATTRIBUTES)
- {{
- add(PATH);
- }});
-
- private final AuthenticationProvider _authenticationProvider;
- private AtomicReference<State> _state;
-
- private final ObjectMapper _objectMapper;
- private final Map<String, Map<String, Object>> _preferences;
- private File _preferencesLocation;
- private FileLock _fileLock;
-
- protected FileSystemPreferencesProvider(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider, TaskExecutor taskExecutor)
- {
- super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), taskExecutor);
- State state = MapValueConverter.getEnumAttribute(State.class, STATE, attributes, State.INITIALISING);
- _state = new AtomicReference<State>(state);
- addParent(AuthenticationProvider.class, authenticationProvider);
- _authenticationProvider = authenticationProvider;
- _objectMapper = new ObjectMapper();
- _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- _objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
- _preferences = new TreeMap<String, Map<String, Object>>();
- _preferencesLocation = new File(MapValueConverter.getStringAttribute(PATH, attributes));
- _preferences.putAll(load(_objectMapper, _preferencesLocation));
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return AVAILABLE_ATTRIBUTES;
- }
-
- @Override
- public String getName()
- {
- return (String) getAttribute(AuthenticationProvider.NAME);
- }
-
- @Override
- public String setName(String currentName, String desiredName) throws IllegalStateException, AccessControlException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public State getActualState()
- {
- return _state.get();
- }
-
- @Override
- public boolean isDurable()
- {
- return true;
- }
-
- @Override
- public void setDurable(boolean durable) throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public LifetimePolicy getLifetimePolicy()
- {
- return LifetimePolicy.PERMANENT;
- }
-
- @Override
- public LifetimePolicy setLifetimePolicy(LifetimePolicy expected, LifetimePolicy desired) throws IllegalStateException,
- AccessControlException, IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public long getTimeToLive()
- {
- return 0;
- }
-
- @Override
- public long setTimeToLive(long expected, long desired) throws IllegalStateException, AccessControlException,
- IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Statistics getStatistics()
- {
- return NoStatistics.getInstance();
- }
-
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- return Collections.emptySet();
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if (CREATED.equals(name))
- {
- // TODO
- }
- else if (DURABLE.equals(name))
- {
- return true;
- }
- else if (ID.equals(name))
- {
- return getId();
- }
- else if (LIFETIME_POLICY.equals(name))
- {
- return LifetimePolicy.PERMANENT;
- }
- else if (STATE.equals(name))
- {
- return getActualState();
- }
- else if (TIME_TO_LIVE.equals(name))
- {
- // TODO
- }
- else if (UPDATED.equals(name))
- {
- // TODO
- }
- return super.getAttribute(name);
- }
-
- @Override
- public boolean setState(State currentState, State desiredState) throws IllegalStateTransitionException,
- AccessControlException
- {
- State state = _state.get();
- if (desiredState == State.DELETED)
- {
- if ((state == State.INITIALISING || state == State.ACTIVE || state == State.STOPPED || state == State.QUIESCED || state == State.ERRORED)
- && _state.compareAndSet(state, State.DELETED))
- {
- try
- {
- close();
- }
- finally
- {
- _preferencesLocation.delete();
- _authenticationProvider.setPreferencesProvider(null);
- }
- return true;
- }
- else
- {
- throw new IllegalStateException("Cannot delete preferences provider in state: " + state);
- }
- }
- else if (desiredState == State.ACTIVE)
- {
- if ((state == State.INITIALISING || state == State.QUIESCED || state == State.STOPPED)
- && _state.compareAndSet(state, State.ACTIVE))
- {
- try
- {
- getFileLock();
- Map<String, Map<String, Object>> preferences = load(_objectMapper, _preferencesLocation);
- setPreferences(preferences);
- return true;
- }
- catch (Exception e)
- {
- _state.compareAndSet(State.ACTIVE, State.ERRORED);
- Broker broker = getAuthenticationProvider().getParent(Broker.class);
- if (broker != null && broker.isManagementMode())
- {
- LOGGER.warn("Failed to activate preferences provider: " + getName(), e);
- }
- else
- {
- throw new RuntimeException(e);
- }
- }
- }
- else
- {
- throw new IllegalStateException("Cannot activate preferences provider in state: " + state);
- }
- }
- else if (desiredState == State.QUIESCED)
- {
- if (state == State.INITIALISING && _state.compareAndSet(state, State.QUIESCED))
- {
- close();
- return true;
- }
- }
- else if (desiredState == State.STOPPED)
- {
- if (_state.compareAndSet(state, State.STOPPED))
- {
- close();
- return true;
- }
- else
- {
- throw new IllegalStateException("Cannot stop authentication preferences in state: " + state);
- }
- }
-
- return false;
- }
-
- @Override
- public Map<String, Object> getPreferences(String userId)
- {
- Map<String, Object> userPreferences = null;
- synchronized (_preferences)
- {
- userPreferences = _preferences.get(userId);
- }
- if (userPreferences != null)
- {
- return new HashMap<String, Object>(userPreferences);
- }
- return Collections.emptyMap();
- }
-
- @Override
- public Map<String, Object> setPreferences(String userId, Map<String, Object> preferences)
- {
- Map<String, Object> userPreferences = null;
- synchronized (_preferences)
- {
- userPreferences = _preferences.get(userId);
- if (userPreferences == null)
- {
- userPreferences = new HashMap<String, Object>(preferences);
- _preferences.put(userId, userPreferences);
- }
- else
- {
- userPreferences.putAll(preferences);
- }
- savePreferences();
- }
- return userPreferences;
- }
-
- @Override
- public Map<String, Object> deletePreferences(String userId)
- {
- Map<String, Object> userPreferences = null;
- synchronized (_preferences)
- {
- if (_preferences.containsKey(userId))
- {
- userPreferences = _preferences.remove(userId);
- savePreferences();
- }
- }
- return userPreferences;
- }
-
- @Override
- public Set<String> listUserIDs()
- {
- synchronized (_preferences)
- {
- return Collections.unmodifiableSet(_preferences.keySet());
- }
- }
-
- public AuthenticationProvider getAuthenticationProvider()
- {
- return _authenticationProvider;
- }
-
- @Override
- protected void changeAttributes(Map<String, Object> attributes)
- {
- Map<String, Object> effectiveAttributes = MapValueConverter.convert(super.generateEffectiveAttributes(attributes),
- ATTRIBUTE_TYPES);
- validateAttributes(effectiveAttributes);
- String effectivePath = (String) effectiveAttributes.get(PATH);
- String currentPath = (String) getAttribute(PATH);
- Map<String, Map<String, Object>> newPreferences = null;
- File storeFile = new File(effectivePath);
- if (!effectivePath.equals(currentPath))
- {
- if (!storeFile.exists())
- {
- throw new IllegalConfigurationException("Path to preferences file does not exist!");
- }
- newPreferences = load(_objectMapper, storeFile);
- }
- super.changeAttributes(attributes);
-
- if (newPreferences != null)
- {
- setPreferences(newPreferences);
- _preferencesLocation = storeFile;
- }
-
- // if provider was previously in ERRORED state then set its state to
- // ACTIVE
- _state.compareAndSet(State.ERRORED, State.ACTIVE);
- }
-
- private void setPreferences(Map<String, Map<String, Object>> preferences)
- {
- synchronized (_preferences)
- {
- _preferences.clear();
- _preferences.putAll(preferences);
- }
- }
-
- private void validateAttributes(Map<String, Object> attributes)
- {
- super.validateChangeAttributes(attributes);
-
- String newName = (String) attributes.get(NAME);
- String currentName = getName();
- if (!currentName.equals(newName))
- {
- throw new IllegalConfigurationException("Changing the name of preferences provider is not supported");
- }
- String newType = (String) attributes.get(TYPE);
- String currentType = (String) getAttribute(TYPE);
- if (!currentType.equals(newType))
- {
- throw new IllegalConfigurationException("Changing the type of preferences provider is not supported");
- }
- String path = (String) attributes.get(PATH);
- if (path == null || path.equals("") || !(path instanceof String))
- {
- throw new IllegalConfigurationException("Path to preferences file is not specified");
- }
- }
-
- public File createStoreIfNotExist()
- {
- String path = (String)getAttribute(PATH);
- File preferencesLocation = new File(path);
- if (!preferencesLocation.exists())
- {
- File parent = preferencesLocation.getParentFile();
- if (!parent.exists() && !parent.mkdirs())
- {
- throw new IllegalConfigurationException("Cannot store preferences at " + path);
- }
- try
- {
- preferencesLocation.createNewFile();
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot store preferences at " + path);
- }
- }
- return preferencesLocation;
- }
-
- private Map<String, Map<String, Object>> load(ObjectMapper mapper, File file)
- {
- if (!file.exists() || file.length() == 0)
- {
- return Collections.emptyMap();
- }
-
- try
- {
- return mapper.readValue(file, new TypeReference<Map<String, Map<String, Object>>>()
- {
- });
- }
- catch (JsonProcessingException e)
- {
- throw new IllegalConfigurationException("Cannot parse json", e);
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot read json", e);
- }
- }
-
- private void savePreferences()
- {
- save(_objectMapper, _preferencesLocation, _preferences);
- }
-
- private void save(ObjectMapper mapper, File file, Map<String, Map<String, Object>> preferences)
- {
- try
- {
- RandomAccessFile raf = new RandomAccessFile(file, "rw");
- try
- {
- FileChannel channel = raf.getChannel();
- try
- {
- FileLock lock = null;
- try
- {
- lock = channel.tryLock();
- if (lock == null)
- {
- throw new IllegalConfigurationException("Cannot aquire exclusive lock on preferences file for "
- + getName());
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- mapper.writeValue(baos, preferences);
- channel.write(ByteBuffer.wrap(baos.toByteArray()));
- }
- catch (OverlappingFileLockException e)
- {
- throw new IllegalConfigurationException("Cannot aquire exclusive lock on preferences file for "
- + getName(), e);
- }
- finally
- {
- if (lock != null)
- {
- lock.release();
- }
- }
- }
- finally
- {
- channel.close();
- }
- }
- finally
- {
- raf.close();
- }
- }
- catch (FileNotFoundException e)
- {
- throw new IllegalConfigurationException("Cannot find preferences file for " + getName(), e);
- }
- catch (IOException e)
- {
- throw new IllegalConfigurationException("Cannot store preferences file for " + getName(), e);
- }
- }
-
- private void getFileLock() throws IOException, AMQStoreException
- {
- File lockFile = new File(getLockFileName());
- lockFile.createNewFile();
-
- FileOutputStream out = new FileOutputStream(lockFile);
- FileChannel channel = out.getChannel();
- try
- {
- _fileLock = channel.tryLock();
- }
- catch(OverlappingFileLockException e)
- {
- _fileLock = null;
- }
- if(_fileLock == null)
- {
- throw new AMQStoreException("Cannot get lock on file " + lockFile.getAbsolutePath() + " is another instance running?");
- }
- lockFile.deleteOnExit();
- }
-
- private String getLockFileName()
- {
- return _preferencesLocation.getAbsolutePath() + ".lck";
- }
-
- public void close()
- {
- try
- {
- releaseFileLock();
- }
- catch(IOException e)
- {
- LOGGER.error("Cannot close file system preferences provider", e);
- }
- finally
- {
- new File(getLockFileName()).delete();
- _fileLock = null;
- _preferences.clear();
- }
- }
-
- private void releaseFileLock() throws IOException
- {
- _fileLock.release();
- _fileLock.channel().close();
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PreferencesProviderCreator.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PreferencesProviderCreator.java
deleted file mode 100644
index 4bcca0e300..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PreferencesProviderCreator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.qpid.server.model.adapter;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.plugin.PreferencesProviderFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-
-public class PreferencesProviderCreator
-{
- private final Map<String, PreferencesProviderFactory> _factories;
- private Collection<String> _supportedPreferencesProviders;
-
- public PreferencesProviderCreator()
- {
- QpidServiceLoader<PreferencesProviderFactory> preferencesProviderFactoriess = new QpidServiceLoader<PreferencesProviderFactory>();
-
- Iterable<PreferencesProviderFactory> factories = preferencesProviderFactoriess
- .instancesOf(PreferencesProviderFactory.class);
-
- Map<String, PreferencesProviderFactory> registeredPreferencesProviderFactories = new HashMap<String, PreferencesProviderFactory>();
- for (PreferencesProviderFactory factory : factories)
- {
- PreferencesProviderFactory existingFactory = registeredPreferencesProviderFactories.put(factory.getType(),
- factory);
- if (existingFactory != null)
- {
- throw new IllegalConfigurationException("Preferences provider factory of the same type '"
- + factory.getType() + "' is already registered using class '" + existingFactory.getClass().getName()
- + "', can not register class '" + factory.getClass().getName() + "'");
- }
- }
- _factories = registeredPreferencesProviderFactories;
- _supportedPreferencesProviders = Collections.unmodifiableCollection(registeredPreferencesProviderFactories.keySet());
- }
-
- public Collection<String> getSupportedPreferencesProviders()
- {
- return _supportedPreferencesProviders;
- }
-
- public PreferencesProvider create(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider)
- {
- return createPreferencesProvider(id, attributes, authenticationProvider);
- }
-
- public PreferencesProvider recover(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProviderr)
- {
- return createPreferencesProvider(id, attributes, authenticationProviderr);
- }
-
- private PreferencesProvider createPreferencesProvider(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider)
- {
- for (PreferencesProviderFactory factory : _factories.values())
- {
- return factory.createInstance(id, attributes, authenticationProvider);
- }
- throw new IllegalConfigurationException("No group provider factory found for configuration attributes " + attributes);
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
deleted file mode 100644
index 58b0b76735..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
+++ /dev/null
@@ -1,1273 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import java.io.File;
-import java.lang.reflect.Type;
-import java.security.AccessControlException;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.configuration.SystemConfiguration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.configuration.XmlConfigurationUtilities.MyConfiguration;
-import org.apache.qpid.server.message.ServerMessage;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.Connection;
-import org.apache.qpid.server.model.Exchange;
-import org.apache.qpid.server.model.IntegrityViolationException;
-import org.apache.qpid.server.model.LifetimePolicy;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Protocol;
-import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.model.QueueType;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.Statistics;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.VirtualHostAlias;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.plugin.ExchangeType;
-import org.apache.qpid.server.protocol.AMQConnectionModel;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.QueueArgumentsConverter;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.SimpleAMQQueue;
-import org.apache.qpid.server.security.SecurityManager;
-import org.apache.qpid.server.security.access.Operation;
-import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.txn.LocalTransaction;
-import org.apache.qpid.server.txn.ServerTransaction;
-import org.apache.qpid.server.util.MapValueConverter;
-import org.apache.qpid.server.plugin.VirtualHostFactory;
-import org.apache.qpid.server.virtualhost.ExchangeExistsException;
-import org.apache.qpid.server.virtualhost.ReservedExchangeNameException;
-import org.apache.qpid.server.virtualhost.UnknownExchangeException;
-import org.apache.qpid.server.virtualhost.VirtualHostListener;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.server.virtualhost.plugins.QueueExistsException;
-
-public final class VirtualHostAdapter extends AbstractAdapter implements VirtualHost, VirtualHostListener
-{
- private static final Logger LOGGER = Logger.getLogger(VirtualHostAdapter.class);
-
- @SuppressWarnings("serial")
- public static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>(){{
- put(NAME, String.class);
- put(TYPE, String.class);
- put(STORE_PATH, String.class);
- put(STORE_TYPE, String.class);
- put(CONFIG_PATH, String.class);
- put(STATE, State.class);
- }});
-
- private org.apache.qpid.server.virtualhost.VirtualHost _virtualHost;
-
- private final Map<AMQConnectionModel, ConnectionAdapter> _connectionAdapters =
- new HashMap<AMQConnectionModel, ConnectionAdapter>();
-
- private final Map<AMQQueue, QueueAdapter> _queueAdapters =
- new HashMap<AMQQueue, QueueAdapter>();
-
- private final Map<org.apache.qpid.server.exchange.Exchange, ExchangeAdapter> _exchangeAdapters =
- new HashMap<org.apache.qpid.server.exchange.Exchange, ExchangeAdapter>();
- private StatisticsAdapter _statistics;
- private final Broker _broker;
- private final List<VirtualHostAlias> _aliases = new ArrayList<VirtualHostAlias>();
- private StatisticsGatherer _brokerStatisticsGatherer;
-
- public VirtualHostAdapter(UUID id, Map<String, Object> attributes, Broker broker, StatisticsGatherer brokerStatisticsGatherer, TaskExecutor taskExecutor)
- {
- super(id, null, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES, false), taskExecutor, false);
- _broker = broker;
- _brokerStatisticsGatherer = brokerStatisticsGatherer;
- validateAttributes();
- addParent(Broker.class, broker);
- }
-
- private void validateAttributes()
- {
- String name = getName();
- if (name == null || "".equals(name.trim()))
- {
- throw new IllegalConfigurationException("Virtual host name must be specified");
- }
-
- String configurationFile = (String) getAttribute(CONFIG_PATH);
- String type = (String) getAttribute(TYPE);
-
- boolean invalidAttributes = false;
- if (configurationFile == null)
- {
- if (type == null)
- {
- invalidAttributes = true;
- }
- else
- {
- validateAttributes(type);
- }
- }/*
- else
- {
- if (type != null)
- {
- invalidAttributes = true;
- }
-
- }*/
- if (invalidAttributes)
- {
- throw new IllegalConfigurationException("Please specify either the 'configPath' attribute or 'type' attributes");
- }
-
- // pre-load the configuration in order to validate
- try
- {
- createVirtualHostConfiguration(name);
- }
- catch(ConfigurationException e)
- {
- throw new IllegalConfigurationException("Failed to validate configuration", e);
- }
- }
-
- private void validateAttributes(String type)
- {
- final VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
- if(factory == null)
- {
- throw new IllegalArgumentException("Unknown virtual host type '"+ type +"'. Valid types are: " + VirtualHostFactory.TYPES.get());
- }
- factory.validateAttributes(getActualAttributes());
-
- }
-
- private void populateExchanges()
- {
- Collection<org.apache.qpid.server.exchange.Exchange> actualExchanges =
- _virtualHost.getExchanges();
-
- synchronized (_exchangeAdapters)
- {
- for(org.apache.qpid.server.exchange.Exchange exchange : actualExchanges)
- {
- if(!_exchangeAdapters.containsKey(exchange))
- {
- _exchangeAdapters.put(exchange, new ExchangeAdapter(this,exchange));
- }
- }
- }
- }
-
-
- private void populateQueues()
- {
- Collection<AMQQueue> actualQueues = _virtualHost.getQueues();
- if ( actualQueues != null )
- {
- synchronized(_queueAdapters)
- {
- for(AMQQueue queue : actualQueues)
- {
- if(!_queueAdapters.containsKey(queue))
- {
- _queueAdapters.put(queue, new QueueAdapter(this, queue));
- }
- }
- }
- }
- }
-
- public Collection<VirtualHostAlias> getAliases()
- {
- return Collections.unmodifiableCollection(_aliases);
- }
-
- public Collection<Connection> getConnections()
- {
- synchronized(_connectionAdapters)
- {
- return new ArrayList<Connection>(_connectionAdapters.values());
- }
-
- }
-
- /**
- * Retrieve the ConnectionAdapter instance keyed by the AMQConnectionModel from this VirtualHost.
- * @param connection the AMQConnectionModel used to index the ConnectionAdapter.
- * @return the requested ConnectionAdapter.
- */
- ConnectionAdapter getConnectionAdapter(AMQConnectionModel connection)
- {
- synchronized (_connectionAdapters)
- {
- return _connectionAdapters.get(connection);
- }
- }
-
- public Collection<Queue> getQueues()
- {
- synchronized(_queueAdapters)
- {
- return new ArrayList<Queue>(_queueAdapters.values());
- }
- }
-
- public Collection<Exchange> getExchanges()
- {
- synchronized (_exchangeAdapters)
- {
- return new ArrayList<Exchange>(_exchangeAdapters.values());
- }
- }
-
-
- public Exchange createExchange(Map<String, Object> attributes)
- throws AccessControlException, IllegalArgumentException
- {
- attributes = new HashMap<String, Object>(attributes);
-
- String name = MapValueConverter.getStringAttribute(Exchange.NAME, attributes, null);
- State state = MapValueConverter.getEnumAttribute(State.class, Exchange.STATE, attributes, State.ACTIVE);
- boolean durable = MapValueConverter.getBooleanAttribute(Exchange.DURABLE, attributes, false);
- LifetimePolicy lifetime = MapValueConverter.getEnumAttribute(LifetimePolicy.class, Exchange.LIFETIME_POLICY, attributes, LifetimePolicy.PERMANENT);
- String type = MapValueConverter.getStringAttribute(Exchange.TYPE, attributes, null);
- long ttl = MapValueConverter.getLongAttribute(Exchange.TIME_TO_LIVE, attributes, 0l);
-
- attributes.remove(Exchange.NAME);
- attributes.remove(Exchange.STATE);
- attributes.remove(Exchange.DURABLE);
- attributes.remove(Exchange.LIFETIME_POLICY);
- attributes.remove(Exchange.TYPE);
- attributes.remove(Exchange.TIME_TO_LIVE);
-
- return createExchange(name, state, durable, lifetime, ttl, type, attributes);
- }
-
- public Exchange createExchange(final String name,
- final State initialState,
- final boolean durable,
- final LifetimePolicy lifetime,
- final long ttl,
- final String type,
- final Map<String, Object> attributes)
- throws AccessControlException, IllegalArgumentException
- {
- checkVHostStateIsActive();
-
- try
- {
- String alternateExchange = null;
- if(attributes.containsKey(Exchange.ALTERNATE_EXCHANGE))
- {
- Object altExchangeObject = attributes.get(Exchange.ALTERNATE_EXCHANGE);
- if(altExchangeObject instanceof Exchange)
- {
- alternateExchange = ((Exchange) altExchangeObject).getName();
- }
- else if(altExchangeObject instanceof UUID)
- {
- for(Exchange ex : getExchanges())
- {
- if(altExchangeObject.equals(ex.getId()))
- {
- alternateExchange = ex.getName();
- break;
- }
- }
- }
- else if(altExchangeObject instanceof String)
- {
-
- for(Exchange ex : getExchanges())
- {
- if(altExchangeObject.equals(ex.getName()))
- {
- alternateExchange = ex.getName();
- break;
- }
- }
- if(alternateExchange == null)
- {
- try
- {
- UUID id = UUID.fromString(altExchangeObject.toString());
- for(Exchange ex : getExchanges())
- {
- if(id.equals(ex.getId()))
- {
- alternateExchange = ex.getName();
- break;
- }
- }
- }
- catch(IllegalArgumentException e)
- {
- // ignore
- }
-
- }
- }
- }
- org.apache.qpid.server.exchange.Exchange exchange = _virtualHost.createExchange(null,
- name,
- type,
- durable,
- lifetime == LifetimePolicy.AUTO_DELETE,
- alternateExchange);
- synchronized (_exchangeAdapters)
- {
- return _exchangeAdapters.get(exchange);
- }
-
- }
- catch(ExchangeExistsException e)
- {
- throw new IllegalArgumentException("Exchange with name '" + name + "' already exists");
- }
- catch(ReservedExchangeNameException e)
- {
- throw new UnsupportedOperationException("'" + name + "' is a reserved exchange name");
- }
- catch(UnknownExchangeException e)
- {
- throw new IllegalArgumentException("Alternate Exchange with name '" + e.getExchangeName() + "' does not exist");
- }
- catch(AMQException e)
- {
- throw new IllegalArgumentException(e);
- }
- }
-
- public Queue createQueue(Map<String, Object> attributes)
- throws AccessControlException, IllegalArgumentException
- {
- attributes = new HashMap<String, Object>(attributes);
-
- if (attributes.containsKey(Queue.TYPE))
- {
- String typeAttribute = MapValueConverter.getStringAttribute(Queue.TYPE, attributes, null);
- QueueType queueType = null;
- try
- {
- queueType = QueueType.valueOf(typeAttribute.toUpperCase());
- }
- catch(Exception e)
- {
- throw new IllegalArgumentException("Unsupported queue type :" + typeAttribute);
- }
- if (queueType == QueueType.LVQ && attributes.get(Queue.LVQ_KEY) == null)
- {
- attributes.put(Queue.LVQ_KEY, AMQQueueFactory.QPID_DEFAULT_LVQ_KEY);
- }
- else if (queueType == QueueType.PRIORITY && attributes.get(Queue.PRIORITIES) == null)
- {
- attributes.put(Queue.PRIORITIES, 10);
- }
- else if (queueType == QueueType.SORTED && attributes.get(Queue.SORT_KEY) == null)
- {
- throw new IllegalArgumentException("Sort key is not specified for sorted queue");
- }
- }
-
- if (attributes.containsKey(Queue.MESSAGE_GROUP_KEY))
- {
- String key = MapValueConverter.getStringAttribute(Queue.MESSAGE_GROUP_KEY, attributes);
- attributes.remove(Queue.MESSAGE_GROUP_KEY);
- attributes.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY, key);
- }
-
- if (attributes.containsKey(Queue.MESSAGE_GROUP_SHARED_GROUPS))
- {
- if(MapValueConverter.getBooleanAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS, attributes))
- {
- attributes.remove(Queue.MESSAGE_GROUP_SHARED_GROUPS);
- attributes.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP, SimpleAMQQueue.SHARED_MSG_GROUP_ARG_VALUE);
- }
- }
-
- String name = MapValueConverter.getStringAttribute(Queue.NAME, attributes, null);
- State state = MapValueConverter.getEnumAttribute(State.class, Queue.STATE, attributes, State.ACTIVE);
- boolean durable = MapValueConverter.getBooleanAttribute(Queue.DURABLE, attributes, false);
- LifetimePolicy lifetime = MapValueConverter.getEnumAttribute(LifetimePolicy.class, Queue.LIFETIME_POLICY, attributes, LifetimePolicy.PERMANENT);
- long ttl = MapValueConverter.getLongAttribute(Queue.TIME_TO_LIVE, attributes, 0l);
- boolean exclusive= MapValueConverter.getBooleanAttribute(Queue.EXCLUSIVE, attributes, false);
-
- attributes.remove(Queue.NAME);
- attributes.remove(Queue.STATE);
- attributes.remove(Queue.DURABLE);
- attributes.remove(Queue.LIFETIME_POLICY);
- attributes.remove(Queue.TIME_TO_LIVE);
-
- return createQueue(name, state, durable, exclusive, lifetime, ttl, attributes);
- }
-
- public Queue createQueue(final String name,
- final State initialState,
- final boolean durable,
- boolean exclusive,
- final LifetimePolicy lifetime,
- final long ttl,
- final Map<String, Object> attributes)
- throws AccessControlException, IllegalArgumentException
- {
- checkVHostStateIsActive();
-
- String owner = null;
- if(exclusive)
- {
- Principal authenticatedPrincipal = AuthenticatedPrincipal.getOptionalAuthenticatedPrincipalFromSubject(SecurityManager.getThreadSubject());
- if(authenticatedPrincipal != null)
- {
- owner = authenticatedPrincipal.getName();
- }
- }
-
- final boolean autoDelete = lifetime == LifetimePolicy.AUTO_DELETE;
-
- try
- {
-
- AMQQueue queue =
- _virtualHost.createQueue(UUIDGenerator.generateQueueUUID(name, _virtualHost.getName()), name,
- durable, owner, autoDelete, exclusive, autoDelete && exclusive, attributes);
-
- synchronized (_queueAdapters)
- {
- return _queueAdapters.get(queue);
- }
-
- }
- catch(QueueExistsException qe)
- {
- throw new IllegalArgumentException("Queue with name "+name+" already exists");
- }
- catch(AMQException e)
- {
- throw new IllegalArgumentException(e);
- }
-
- }
-
- public String getName()
- {
- return (String)getAttribute(NAME);
- }
-
- public String setName(final String currentName, final String desiredName)
- throws IllegalStateException, AccessControlException
- {
- throw new IllegalStateException();
- }
-
-
- public String getType()
- {
- return (String)getAttribute(TYPE);
- }
-
- public String setType(final String currentType, final String desiredType)
- throws IllegalStateException, AccessControlException
- {
- throw new IllegalStateException();
- }
-
-
- @Override
- public State getActualState()
- {
- if (_virtualHost == null)
- {
- State state = (State)super.getAttribute(STATE);
- if (state == null)
- {
- return State.INITIALISING;
- }
- return state;
- }
- else
- {
- org.apache.qpid.server.virtualhost.State implementationState = _virtualHost.getState();
- switch(implementationState)
- {
- case INITIALISING:
- return State.INITIALISING;
- case ACTIVE:
- return State.ACTIVE;
- case PASSIVE:
- return State.REPLICA;
- case STOPPED:
- return State.STOPPED;
- case ERRORED:
- return State.ERRORED;
- default:
- throw new IllegalStateException("Unsupported state:" + implementationState);
- }
- }
- }
-
- public boolean isDurable()
- {
- return true;
- }
-
- public void setDurable(final boolean durable)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public LifetimePolicy getLifetimePolicy()
- {
- return LifetimePolicy.PERMANENT;
- }
-
- public LifetimePolicy setLifetimePolicy(final LifetimePolicy expected, final LifetimePolicy desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public long getTimeToLive()
- {
- return 0;
- }
-
- public long setTimeToLive(final long expected, final long desired)
- throws IllegalStateException, AccessControlException, IllegalArgumentException
- {
- throw new IllegalStateException();
- }
-
- public Statistics getStatistics()
- {
- return _statistics;
- }
-
- @Override
- public <C extends ConfiguredObject> Collection<C> getChildren(Class<C> clazz)
- {
- if(clazz == Exchange.class)
- {
- return (Collection<C>) getExchanges();
- }
- else if(clazz == Queue.class)
- {
- return (Collection<C>) getQueues();
- }
- else if(clazz == Connection.class)
- {
- return (Collection<C>) getConnections();
- }
- else if(clazz == VirtualHostAlias.class)
- {
- return (Collection<C>) getAliases();
- }
- else
- {
- return Collections.emptySet();
- }
- }
-
- @Override
- public <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
- {
- if(childClass == Exchange.class)
- {
- createExchange(attributes);
-
- // return null to avoid double notification of VirtualHostMBean
- // as we already notify it in the exchangeRegistered
- return null;
- }
- else if(childClass == Queue.class)
- {
- createQueue(attributes);
-
- // return null to avoid double notification of VirtualHostMBean
- // as we already notify it in the queueRegistered
- return null;
- }
- else if(childClass == VirtualHostAlias.class)
- {
- throw new UnsupportedOperationException();
- }
- else if(childClass == Connection.class)
- {
- throw new UnsupportedOperationException();
- }
- throw new IllegalArgumentException("Cannot create a child of class " + childClass.getSimpleName());
- }
-
- public void exchangeRegistered(org.apache.qpid.server.exchange.Exchange exchange)
- {
- ExchangeAdapter adapter = null;
- synchronized (_exchangeAdapters)
- {
- if(!_exchangeAdapters.containsKey(exchange))
- {
- adapter = new ExchangeAdapter(this, exchange);
- _exchangeAdapters.put(exchange, adapter);
-
- }
-
- }
- if(adapter != null)
- {
- childAdded(adapter);
- }
-
- }
-
-
- public void exchangeUnregistered(org.apache.qpid.server.exchange.Exchange exchange)
- {
- ExchangeAdapter adapter;
- synchronized (_exchangeAdapters)
- {
- adapter = _exchangeAdapters.remove(exchange);
-
- }
-
- if(adapter != null)
- {
- childRemoved(adapter);
- }
- }
-
- public void queueRegistered(AMQQueue queue)
- {
- QueueAdapter adapter = null;
- synchronized (_queueAdapters)
- {
- if(!_queueAdapters.containsKey(queue))
- {
- adapter = new QueueAdapter(this, queue);
- _queueAdapters.put(queue, adapter);
-
- }
-
- }
- if(adapter != null)
- {
- childAdded(adapter);
- }
-
- }
-
- public void queueUnregistered(AMQQueue queue)
- {
-
- QueueAdapter adapter;
- synchronized (_queueAdapters)
- {
- adapter = _queueAdapters.remove(queue);
-
- }
-
- if(adapter != null)
- {
- childRemoved(adapter);
- }
- }
-
- public void connectionRegistered(AMQConnectionModel connection)
- {
- ConnectionAdapter adapter = null;
- synchronized (_connectionAdapters)
- {
- if(!_connectionAdapters.containsKey(connection))
- {
- adapter = new ConnectionAdapter(connection, getTaskExecutor());
- _connectionAdapters.put(connection, adapter);
-
- }
-
- }
- if(adapter != null)
- {
- childAdded(adapter);
- }
- }
-
- public void connectionUnregistered(AMQConnectionModel connection)
- {
-
- ConnectionAdapter adapter;
- synchronized (_connectionAdapters)
- {
- adapter = _connectionAdapters.remove(connection);
-
- }
-
- if(adapter != null)
- {
- // Call getSessions() first to ensure that any SessionAdapter children are cleanly removed and any
- // corresponding ConfigurationChangeListener childRemoved() callback is called for child SessionAdapters.
- adapter.getSessions();
-
- childRemoved(adapter);
- }
- }
-
- QueueAdapter getQueueAdapter(AMQQueue queue)
- {
- synchronized (_queueAdapters)
- {
- return _queueAdapters.get(queue);
- }
- }
-
- public Collection<String> getExchangeTypes()
- {
- Collection<ExchangeType<? extends org.apache.qpid.server.exchange.Exchange>> types =
- _virtualHost.getExchangeTypes();
-
- Collection<String> exchangeTypes = new ArrayList<String>();
-
- for(ExchangeType<? extends org.apache.qpid.server.exchange.Exchange> type : types)
- {
- exchangeTypes.add(type.getType());
- }
- return Collections.unmodifiableCollection(exchangeTypes);
- }
-
- public void executeTransaction(TransactionalOperation op)
- {
- MessageStore store = _virtualHost.getMessageStore();
- final LocalTransaction txn = new LocalTransaction(store);
-
- op.withinTransaction(new Transaction()
- {
- public void dequeue(final QueueEntry entry)
- {
- if(entry.acquire())
- {
- txn.dequeue(entry.getQueue(), entry.getMessage(), new ServerTransaction.Action()
- {
- public void postCommit()
- {
- entry.discard();
- }
-
- public void onRollback()
- {
- }
- });
- }
- }
-
- public void copy(QueueEntry entry, Queue queue)
- {
- final ServerMessage message = entry.getMessage();
- final AMQQueue toQueue = ((QueueAdapter)queue).getAMQQueue();
-
- txn.enqueue(toQueue, message, new ServerTransaction.Action()
- {
- public void postCommit()
- {
- try
- {
- toQueue.enqueue(message);
- }
- catch(AMQException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void onRollback()
- {
- }
- });
-
- }
-
- public void move(final QueueEntry entry, Queue queue)
- {
- final ServerMessage message = entry.getMessage();
- final AMQQueue toQueue = ((QueueAdapter)queue).getAMQQueue();
- if(entry.acquire())
- {
- txn.enqueue(toQueue, message,
- new ServerTransaction.Action()
- {
-
- public void postCommit()
- {
- try
- {
- toQueue.enqueue(message);
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void onRollback()
- {
- entry.release();
- }
- });
- txn.dequeue(entry.getQueue(), message,
- new ServerTransaction.Action()
- {
-
- public void postCommit()
- {
- entry.discard();
- }
-
- public void onRollback()
- {
-
- }
- });
- }
- }
-
- });
- txn.commit();
- }
-
- org.apache.qpid.server.virtualhost.VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- @Override
- public Object getAttribute(String name)
- {
- if(ID.equals(name))
- {
- return getId();
- }
- else if(STATE.equals(name))
- {
- return getActualState();
- }
- else if(DURABLE.equals(name))
- {
- return isDurable();
- }
- else if(LIFETIME_POLICY.equals(name))
- {
- return LifetimePolicy.PERMANENT;
- }
- else if(TIME_TO_LIVE.equals(name))
- {
- // TODO
- }
- else if(CREATED.equals(name))
- {
- // TODO
- }
- else if(UPDATED.equals(name))
- {
- // TODO
- }
- else if (_virtualHost != null)
- {
- return getAttributeFromVirtualHostImplementation(name);
- }
- return super.getAttribute(name);
- }
-
- private Object getAttributeFromVirtualHostImplementation(String name)
- {
- if(SUPPORTED_EXCHANGE_TYPES.equals(name))
- {
- List<String> types = new ArrayList<String>();
- for(@SuppressWarnings("rawtypes") ExchangeType type : _virtualHost.getExchangeTypes())
- {
- types.add(type.getType());
- }
- return Collections.unmodifiableCollection(types);
- }
- else if(SUPPORTED_QUEUE_TYPES.equals(name))
- {
- // TODO
- }
- else if(QUEUE_DEAD_LETTER_QUEUE_ENABLED.equals(name))
- {
- return _virtualHost.getConfiguration().isDeadLetterQueueEnabled();
- }
- else if(HOUSEKEEPING_CHECK_PERIOD.equals(name))
- {
- return _virtualHost.getConfiguration().getHousekeepingCheckPeriod();
- }
- else if(QUEUE_MAXIMUM_DELIVERY_ATTEMPTS.equals(name))
- {
- return _virtualHost.getConfiguration().getMaxDeliveryCount();
- }
- else if(QUEUE_FLOW_CONTROL_SIZE_BYTES.equals(name))
- {
- return _virtualHost.getConfiguration().getCapacity();
- }
- else if(QUEUE_FLOW_RESUME_SIZE_BYTES.equals(name))
- {
- return _virtualHost.getConfiguration().getFlowResumeCapacity();
- }
- else if(STORE_TYPE.equals(name))
- {
- return _virtualHost.getMessageStore().getStoreType();
- }
- else if(STORE_PATH.equals(name))
- {
- return _virtualHost.getMessageStore().getStoreLocation();
- }
- else if(STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE.equals(name))
- {
- return _virtualHost.getConfiguration().getTransactionTimeoutIdleClose();
- }
- else if(STORE_TRANSACTION_IDLE_TIMEOUT_WARN.equals(name))
- {
- return _virtualHost.getConfiguration().getTransactionTimeoutIdleWarn();
- }
- else if(STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE.equals(name))
- {
- return _virtualHost.getConfiguration().getTransactionTimeoutOpenClose();
- }
- else if(STORE_TRANSACTION_OPEN_TIMEOUT_WARN.equals(name))
- {
- return _virtualHost.getConfiguration().getTransactionTimeoutOpenWarn();
- }
- else if(QUEUE_ALERT_REPEAT_GAP.equals(name))
- {
- return _virtualHost.getConfiguration().getMinimumAlertRepeatGap();
- }
- else if(QUEUE_ALERT_THRESHOLD_MESSAGE_AGE.equals(name))
- {
- return _virtualHost.getConfiguration().getMaximumMessageAge();
- }
- else if(QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE.equals(name))
- {
- return _virtualHost.getConfiguration().getMaximumMessageSize();
- }
- else if(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES.equals(name))
- {
- return _virtualHost.getConfiguration().getMaximumQueueDepth();
- }
- else if(QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES.equals(name))
- {
- return _virtualHost.getConfiguration().getMaximumMessageCount();
- }
- return super.getAttribute(name);
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return AVAILABLE_ATTRIBUTES;
- }
-
- private void checkVHostStateIsActive()
- {
- if (!org.apache.qpid.server.virtualhost.State.ACTIVE.equals(_virtualHost.getState()))
- {
- throw new IllegalStateException("The virtual hosts state of " + _virtualHost.getState()
- + " does not permit this operation.");
- }
- }
-
-
- private static class VirtualHostStatisticsAdapter extends StatisticsAdapter
- {
- private final org.apache.qpid.server.virtualhost.VirtualHost _vhost;
-
- private static final Collection<String> VHOST_STATS = Arrays.asList(
- VirtualHost.QUEUE_COUNT,
- VirtualHost.EXCHANGE_COUNT,
- VirtualHost.CONNECTION_COUNT);
-
- public VirtualHostStatisticsAdapter(org.apache.qpid.server.virtualhost.VirtualHost virtualHost)
- {
- super(virtualHost);
- _vhost = virtualHost;
- }
-
- @Override
- public Collection<String> getStatisticNames()
- {
- Set<String> stats = new HashSet<String>(super.getStatisticNames());
- stats.addAll(VHOST_STATS);
- return stats;
- }
-
- @Override
- public Object getStatistic(String name)
- {
- if(VirtualHost.QUEUE_COUNT.equals(name))
- {
- return _vhost.getQueues().size();
- }
- else if(VirtualHost.EXCHANGE_COUNT.equals(name))
- {
- return _vhost.getExchanges().size();
- }
- else if(VirtualHost.CONNECTION_COUNT.equals(name))
- {
- return _vhost.getConnectionRegistry().getConnections().size();
- }
- else
- {
- return super.getStatistic(name);
- }
- }
- }
-
-
- @Override
- protected boolean setState(State currentState, State desiredState)
- {
- if (desiredState == State.ACTIVE)
- {
- try
- {
- activate();
- }
- catch(RuntimeException e)
- {
- changeAttribute(STATE, State.INITIALISING, State.ERRORED);
- if (_broker.isManagementMode())
- {
- LOGGER.warn("Failed to activate virtual host: " + getName(), e);
- }
- else
- {
- throw e;
- }
- }
- return true;
- }
- else if (desiredState == State.STOPPED)
- {
- if (_virtualHost != null)
- {
- try
- {
- _virtualHost.close();
- }
- finally
- {
- _broker.getVirtualHostRegistry().unregisterVirtualHost(_virtualHost);
- }
- }
- return true;
- }
- else if (desiredState == State.DELETED)
- {
- String hostName = getName();
-
- if (hostName.equals(_broker.getAttribute(Broker.DEFAULT_VIRTUAL_HOST)))
- {
- throw new IntegrityViolationException("Cannot delete default virtual host '" + hostName + "'");
- }
- if (_virtualHost != null)
- {
- if (_virtualHost.getState() == org.apache.qpid.server.virtualhost.State.ACTIVE)
- {
- setDesiredState(currentState, State.STOPPED);
- }
-
- MessageStore ms = _virtualHost.getMessageStore();
- if (ms != null)
- {
- try
- {
- ms.onDelete();
- }
- catch(Exception e)
- {
- LOGGER.warn("Exception occured on store deletion", e);
- }
- }
-
- _virtualHost = null;
- }
- setAttribute(VirtualHost.STATE, getActualState(), State.DELETED);
- return true;
- }
- return false;
- }
-
- private void activate()
- {
- VirtualHostRegistry virtualHostRegistry = _broker.getVirtualHostRegistry();
- String virtualHostName = getName();
- try
- {
- VirtualHostConfiguration configuration = createVirtualHostConfiguration(virtualHostName);
- String type = configuration.getType();
- final VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
- if(factory == null)
- {
- throw new IllegalArgumentException("Unknown virtual host type: " + type);
- }
- else
- {
- _virtualHost = factory.createVirtualHost(_broker.getVirtualHostRegistry(),
- _brokerStatisticsGatherer,
- _broker.getSecurityManager(),
- configuration,
- this);
- }
- }
- catch (Exception e)
- {
- throw new RuntimeException("Failed to create virtual host " + virtualHostName, e);
- }
-
- virtualHostRegistry.registerVirtualHost(_virtualHost);
-
- _statistics = new VirtualHostStatisticsAdapter(_virtualHost);
- _virtualHost.addVirtualHostListener(this);
- populateQueues();
- populateExchanges();
-
- synchronized(_aliases)
- {
- for(Port port :_broker.getPorts())
- {
- if (Protocol.hasAmqpProtocol(port.getProtocols()))
- {
- _aliases.add(new VirtualHostAliasAdapter(this, port));
- }
- }
- }
- }
-
- private VirtualHostConfiguration createVirtualHostConfiguration(String virtualHostName) throws ConfigurationException
- {
- VirtualHostConfiguration configuration;
- String configurationFile = (String)getAttribute(CONFIG_PATH);
- if (configurationFile == null)
- {
- final MyConfiguration basicConfiguration = new MyConfiguration();
- PropertiesConfiguration config = new PropertiesConfiguration();
- final String type = (String) getAttribute(TYPE);
- config.addProperty("type", type);
- VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
- if(factory != null)
- {
- for(Map.Entry<String,Object> entry : factory.createVirtualHostConfiguration(this).entrySet())
- {
- config.addProperty(entry.getKey(), entry.getValue());
- }
- }
- basicConfiguration.addConfiguration(config);
-
- CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
- compositeConfiguration.addConfiguration(new SystemConfiguration());
- compositeConfiguration.addConfiguration(basicConfiguration);
- configuration = new VirtualHostConfiguration(virtualHostName, compositeConfiguration , _broker);
- }
- else
- {
- if (!new File(configurationFile).exists())
- {
- throw new IllegalConfigurationException("Configuration file '" + configurationFile + "' does not exist");
- }
- configuration = new VirtualHostConfiguration(virtualHostName, new File(configurationFile) , _broker);
- String type = configuration.getType();
- changeAttribute(TYPE,null,type);
- VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
- if(factory != null)
- {
- for(Map.Entry<String,Object> entry : factory.convertVirtualHostConfiguration(configuration.getConfig()).entrySet())
- {
- changeAttribute(entry.getKey(), getAttribute(entry.getKey()), entry.getValue());
- }
- }
-
- }
- return configuration;
- }
-
- @Override
- public SecurityManager getSecurityManager()
- {
- return _virtualHost.getSecurityManager();
- }
-
- @Override
- public MessageStore getMessageStore()
- {
- return _virtualHost.getMessageStore();
- }
-
- @Override
- protected void changeAttributes(Map<String, Object> attributes)
- {
- throw new UnsupportedOperationException("Changing attributes on virtualhosts is not supported.");
- }
-
- @Override
- protected void authoriseSetDesiredState(State currentState, State desiredState) throws AccessControlException
- {
- if(desiredState == State.DELETED)
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.DELETE))
- {
- throw new AccessControlException("Deletion of virtual host is denied");
- }
- }
- }
-
- @Override
- protected void authoriseSetAttribute(String name, Object expected, Object desired) throws AccessControlException
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of virtual host attributes is denied");
- }
- }
-
- @Override
- protected void authoriseSetAttributes(Map<String, Object> attributes) throws AccessControlException
- {
- if (!_broker.getSecurityManager().authoriseConfiguringBroker(getName(), VirtualHost.class, Operation.UPDATE))
- {
- throw new AccessControlException("Setting of virtual host attributes is denied");
- }
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java
deleted file mode 100644
index e183370870..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/AuthenticationManagerFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.server.plugin;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-
-public interface AuthenticationManagerFactory extends Pluggable
-{
- public static final String ATTRIBUTE_TYPE = AuthenticationProvider.TYPE;
-
- /**
- * Returns the authentication provider type
- * @return authentication provider type
- */
- String getType();
-
- /**
- * Creates authentication manager from the provided attributes
- *
- * @param attributes
- * attributes to create authentication manager
- * @return authentication manager instance
- */
- AuthenticationManager createInstance(Map<String, Object> attributes);
-
- /**
- * Get the names of attributes the authentication manager which can be passed into {@link #createInstance(Map)} to create the
- * authentication manager
- *
- * @return the collection of attribute names
- */
- Collection<String> getAttributeNames();
-
- /**
- * @return returns human readable descriptions for the attributes
- */
- Map<String, String> getAttributeDescriptions();
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java
deleted file mode 100644
index 5a95b88591..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.qpid.server.plugin;
-
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.PreferencesProvider;
-
-public interface PreferencesProviderFactory extends Pluggable
-{
- PreferencesProvider createInstance(UUID id, Map<String, Object> attributes, AuthenticationProvider authenticationProvider);
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java
deleted file mode 100644
index 5d427c4afb..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractPrincipalDatabaseAuthManagerFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-
-/**
- * Factory for {@link PrincipalDatabaseAuthenticationManager} objects configured
- * with either the Plain or Base64MD5 digest {@link PrincipalDatabase}
- * implementation.
- */
-public abstract class AbstractPrincipalDatabaseAuthManagerFactory implements AuthenticationManagerFactory
-{
- public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.PasswordFileAuthenticationProviderAttributeDescriptions";
- public static final String ATTRIBUTE_PATH = "path";
-
- private static final Logger LOGGER = Logger.getLogger(AbstractPrincipalDatabaseAuthManagerFactory.class);
-
- public static final Collection<String> ATTRIBUTES = Collections.unmodifiableList(Arrays.asList(
- ATTRIBUTE_TYPE,
- ATTRIBUTE_PATH));
-
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (attributes == null || !getType().equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- return null;
- }
-
- String passwordFile = (String) attributes.get(ATTRIBUTE_PATH);
- if (passwordFile == null)
- {
- LOGGER.warn("Password file path must not be null");
- return null;
- }
-
- PrincipalDatabase principalDatabase = createPrincipalDatabase();
- return new PrincipalDatabaseAuthenticationManager(principalDatabase, passwordFile);
- }
-
- abstract PrincipalDatabase createPrincipalDatabase();
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return ATTRIBUTES;
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java
deleted file mode 100644
index 91aba71720..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-
-public class AnonymousAuthenticationManagerFactory implements AuthenticationManagerFactory
-{
- public static final String PROVIDER_TYPE = "Anonymous";
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- return new AnonymousAuthenticationManager();
- }
- return null;
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return Collections.<String>singletonList(ATTRIBUTE_TYPE);
- }
-
- @Override
- public String getType()
- {
- return PROVIDER_TYPE;
- }
-
- @Override
- public Map<String, String> getAttributeDescriptions()
- {
- return null;
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java
deleted file mode 100644
index 6029674cd3..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.util.ResourceBundleLoader;
-
-public class ExternalAuthenticationManagerFactory implements AuthenticationManagerFactory
-{
- public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.ExternalAuthenticationProviderAttributeDescriptions";
- public static final String PROVIDER_TYPE = "External";
- public static final String ATTRIBUTE_USE_FULL_DN = "useFullDN";
-
- public static final Collection<String> ATTRIBUTES = Collections.<String> unmodifiableList(Arrays.asList(
- ATTRIBUTE_TYPE,
- ATTRIBUTE_USE_FULL_DN));
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- boolean useFullDN = Boolean.valueOf(String.valueOf(attributes.get(ATTRIBUTE_USE_FULL_DN)));
-
- return new ExternalAuthenticationManager(useFullDN);
- }
- return null;
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return ATTRIBUTES;
- }
-
- @Override
- public String getType()
- {
- return PROVIDER_TYPE;
- }
-
- @Override
- public Map<String, String> getAttributeDescriptions()
- {
- return ResourceBundleLoader.getResources(RESOURCE_BUNDLE);
- }
-
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java
deleted file mode 100644
index a2d5bd4c8e..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-
-public class KerberosAuthenticationManagerFactory implements AuthenticationManagerFactory
-{
- public static final String PROVIDER_TYPE = "Kerberos";
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (attributes != null && PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- return new KerberosAuthenticationManager();
- }
- return null;
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return Collections.<String>singletonList(ATTRIBUTE_TYPE);
- }
-
- @Override
- public String getType()
- {
- return PROVIDER_TYPE;
- }
-
- @Override
- public Map<String, String> getAttributeDescriptions()
- {
- return null;
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java
deleted file mode 100644
index 0db0d388d6..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.qpid.server.security.auth.manager;
-
-import java.io.IOException;
-import java.security.Principal;
-import java.util.Hashtable;
-
-import javax.naming.AuthenticationException;
-import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.AuthorizeCallback;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.security.auth.AuthenticationResult;
-import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
-import org.apache.qpid.server.security.auth.UsernamePrincipal;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainPasswordCallback;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainSaslServer;
-
-public class SimpleLDAPAuthenticationManager implements AuthenticationManager
-{
- private static final Logger _logger = Logger.getLogger(SimpleLDAPAuthenticationManager.class);
-
- private final String _providerSearchURL;
- private final String _providerAuthURL;
- private final String _searchContext;
- private final String _searchFilter;
- private final String _ldapContextFactory;
-
- SimpleLDAPAuthenticationManager(String providerSearchUrl, String providerAuthUrl, String searchContext, String searchFilter, String ldapContextFactory)
- {
- _providerSearchURL = providerSearchUrl;
- _providerAuthURL = providerAuthUrl;
- _searchContext = searchContext;
- _searchFilter = searchFilter;
- _ldapContextFactory = ldapContextFactory;
- }
-
- @Override
- public void initialise()
- {
- validateInitialDirContext();
- }
-
- @Override
- public String getMechanisms()
- {
- return PlainSaslServer.MECHANISM;
- }
-
- @Override
- public SaslServer createSaslServer(String mechanism, String localFQDN, Principal externalPrincipal) throws SaslException
- {
- if(PlainSaslServer.MECHANISM.equals(mechanism))
- {
- return new PlainSaslServer(new SimpleLDAPPlainCallbackHandler());
- }
- else
- {
- throw new SaslException("Unknown mechanism: " + mechanism);
- }
- }
-
- @Override
- public AuthenticationResult authenticate(SaslServer server, byte[] response)
- {
- try
- {
- // Process response from the client
- byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);
-
- if (server.isComplete())
- {
- String authorizationID = server.getAuthorizationID();
- _logger.debug("Authenticated as " + authorizationID);
-
- return new AuthenticationResult(new UsernamePrincipal(authorizationID));
- }
- else
- {
- return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
- }
- }
- catch (SaslException e)
- {
- return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
- }
- }
-
- @Override
- public AuthenticationResult authenticate(String username, String password)
- {
- try
- {
- AuthenticationResult result = doLDAPNameAuthentication(getNameFromId(username), password);
- if(result.getStatus() == AuthenticationStatus.SUCCESS)
- {
- //Return a result based on the supplied username rather than the search name
- return new AuthenticationResult(new UsernamePrincipal(username));
- }
- else
- {
- return result;
- }
- }
- catch (NamingException e)
- {
- return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
- }
- }
-
- private AuthenticationResult doLDAPNameAuthentication(String name, String password)
- {
- if(name == null)
- {
- //The search didn't return anything, class as not-authenticated before it NPEs below
- return new AuthenticationResult(AuthenticationStatus.CONTINUE);
- }
-
- Hashtable<Object,Object> env = new Hashtable<Object,Object>();
- env.put(Context.INITIAL_CONTEXT_FACTORY, _ldapContextFactory);
- env.put(Context.PROVIDER_URL, _providerAuthURL);
-
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
-
- env.put(Context.SECURITY_PRINCIPAL, name);
- env.put(Context.SECURITY_CREDENTIALS, password);
-
- DirContext ctx = null;
- try
- {
- ctx = new InitialDirContext(env);
-
- //Authentication succeeded
- return new AuthenticationResult(new UsernamePrincipal(name));
- }
- catch(AuthenticationException ae)
- {
- //Authentication failed
- return new AuthenticationResult(AuthenticationStatus.CONTINUE);
- }
- catch (NamingException e)
- {
- //Some other failure
- return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
- }
- finally
- {
- if(ctx != null)
- {
- try
- {
- ctx.close();
- }
- catch (Exception e)
- {
- _logger.warn("Exception closing InitialDirContext", e);
- }
- }
- }
- }
-
- @Override
- public void close()
- {
- }
-
- private void validateInitialDirContext()
- {
- Hashtable<String,Object> env = new Hashtable<String, Object>();
- env.put(Context.INITIAL_CONTEXT_FACTORY, _ldapContextFactory);
- env.put(Context.PROVIDER_URL, _providerSearchURL);
- env.put(Context.SECURITY_AUTHENTICATION, "none");
-
- try
- {
- new InitialDirContext(env).close();
- }
- catch (NamingException e)
- {
- throw new RuntimeException("Unable to establish anonymous connection to the ldap server at " + _providerSearchURL, e);
- }
- }
-
- private class SimpleLDAPPlainCallbackHandler implements CallbackHandler
- {
-
- @Override
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- String name = null;
- String password = null;
- AuthenticationResult authenticated = null;
- for(Callback callback : callbacks)
- {
- if (callback instanceof NameCallback)
- {
- String id = ((NameCallback) callback).getDefaultName();
- try
- {
- name = getNameFromId(id);
- }
- catch (NamingException e)
- {
- _logger.warn("SASL Authentication Exception", e);
- }
- if(password != null)
- {
- authenticated = doLDAPNameAuthentication(name, password);
- }
- }
- else if (callback instanceof PlainPasswordCallback)
- {
- password = ((PlainPasswordCallback)callback).getPlainPassword();
- if(name != null)
- {
- authenticated = doLDAPNameAuthentication(name, password);
- if(authenticated.getStatus()== AuthenticationResult.AuthenticationStatus.SUCCESS)
- {
- ((PlainPasswordCallback)callback).setAuthenticated(true);
- }
- }
- }
- else if (callback instanceof AuthorizeCallback)
- {
- ((AuthorizeCallback) callback).setAuthorized(authenticated != null && authenticated.getStatus() == AuthenticationResult.AuthenticationStatus.SUCCESS);
- }
- else
- {
- throw new UnsupportedCallbackException(callback);
- }
- }
- }
- }
-
- private String getNameFromId(String id) throws NamingException
- {
- Hashtable<Object,Object> env = new Hashtable<Object,Object>();
- env.put(Context.INITIAL_CONTEXT_FACTORY, _ldapContextFactory);
- env.put(Context.PROVIDER_URL, _providerSearchURL);
-
- env.put(Context.SECURITY_AUTHENTICATION, "none");
- DirContext ctx = null;
-
- ctx = new InitialDirContext(env);
-
- try
- {
- SearchControls searchControls = new SearchControls();
- searchControls.setReturningAttributes(new String[] {});
- searchControls.setCountLimit(1l);
- searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
- NamingEnumeration<?> namingEnum = null;
- String name = null;
-
- namingEnum = ctx.search(_searchContext, _searchFilter, new String[] { id }, searchControls);
- if(namingEnum.hasMore())
- {
- SearchResult result = (SearchResult) namingEnum.next();
- name = result.getNameInNamespace();
- }
- return name;
- }
- finally
- {
- try
- {
- ctx.close();
- }
- catch (Exception e)
- {
- _logger.warn("Exception closing InitialDirContext", e);
- }
- }
-
- }
-
- @Override
- public void onCreate()
- {
- // nothing to do, no external resource is required
- }
-
- @Override
- public void onDelete()
- {
- // nothing to do, no external resource is used
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java
deleted file mode 100644
index 55e90178f8..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.util.ResourceBundleLoader;
-
-public class SimpleLDAPAuthenticationManagerFactory implements AuthenticationManagerFactory
-{
- public static final String RESOURCE_BUNDLE = "org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationProviderAttributeDescriptions";
- private static final String DEFAULT_LDAP_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory";
-
- public static final String PROVIDER_TYPE = "SimpleLDAP";
-
- public static final String ATTRIBUTE_LDAP_CONTEXT_FACTORY = "ldapContextFactory";
- public static final String ATTRIBUTE_SEARCH_FILTER = "searchFilter";
- public static final String ATTRIBUTE_SEARCH_CONTEXT = "searchContext";
- public static final String ATTRIBUTE_PROVIDER_AUTH_URL = "providerAuthUrl";
- public static final String ATTRIBUTE_PROVIDER_URL = "providerUrl";
-
- public static final Collection<String> ATTRIBUTES = Collections.<String> unmodifiableList(Arrays.asList(
- ATTRIBUTE_TYPE,
- ATTRIBUTE_PROVIDER_URL,
- ATTRIBUTE_SEARCH_CONTEXT,
- ATTRIBUTE_SEARCH_FILTER,
- ATTRIBUTE_PROVIDER_AUTH_URL,
- ATTRIBUTE_LDAP_CONTEXT_FACTORY
- ));
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (attributes == null || !PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- return null;
- }
- String providerUrl = (String) attributes.get(ATTRIBUTE_PROVIDER_URL);
- String providerAuthUrl = (String) attributes.get(ATTRIBUTE_PROVIDER_AUTH_URL);
- if (providerAuthUrl == null)
- {
- providerAuthUrl = providerUrl;
- }
- String searchContext = (String) attributes.get(ATTRIBUTE_SEARCH_CONTEXT);
- String searchFilter = (String) attributes.get(ATTRIBUTE_SEARCH_FILTER);
- String ldapContextFactory = (String) attributes.get(ATTRIBUTE_LDAP_CONTEXT_FACTORY);
- if (ldapContextFactory == null)
- {
- ldapContextFactory = DEFAULT_LDAP_CONTEXT_FACTORY;
- }
-
- return new SimpleLDAPAuthenticationManager(providerUrl, providerAuthUrl, searchContext, searchFilter,
- ldapContextFactory);
- }
-
- @Override
- public Collection<String> getAttributeNames()
- {
- return ATTRIBUTES;
- }
-
- @Override
- public String getType()
- {
- return PROVIDER_TYPE;
- }
-
- @Override
- public Map<String, String> getAttributeDescriptions()
- {
- return ResourceBundleLoader.getResources(RESOURCE_BUNDLE);
- }
-}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties
deleted file mode 100644
index 5439c7fff5..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationProviderAttributeDescriptions.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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.
-
-ldapContextFactory= LDAP context factory
-searchFilter=Search filter*
-searchContext=Search context*
-providerAuthUrl=LDAP authentication URL
-providerUrl=LDAP server URL* \ No newline at end of file
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/StringUtil.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/util/StringUtil.java
deleted file mode 100644
index aa17a9493b..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/StringUtil.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.Random;
-
-public class StringUtil
-{
- private static final String NUMBERS = "0123456789";
- private static final String LETTERS = "abcdefghijklmnopqrstuvwxwy";
- private static final String OTHERS = "_-";
- private static final char[] CHARACTERS = (NUMBERS + LETTERS + LETTERS.toUpperCase() + OTHERS).toCharArray();
-
- private Random _random = new Random();
-
- public String randomAlphaNumericString(int maxLength)
- {
- char[] result = new char[maxLength];
- for (int i = 0; i < maxLength; i++)
- {
- result[i] = (char) CHARACTERS[_random.nextInt(CHARACTERS.length)];
- }
- return new String(result);
- }
-
-}
diff --git a/qpid/java/broker/src/main/resources/initial-config.json b/qpid/java/broker/src/main/resources/initial-config.json
deleted file mode 100644
index a203190c4b..0000000000
--- a/qpid/java/broker/src/main/resources/initial-config.json
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * 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.
- *
- */
-{
- "name": "Broker",
- "storeVersion": 1,
- "modelVersion": "1.1",
- "defaultVirtualHost" : "default",
- "authenticationproviders" : [ {
- "name" : "passwordFile",
- "type" : "PlainPasswordFile",
- "path" : "${qpid.home_dir}/etc/passwd",
- "preferencesproviders" : [{
- "name": "fileSystemPreferences",
- "type": "FileSystemPreferences",
- "path" : "${qpid.work_dir}/preferences/passwordFile"
- }]
- } ],
- "ports" : [ {
- "name" : "AMQP",
- "port" : "${qpid.amqp_port}",
- "authenticationProvider" : "passwordFile"
- }, {
- "name" : "HTTP",
- "port" : "${qpid.http_port}",
- "authenticationProvider" : "passwordFile",
- "protocols" : [ "HTTP" ]
- }, {
- "name" : "RMI_REGISTRY",
- "port" : "${qpid.rmi_port}",
- "protocols" : [ "RMI" ]
- }, {
- "name" : "JMX_CONNECTOR",
- "port" : "${qpid.jmx_port}",
- "authenticationProvider" : "passwordFile",
- "protocols" : [ "JMX_RMI" ]
- }],
- "virtualhosts" : [ {
- "name" : "default",
- "type" : "STANDARD",
- "storeType" : "DERBY",
- "storePath" : "${qpid.work_dir}/derbystore/default"
- } ],
- "plugins" : [ {
- "pluginType" : "MANAGEMENT-HTTP",
- "name" : "httpManagement"
- }, {
- "pluginType" : "MANAGEMENT-JMX",
- "name" : "jmxManagement"
- } ]
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
deleted file mode 100644
index c10b3410a5..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration;
-
-import static org.mockito.Mockito.when;
-
-import java.util.Collections;
-import junit.framework.TestCase;
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.util.BrokerTestHelper;
-
-public class QueueConfigurationTest extends TestCase
-{
- private VirtualHostConfiguration _emptyConf;
- private PropertiesConfiguration _env;
- private VirtualHostConfiguration _fullHostConf;
- private Broker _broker;
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- BrokerTestHelper.setUp();
- _broker = BrokerTestHelper.createBrokerMock();
- _env = new PropertiesConfiguration();
- _emptyConf = new VirtualHostConfiguration("test", _env, _broker);
-
- PropertiesConfiguration fullEnv = new PropertiesConfiguration();
- fullEnv.setProperty("queues.maximumMessageAge", 1);
- fullEnv.setProperty("queues.maximumQueueDepth", 1);
- fullEnv.setProperty("queues.maximumMessageSize", 1);
- fullEnv.setProperty("queues.maximumMessageCount", 1);
- fullEnv.setProperty("queues.minimumAlertRepeatGap", 1);
- fullEnv.setProperty("queues.deadLetterQueues", true);
- fullEnv.setProperty("queues.maximumDeliveryCount", 5);
-
- _fullHostConf = new VirtualHostConfiguration("test", fullEnv, _broker);
-
- }
-
- @Override
- public void tearDown() throws Exception
- {
- BrokerTestHelper.tearDown();
- super.tearDown();
- }
-
- public void testMaxDeliveryCount() throws Exception
- {
- // broker MAXIMUM_DELIVERY_ATTEMPTS attribute is not set
- when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(null);
-
- // Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals("Unexpected default server configuration for max delivery count ", 0, qConf.getMaxDeliveryCount());
-
- // set broker MAXIMUM_DELIVERY_ATTEMPTS attribute to 2
- when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(2);
-
- // Check that queue inherits the MAXIMUM_DELIVERY_ATTEMPTS value from broker
- qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals("Unexpected default server configuration for max delivery count ", 2, qConf.getMaxDeliveryCount());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumDeliveryCount", 7);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals("Unexpected host configuration for max delivery count", 7, qConf.getMaxDeliveryCount());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals("Unexpected queue configuration for max delivery count", 5, qConf.getMaxDeliveryCount());
- }
-
- /**
- * Tests that the default setting for DLQ configuration is disabled, and verifies that it can be overridden
- * at a broker or virtualhost level.
- * @throws Exception
- */
- public void testIsDeadLetterQueueEnabled() throws Exception
- {
- // enable dead letter queues broker wide
- when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
-
- // Check that queue inherits the broker setting
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
-
- // broker DEAD_LETTER_QUEUE_ENABLED is not set
- when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(null);
-
- // Check that queue dead letter queue is not enabled
- qConf = new QueueConfiguration("test", _emptyConf);
- assertFalse("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("deadLetterQueues", true);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
- }
-
- public void testGetMaximumMessageAge() throws ConfigurationException
- {
- // Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(0, qConf.getMaximumMessageAge());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageAge", 2);
-
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getMaximumMessageAge());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals(1, qConf.getMaximumMessageAge());
- }
-
- public void testGetMaximumQueueDepth() throws ConfigurationException
- {
- // Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(0, qConf.getMaximumQueueDepth());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumQueueDepth", 2);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getMaximumQueueDepth());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals(1, qConf.getMaximumQueueDepth());
- }
-
- public void testGetMaximumMessageSize() throws ConfigurationException
- {
- // Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(0, qConf.getMaximumMessageSize());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageSize", 2);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getMaximumMessageSize());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals(1, qConf.getMaximumMessageSize());
- }
-
- public void testGetMaximumMessageCount() throws ConfigurationException
- {
- // Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(0, qConf.getMaximumMessageCount());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("maximumMessageCount", 2);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getMaximumMessageCount());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals(1, qConf.getMaximumMessageCount());
- }
-
- public void testGetMinimumAlertRepeatGap() throws Exception
- {
- // set broker attribute ALERT_REPEAT_GAP to 10
- when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(10);
-
- // check that broker level setting is available on queue configuration
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(10, qConf.getMinimumAlertRepeatGap());
-
- // remove configuration for ALERT_REPEAT_GAP on broker level
- when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(null);
-
- // Check default value
- qConf = new QueueConfiguration("test", _emptyConf);
- assertEquals(0, qConf.getMinimumAlertRepeatGap());
-
- // Check explicit value
- VirtualHostConfiguration vhostConfig = overrideConfiguration("minimumAlertRepeatGap", 2);
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getMinimumAlertRepeatGap());
-
- // Check inherited value
- qConf = new QueueConfiguration("test", _fullHostConf);
- assertEquals(1, qConf.getMinimumAlertRepeatGap());
- }
-
- public void testSortQueueConfiguration() throws ConfigurationException
- {
- //Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertNull(qConf.getQueueSortKey());
-
- // Check explicit value
- final VirtualHostConfiguration vhostConfig = overrideConfiguration("sortKey", "test-sort-key");
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals("test-sort-key", qConf.getQueueSortKey());
- }
-
- public void testQueueDescription() throws ConfigurationException
- {
- //Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertNull(qConf.getDescription());
-
- // Check explicit value
- final VirtualHostConfiguration vhostConfig = overrideConfiguration("description", "mydescription");
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals("mydescription", qConf.getDescription());
- }
-
-
- public void testQueueSingleArgument() throws ConfigurationException
- {
- //Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertTrue(qConf.getArguments().isEmpty());
-
- // Check explicit value
- final VirtualHostConfiguration vhostConfig = overrideConfiguration("argument", "qpid.group_header_key=mykey");
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(Collections.singletonMap("qpid.group_header_key","mykey"), qConf.getArguments());
- }
-
-
- public void testQueueMultipleArguments() throws ConfigurationException
- {
- //Check default value
- QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
- assertTrue(qConf.getArguments().isEmpty());
-
-
- PropertiesConfiguration queueConfig = new PropertiesConfiguration();
- queueConfig.addProperty("queues.queue.test.argument", "qpid.group_header_key=mykey");
- queueConfig.addProperty("queues.queue.test.argument", "qpid.shared_msg_group=1");
-
- CompositeConfiguration config = new CompositeConfiguration();
- config.addConfiguration(_fullHostConf.getConfig());
- config.addConfiguration(queueConfig);
-
- final VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration("test", config, _broker);;
- qConf = new QueueConfiguration("test", vhostConfig);
- assertEquals(2, qConf.getArguments().size());
- assertEquals("mykey", qConf.getArguments().get("qpid.group_header_key"));
- assertEquals("1", qConf.getArguments().get("qpid.shared_msg_group"));
- }
-
-
- private VirtualHostConfiguration overrideConfiguration(String property, Object value)
- throws ConfigurationException
- {
- PropertiesConfiguration queueConfig = new PropertiesConfiguration();
- queueConfig.setProperty("queues.queue.test." + property, value);
-
- CompositeConfiguration config = new CompositeConfiguration();
- config.addConfiguration(_fullHostConf.getConfig());
- config.addConfiguration(queueConfig);
-
- return new VirtualHostConfiguration("test", config, _broker);
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java
deleted file mode 100644
index eed54ef5bf..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/AuthenticationProviderRecovererTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.startup;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
-import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory;
-import org.apache.qpid.server.util.BrokerTestHelper;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.test.utils.TestFileUtils;
-
-public class AuthenticationProviderRecovererTest extends QpidTestCase
-{
- private Broker _broker;
- private AuthenticationProviderRecoverer _recoverer;
- private ConfigurationEntryStore _configurationStore;
- private PreferencesProviderCreator _preferencesProviderCreator;
-
- public void setUp() throws Exception
- {
- super.setUp();
- BrokerTestHelper.setUp();
- _broker = BrokerTestHelper.createBrokerMock();
- _preferencesProviderCreator = new PreferencesProviderCreator();
- QpidServiceLoader<AuthenticationManagerFactory> serviceLoader = new QpidServiceLoader<AuthenticationManagerFactory>();
- AuthenticationProviderFactory authenticationProviderFactory = new AuthenticationProviderFactory(serviceLoader, _preferencesProviderCreator);
- StoreConfigurationChangeListener storeChangeListener = mock(StoreConfigurationChangeListener.class);
- _recoverer = new AuthenticationProviderRecoverer(authenticationProviderFactory, storeChangeListener);
- _configurationStore = mock(ConfigurationEntryStore.class);
- }
-
- public void tearDown() throws Exception
- {
- try
- {
- BrokerTestHelper.tearDown();
- }
- finally
- {
- super.tearDown();
- }
- }
-
- public void testRecoverAuthenticationProviderWithPreferencesProvider()
- {
- File authenticationProviderFile = TestFileUtils.createTempFile(this, "test-authenticator.txt", "test_user:test_user");
- try
- {
- Map<String, Object> authenticationAttributes = new HashMap<String, Object>();
- authenticationAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE,
- PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
- authenticationAttributes.put(AuthenticationProvider.NAME, "test-authenticator");
- authenticationAttributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH,
- authenticationProviderFile.getAbsolutePath());
- UUID authenticationId = UUID.randomUUID();
-
- final PreferencesProviderRecoverer preferencesRecoverer = new PreferencesProviderRecoverer(_preferencesProviderCreator);
- RecovererProvider recovererProvider = new RecovererProvider()
- {
- @Override
- public ConfiguredObjectRecoverer<? extends ConfiguredObject> getRecoverer(String type)
- {
- return preferencesRecoverer;
- }
- };
-
- Map<String, Object> preferencesAttributes = new HashMap<String, Object>();
- UUID preferencesId = UUID.randomUUID();
- preferencesAttributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.class);
- preferencesAttributes.put(PreferencesProvider.NAME, "test-provider");
- File file = TestFileUtils.createTempFile(this, ".prefs.json",
- "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
- preferencesAttributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
- ConfigurationEntry preferencesEntry = new ConfigurationEntry(preferencesId, PreferencesProvider.class.getSimpleName(),
- preferencesAttributes, Collections.<UUID> emptySet(), _configurationStore);
- when(_configurationStore.getEntry(preferencesId)).thenReturn(preferencesEntry);
-
- ConfigurationEntry authenticationProviderEntry = new ConfigurationEntry(authenticationId,
- AuthenticationProvider.class.getSimpleName(), authenticationAttributes, Collections.singleton(preferencesId),
- _configurationStore);
- try
- {
- AuthenticationProvider authenticationProvider = _recoverer.create(recovererProvider, authenticationProviderEntry,
- _broker);
- assertNotNull("Authentication provider was not recovered", authenticationProvider);
- assertEquals("Unexpected name", "test-authenticator", authenticationProvider.getName());
- assertEquals("Unexpected id", authenticationId, authenticationProvider.getId());
- PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
- assertNotNull("Preferences provider was not recovered", preferencesProvider);
- assertEquals("Unexpected path", file.getAbsolutePath(),
- preferencesProvider.getAttribute(FileSystemPreferencesProvider.PATH));
- }
- finally
- {
- file.delete();
- }
- }
- finally
- {
- authenticationProviderFile.delete();
- }
- }
-
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
deleted file mode 100644
index e6db5af222..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.startup;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.BrokerOptions;
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.logging.LogRecorder;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.GroupProvider;
-import org.apache.qpid.server.model.KeyStore;
-import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.Plugin;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.adapter.AccessControlProviderFactory;
-import org.apache.qpid.server.model.adapter.AuthenticationProviderFactory;
-import org.apache.qpid.server.model.adapter.GroupProviderFactory;
-import org.apache.qpid.server.model.adapter.PortFactory;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class BrokerRecovererTest extends TestCase
-{
- private BrokerRecoverer _brokerRecoverer;
- private ConfigurationEntry _brokerEntry = mock(ConfigurationEntry.class);
-
- private UUID _brokerId = UUID.randomUUID();
- private Map<String, Collection<ConfigurationEntry>> _brokerEntryChildren = new HashMap<String, Collection<ConfigurationEntry>>();
- private ConfigurationEntry _authenticationProviderEntry1;
- private AuthenticationProvider _authenticationProvider1;
- private UUID _authenticationProvider1Id = UUID.randomUUID();
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _brokerRecoverer = new BrokerRecoverer(mock(AuthenticationProviderFactory.class), mock(GroupProviderFactory.class), mock(AccessControlProviderFactory.class), mock(PortFactory.class),
- mock(PreferencesProviderCreator.class),
- mock(StatisticsGatherer.class), mock(VirtualHostRegistry.class), mock(LogRecorder.class), mock(RootMessageLogger.class), mock(TaskExecutor.class), mock(BrokerOptions.class),
- mock(StoreConfigurationChangeListener.class));
- when(_brokerEntry.getId()).thenReturn(_brokerId);
- when(_brokerEntry.getChildren()).thenReturn(_brokerEntryChildren);
- when(_brokerEntry.getAttributes()).thenReturn(Collections.<String, Object>singletonMap(Broker.MODEL_VERSION, Model.MODEL_VERSION));
-
- //Add a base AuthenticationProvider for all tests
- _authenticationProvider1 = mock(AuthenticationProvider.class);
- when(_authenticationProvider1.getName()).thenReturn("authenticationProvider1");
- when(_authenticationProvider1.getId()).thenReturn(_authenticationProvider1Id);
- _authenticationProviderEntry1 = mock(ConfigurationEntry.class);
- _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1));
- }
-
- public void testCreateBrokerAttributes()
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9l);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6l);
- attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5l);
- attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5l);
- attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3l);
- attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
- attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
- attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1l);
- attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
- attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
- attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
- attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
- attributes.put(Broker.MODEL_VERSION, Model.MODEL_VERSION);
-
- Map<String, Object> entryAttributes = new HashMap<String, Object>();
- for (Map.Entry<String, Object> attribute : attributes.entrySet())
- {
- String value = convertToString(attribute.getValue());
- entryAttributes.put(attribute.getKey(), value);
- }
-
- when(_brokerEntry.getAttributes()).thenReturn(entryAttributes);
-
- final ConfigurationEntry virtualHostEntry = mock(ConfigurationEntry.class);
- String typeName = VirtualHost.class.getSimpleName();
- when(virtualHostEntry.getType()).thenReturn(typeName);
- _brokerEntryChildren.put(typeName, Arrays.asList(virtualHostEntry));
- final VirtualHost virtualHost = mock(VirtualHost.class);
- when(virtualHost.getName()).thenReturn("test");
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[] { virtualHostEntry, _authenticationProviderEntry1 },
- new ConfiguredObject[] { virtualHost, _authenticationProvider1 });
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
-
- for (Map.Entry<String, Object> attribute : attributes.entrySet())
- {
- Object attributeValue = broker.getAttribute(attribute.getKey());
- assertEquals("Unexpected value of attribute '" + attribute.getKey() + "'", attribute.getValue(), attributeValue);
- }
- }
-
- public void testCreateBrokerWithVirtualHost()
- {
- final ConfigurationEntry virtualHostEntry = mock(ConfigurationEntry.class);
-
- String typeName = VirtualHost.class.getSimpleName();
- when(virtualHostEntry.getType()).thenReturn(typeName);
- _brokerEntryChildren.put(typeName, Arrays.asList(virtualHostEntry));
-
- final VirtualHost virtualHost = mock(VirtualHost.class);
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{virtualHostEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{virtualHost, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(1, broker.getVirtualHosts().size());
- assertEquals(virtualHost, broker.getVirtualHosts().iterator().next());
- }
-
- public void testCreateBrokerWithPorts()
- {
- ConfigurationEntry portEntry = mock(ConfigurationEntry.class);
- Port port = mock(Port.class);
- _brokerEntryChildren.put(Port.class.getSimpleName(), Arrays.asList(portEntry));
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{portEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{port, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singletonList(port), broker.getPorts());
- }
-
- public void testCreateBrokerWithOneAuthenticationProvider()
- {
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{_authenticationProviderEntry1},
- new ConfiguredObject[]{_authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singletonList(_authenticationProvider1), broker.getAuthenticationProviders());
- }
-
- public void testCreateBrokerWithMultipleAuthenticationProvidersAndPorts()
- {
- //Create a second authentication provider
- AuthenticationProvider authenticationProvider2 = mock(AuthenticationProvider.class);
- when(authenticationProvider2.getName()).thenReturn("authenticationProvider2");
- ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
- _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));
-
- //Add a couple ports
- ConfigurationEntry portEntry1 = mock(ConfigurationEntry.class);
- Port port1 = mock(Port.class);
- when(port1.getId()).thenReturn(UUIDGenerator.generateRandomUUID());
- when(port1.getName()).thenReturn("port1");
- when(port1.getPort()).thenReturn(5671);
- when(port1.getAttribute(Port.AUTHENTICATION_PROVIDER)).thenReturn("authenticationProvider1");
- ConfigurationEntry portEntry2 = mock(ConfigurationEntry.class);
- Port port2 = mock(Port.class);
- when(port2.getId()).thenReturn(UUIDGenerator.generateRandomUUID());
- when(port2.getName()).thenReturn("port2");
- when(port2.getPort()).thenReturn(5672);
- when(port2.getAttribute(Port.AUTHENTICATION_PROVIDER)).thenReturn("authenticationProvider2");
- _brokerEntryChildren.put(Port.class.getSimpleName(), Arrays.asList(portEntry1, portEntry2));
-
- RecovererProvider recovererProvider = createRecoveryProvider(
- new ConfigurationEntry[]{portEntry1, portEntry2, authenticationProviderEntry2, _authenticationProviderEntry1},
- new ConfiguredObject[]{port1, port2, authenticationProvider2, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals("Unexpected number of authentication providers", 2, broker.getAuthenticationProviders().size());
-
- Collection<Port> ports = broker.getPorts();
- assertEquals("Unexpected number of ports", 2, ports.size());
- assertTrue(ports.contains(port1));
- assertTrue(ports.contains(port2));
- }
-
- public void testCreateBrokerWithGroupProvider()
- {
- ConfigurationEntry groupProviderEntry = mock(ConfigurationEntry.class);
- GroupProvider groupProvider = mock(GroupProvider.class);
- _brokerEntryChildren.put(GroupProvider.class.getSimpleName(), Arrays.asList(groupProviderEntry));
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{groupProviderEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{groupProvider, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singletonList(groupProvider), broker.getGroupProviders());
- }
-
- public void testCreateBrokerWithPlugins()
- {
- ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
- Plugin plugin = mock(Plugin.class);
- _brokerEntryChildren.put(Plugin.class.getSimpleName(), Arrays.asList(pluginEntry));
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{plugin, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singleton(plugin), new HashSet<ConfiguredObject>(broker.getChildren(Plugin.class)));
- }
-
- public void testCreateBrokerWithKeyStores()
- {
- ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
- KeyStore keyStore = mock(KeyStore.class);
- _brokerEntryChildren.put(KeyStore.class.getSimpleName(), Arrays.asList(pluginEntry));
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{keyStore, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singleton(keyStore), new HashSet<ConfiguredObject>(broker.getChildren(KeyStore.class)));
- }
-
- public void testCreateBrokerWithTrustStores()
- {
- ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
- TrustStore trustStore = mock(TrustStore.class);
- _brokerEntryChildren.put(TrustStore.class.getSimpleName(), Arrays.asList(pluginEntry));
-
- RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
- new ConfiguredObject[]{trustStore, _authenticationProvider1});
-
- Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
- assertNotNull(broker);
- assertEquals(_brokerId, broker.getId());
- assertEquals(Collections.singleton(trustStore), new HashSet<ConfiguredObject>(broker.getChildren(TrustStore.class)));
- }
-
- public void testModelVersionValidationForIncompatibleMajorVersion() throws Exception
- {
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- String[] incompatibleVersions = {Integer.MAX_VALUE + "." + 0, "0.0"};
- for (String incompatibleVersion : incompatibleVersions)
- {
- brokerAttributes.put(Broker.MODEL_VERSION, incompatibleVersion);
- when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
-
- try
- {
- _brokerRecoverer.create(null, _brokerEntry);
- fail("The broker creation should fail due to unsupported model version");
- }
- catch (IllegalConfigurationException e)
- {
- assertEquals("The model version '" + incompatibleVersion
- + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'", e.getMessage());
- }
- }
- }
-
-
- public void testModelVersionValidationForIncompatibleMinorVersion() throws Exception
- {
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- String incompatibleVersion = Model.MODEL_MAJOR_VERSION + "." + Integer.MAX_VALUE;
- brokerAttributes.put(Broker.MODEL_VERSION, incompatibleVersion);
- when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
-
- try
- {
- _brokerRecoverer.create(null, _brokerEntry);
- fail("The broker creation should fail due to unsupported model version");
- }
- catch (IllegalConfigurationException e)
- {
- assertEquals("The model version '" + incompatibleVersion
- + "' in configuration is incompatible with the broker model version '" + Model.MODEL_VERSION + "'", e.getMessage());
- }
- }
-
- public void testIncorrectModelVersion() throws Exception
- {
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- String[] versions = { Integer.MAX_VALUE + "_" + 0, "", null };
- for (String modelVersion : versions)
- {
- brokerAttributes.put(Broker.MODEL_VERSION, modelVersion);
- when(_brokerEntry.getAttributes()).thenReturn(brokerAttributes);
-
- try
- {
- _brokerRecoverer.create(null, _brokerEntry);
- fail("The broker creation should fail due to unsupported model version");
- }
- catch (IllegalConfigurationException e)
- {
- // pass
- }
- }
- }
-
- private String convertToString(Object attributeValue)
- {
- return String.valueOf(attributeValue);
- }
-
- private RecovererProvider createRecoveryProvider(final ConfigurationEntry[] entries, final ConfiguredObject[] objectsToRecoverer)
- {
- RecovererProvider recovererProvider = new RecovererProvider()
- {
- @Override
- public ConfiguredObjectRecoverer<? extends ConfiguredObject> getRecoverer(String type)
- {
- @SuppressWarnings({ "unchecked", "rawtypes" })
- final ConfiguredObjectRecoverer<? extends ConfiguredObject> recovever = new ConfiguredObjectRecoverer()
- {
- @Override
- public ConfiguredObject create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject... parents)
- {
- for (int i = 0; i < entries.length; i++)
- {
- ConfigurationEntry e = entries[i];
- if (entry == e)
- {
- return objectsToRecoverer[i];
- }
- }
- return null;
- }
- };
-
- return recovever;
- }
- };
- return recovererProvider;
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java
deleted file mode 100644
index 8c316b5f53..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecovererTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.server.configuration.startup;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.PreferencesProvider;
-import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
-import org.apache.qpid.server.model.adapter.PreferencesProviderCreator;
-import org.apache.qpid.server.util.BrokerTestHelper;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.test.utils.TestFileUtils;
-
-public class PreferencesProviderRecovererTest extends QpidTestCase
-{
- private AuthenticationProvider _authenticationProvider;
- private Broker _broker;
-
- public void setUp() throws Exception
- {
- super.setUp();
- BrokerTestHelper.setUp();
- _authenticationProvider = mock(AuthenticationProvider.class);
- _broker = BrokerTestHelper.createBrokerMock();
- when(_authenticationProvider.getParent(Broker.class)).thenReturn(_broker);
- }
-
- public void tearDown() throws Exception
- {
- try
- {
- BrokerTestHelper.tearDown();
- }
- finally
- {
- super.tearDown();
- }
- }
-
- public void testRecoverFileSystemPreferencesProvider()
- {
- PreferencesProviderRecoverer recoverer = new PreferencesProviderRecoverer(new PreferencesProviderCreator());
-
- Map<String, Object> attributes = new HashMap<String, Object>();
- UUID id = UUID.randomUUID();
- attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.class);
- attributes.put(PreferencesProvider.NAME, "test-provider");
- File file = TestFileUtils.createTempFile(this, ".prefs.json", "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
- try
- {
- attributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
- ConfigurationEntry entry = new ConfigurationEntry(id, PreferencesProvider.class.getSimpleName(), attributes, Collections.<UUID>emptySet(), mock(ConfigurationEntryStore.class));
- PreferencesProvider provider = recoverer.create(mock(RecovererProvider.class), entry, _authenticationProvider);
- assertNotNull("Preferences provider was not recovered", provider);
- assertEquals("Unexpected name", "test-provider", provider.getName());
- assertEquals("Unexpected id", id, provider.getId());
- assertEquals("Unexpected path", file.getAbsolutePath(), provider.getAttribute(FileSystemPreferencesProvider.PATH));
- }
- finally
- {
- file.delete();
- }
- }
-
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
deleted file mode 100644
index d56481340b..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.store;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.GroupProvider;
-import org.apache.qpid.server.model.KeyStore;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManager;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
-{
- private ConfigurationEntryStore _store;
-
- private UUID _brokerId;
- private UUID _virtualHostId;
- private UUID _authenticationProviderId;
-
- private Map<String, Object> _brokerAttributes;
- private Map<String, Object> _virtualHostAttributes;
- private Map<String, Object> _authenticationProviderAttributes;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- _brokerId = UUID.randomUUID();
- _brokerAttributes = new HashMap<String, Object>();
- _brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
- _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9);
- _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
- _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
- _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6);
- _brokerAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5);
- _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5);
- _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3);
- _brokerAttributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
- _brokerAttributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
- _brokerAttributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1);
- _brokerAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
- _brokerAttributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
- _brokerAttributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
- _brokerAttributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
-
- _virtualHostId = UUID.randomUUID();
- _virtualHostAttributes = new HashMap<String, Object>();
- _virtualHostAttributes.put(VirtualHost.NAME, "test");
- _virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/test");
-
- _authenticationProviderId = UUID.randomUUID();
- _authenticationProviderAttributes = new HashMap<String, Object>();
- _authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
- _authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, AnonymousAuthenticationManager.class.getSimpleName());
-
- _store = createStore(_brokerId, _brokerAttributes);
- addConfiguration(_virtualHostId, VirtualHost.class.getSimpleName(), _virtualHostAttributes);
- addConfiguration(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(), _authenticationProviderAttributes);
- }
-
- // ??? perhaps it should not be abstract
- protected abstract ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception;
-
- protected abstract void addConfiguration(UUID id, String type, Map<String, Object> attributes);
-
- protected ConfigurationEntryStore getStore()
- {
- return _store;
- }
-
- public void testGetRootEntry()
- {
- ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
- assertNotNull("Root entry does not exist", brokerConfigEntry);
- assertEquals("Unexpected id", _brokerId, brokerConfigEntry.getId());
- assertEquals("Unexpected type ", Broker.class.getSimpleName(), brokerConfigEntry.getType());
- Map<String, Object> attributes = brokerConfigEntry.getAttributes();
- assertNotNull("Attributes cannot be null", attributes);
- for (Map.Entry<String, Object> attribute : _brokerAttributes.entrySet())
- {
- assertEquals("Unexpected attribute " + attribute.getKey(), attribute.getValue(), attributes.get(attribute.getKey()));
- }
- }
-
- public void testGetEntry()
- {
- ConfigurationEntry authenticationProviderConfigEntry = _store.getEntry(_authenticationProviderId);
- assertNotNull("Provider with id " + _authenticationProviderId + " should exist", authenticationProviderConfigEntry);
- assertEquals("Unexpected id", _authenticationProviderId, authenticationProviderConfigEntry.getId());
- assertEquals("Unexpected type ", AuthenticationProvider.class.getSimpleName(), authenticationProviderConfigEntry.getType());
- Map<String, Object> attributes = authenticationProviderConfigEntry.getAttributes();
- assertNotNull("Attributes cannot be null", attributes);
- assertEquals("Unexpected attributes", _authenticationProviderAttributes, attributes);
- }
-
- public void testRemove()
- {
- Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
- virtualHostAttributes.put(VirtualHost.NAME, getName());
- virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config");
- UUID virtualHostId = UUID.randomUUID();
- addConfiguration(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes);
-
- assertNotNull("Virtual host with id " + virtualHostId + " should exist", _store.getEntry(virtualHostId));
-
- _store.remove(virtualHostId);
- assertNull("Authentication provider configuration should be removed", _store.getEntry(virtualHostId));
- }
-
- public void testRemoveMultipleEntries()
- {
- Map<String, Object> virtualHost1Attributes = new HashMap<String, Object>();
- virtualHost1Attributes.put(VirtualHost.NAME, "test1");
- virtualHost1Attributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
- UUID virtualHost1Id = UUID.randomUUID();
- addConfiguration(virtualHost1Id, VirtualHost.class.getSimpleName(), virtualHost1Attributes);
-
- Map<String, Object> virtualHost2Attributes = new HashMap<String, Object>();
- virtualHost2Attributes.put(VirtualHost.NAME, "test1");
- virtualHost2Attributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config2");
- UUID virtualHost2Id = UUID.randomUUID();
- addConfiguration(virtualHost2Id, VirtualHost.class.getSimpleName(), virtualHost2Attributes);
-
- assertNotNull("Virtual host with id " + virtualHost1Id + " should exist", _store.getEntry(virtualHost1Id));
- assertNotNull("Virtual host with id " + virtualHost2Id + " should exist", _store.getEntry(virtualHost2Id));
-
- UUID[] deletedIds = _store.remove(virtualHost1Id, virtualHost2Id);
- assertNotNull("Unexpected deleted ids", deletedIds);
- assertEquals("Unexpected id of first deleted virtual host", virtualHost1Id , deletedIds[0]);
- assertEquals("Unexpected id of second deleted virtual host", virtualHost2Id , deletedIds[1]);
- assertNull("First virtual host configuration should be removed", _store.getEntry(virtualHost1Id));
- assertNull("Second virtual host configuration should be removed", _store.getEntry(virtualHost2Id));
- }
-
- public void testSaveBroker()
- {
- ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 19);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
- attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 16);
- attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 15);
- attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 15);
- attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 13);
- attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 12);
- attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, false);
- attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 11);
- attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 11000);
- attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 12000);
- attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 14000);
- attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, false);
- ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(_brokerId, Broker.class.getSimpleName(), attributes,
- brokerConfigEntry.getChildrenIds(), _store);
-
- _store.save(updatedBrokerEntry);
-
- ConfigurationEntry newBrokerConfigEntry = _store.getRootEntry();
- assertNotNull("Root entry does not exist", newBrokerConfigEntry);
- assertEquals("Unexpected id", _brokerId, newBrokerConfigEntry.getId());
- assertEquals("Unexpected type ", Broker.class.getSimpleName(), newBrokerConfigEntry.getType());
- Map<String, Object> newBrokerattributes = newBrokerConfigEntry.getAttributes();
- assertNotNull("Attributes cannot be null", newBrokerattributes);
- assertEquals("Unexpected attributes", attributes, newBrokerattributes);
- }
-
- public void testSaveNewVirtualHost()
- {
- Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
- virtualHostAttributes.put(VirtualHost.NAME, "test1");
- virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
- UUID virtualHostId = UUID.randomUUID();
- ConfigurationEntry hostEntry = new ConfigurationEntry(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
- Collections.<UUID> emptySet(), _store);
-
- _store.save(hostEntry);
-
- ConfigurationEntry configurationEntry = _store.getEntry(virtualHostId);
- assertEquals("Unexpected virtual host configuration", hostEntry, configurationEntry);
- assertEquals("Unexpected type", VirtualHost.class.getSimpleName(), configurationEntry.getType());
- assertEquals("Unexpected virtual host attributes", hostEntry.getAttributes(), configurationEntry.getAttributes());
- assertTrue("Unexpected virtual host children found", hostEntry.getChildrenIds().isEmpty());
- }
-
- public void testSaveExistingVirtualHost()
- {
- ConfigurationEntry hostEntry = _store.getEntry(_virtualHostId);
- assertNotNull("Host configuration is not found", hostEntry);
-
- Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
- virtualHostAttributes.put(VirtualHost.NAME, "test");
- virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/new/phantom/test/configuration");
-
- ConfigurationEntry updatedEntry = new ConfigurationEntry(_virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
- hostEntry.getChildrenIds(), _store);
- _store.save(updatedEntry);
-
- ConfigurationEntry newHostEntry = _store.getEntry(_virtualHostId);
- assertEquals("Unexpected virtual host configuration", updatedEntry, newHostEntry);
- assertEquals("Unexpected type", VirtualHost.class.getSimpleName(), newHostEntry.getType());
- assertEquals("Unexpected virtual host attributes", updatedEntry.getAttributes(), newHostEntry.getAttributes());
- assertEquals("Unexpected virtual host children found", updatedEntry.getChildrenIds(), newHostEntry.getChildrenIds());
- }
-
- public void testSaveNewAuthenticationProvider()
- {
- UUID authenticationProviderId = UUID.randomUUID();
- Map<String, Object> authenticationProviderAttributes = new HashMap<String, Object>();
- authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
- authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManager.class.getSimpleName());
- ConfigurationEntry providerEntry = new ConfigurationEntry(authenticationProviderId, AuthenticationProvider.class.getSimpleName(),
- authenticationProviderAttributes, Collections.<UUID> emptySet(), _store);
-
- _store.save(providerEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(authenticationProviderId);
- assertEquals("Unexpected provider configuration", providerEntry, storeEntry);
- assertEquals("Unexpected type", AuthenticationProvider.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected provider attributes", providerEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testSaveExistingAuthenticationProvider()
- {
- ConfigurationEntry providerEntry = _store.getEntry(_authenticationProviderId);
- assertNotNull("provider configuration is not found", providerEntry);
-
- Map<String, Object> authenticationProviderAttributes = new HashMap<String, Object>();
- authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
- authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManager.class.getSimpleName());
- ConfigurationEntry updatedEntry = new ConfigurationEntry(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(),
- authenticationProviderAttributes, Collections.<UUID> emptySet(), _store);
- _store.save(updatedEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(_authenticationProviderId);
- assertEquals("Unexpected provider configuration", updatedEntry, storeEntry);
- assertEquals("Unexpected type", AuthenticationProvider.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected provider attributes", updatedEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testSaveTrustStore()
- {
- UUID trustStoreId = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(TrustStore.NAME, getName());
- attributes.put(TrustStore.PATH, "/path/to/truststore");
- attributes.put(TrustStore.PASSWORD, "my-secret-password");
- attributes.put(TrustStore.TYPE, "NON-JKS");
- attributes.put(TrustStore.TRUST_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
- attributes.put(TrustStore.DESCRIPTION, "Description");
-
- ConfigurationEntry trustStoreEntry = new ConfigurationEntry(trustStoreId, TrustStore.class.getSimpleName(), attributes,
- Collections.<UUID> emptySet(), _store);
-
- _store.save(trustStoreEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(trustStoreId);
- assertEquals("Unexpected trust store configuration", trustStoreEntry, storeEntry);
- assertEquals("Unexpected type", TrustStore.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected provider attributes", trustStoreEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testSaveKeyStore()
- {
- UUID keyStoreId = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(KeyStore.NAME, getName());
- attributes.put(KeyStore.PATH, "/path/to/truststore");
- attributes.put(KeyStore.PASSWORD, "my-secret-password");
- attributes.put(KeyStore.TYPE, "NON-JKS");
- attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
- attributes.put(KeyStore.DESCRIPTION, "Description");
- attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");
-
- ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
- _store);
-
- _store.save(keyStoreEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(keyStoreId);
- assertEquals("Unexpected key store configuration", keyStoreEntry, storeEntry);
- assertEquals("Unexpected type", KeyStore.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected provider attributes", keyStoreEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testSaveGroupProvider()
- {
- UUID groupProviderId = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(GroupProvider.NAME, getName());
-
- ConfigurationEntry groupProviderEntry = new ConfigurationEntry(groupProviderId, GroupProvider.class.getSimpleName(), attributes,
- Collections.<UUID> emptySet(), _store);
-
- _store.save(groupProviderEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(groupProviderId);
- assertEquals("Unexpected group provider configuration", groupProviderEntry, storeEntry);
- assertEquals("Unexpected type", GroupProvider.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected group provider attributes", groupProviderEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testSavePort()
- {
- UUID portId = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
- Set<String> tcpTransportSet = Collections.singleton(Transport.TCP.name());
- attributes.put(Port.PORT, 9999);
- attributes.put(Port.TRANSPORTS, tcpTransportSet);
- attributes.put(Port.TCP_NO_DELAY, true);
- attributes.put(Port.RECEIVE_BUFFER_SIZE, 1);
- attributes.put(Port.SEND_BUFFER_SIZE, 2);
- attributes.put(Port.NEED_CLIENT_AUTH, true);
- attributes.put(Port.WANT_CLIENT_AUTH, true);
-
- ConfigurationEntry portEntry = new ConfigurationEntry(portId, Port.class.getSimpleName(), attributes, Collections.<UUID> emptySet(), _store);
-
- _store.save(portEntry);
-
- ConfigurationEntry storeEntry = _store.getEntry(portId);
- assertEquals("Unexpected port configuration", portEntry, storeEntry);
- assertEquals("Unexpected type", Port.class.getSimpleName(), storeEntry.getType());
- assertEquals("Unexpected port attributes", portEntry.getAttributes(), storeEntry.getAttributes());
- assertTrue("Unexpected port children found", storeEntry.getChildrenIds().isEmpty());
- }
-
- public void testMultipleSave()
- {
- UUID virtualHostId = UUID.randomUUID();
- Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
- virtualHostAttributes.put(VirtualHost.NAME, "test1");
- virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
- ConfigurationEntry hostEntry = new ConfigurationEntry(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
- Collections.<UUID> emptySet(), _store);
-
- UUID keyStoreId = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(KeyStore.NAME, getName());
- attributes.put(KeyStore.PATH, "/path/to/truststore");
- attributes.put(KeyStore.PASSWORD, "my-secret-password");
- attributes.put(KeyStore.TYPE, "NON-JKS");
- attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
- attributes.put(KeyStore.DESCRIPTION, "Description");
- attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");
-
- ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
- _store);
-
- _store.save(hostEntry, keyStoreEntry);
-
- assertNotNull("Virtual host is not found", _store.getEntry(virtualHostId));
- assertNotNull("Key store is not found", _store.getEntry(keyStoreId));
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java
deleted file mode 100644
index 3412543030..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/JsonConfigurationEntryStoreTest.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.store;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.test.utils.TestFileUtils;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializationConfig;
-
-public class JsonConfigurationEntryStoreTest extends ConfigurationEntryStoreTestCase
-{
- private File _storeFile;
- private ObjectMapper _objectMapper;
-
- @Override
- public void setUp() throws Exception
- {
- _objectMapper = new ObjectMapper();
- _objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- super.setUp();
- }
-
- @Override
- public void tearDown() throws Exception
- {
- _storeFile.delete();
- super.tearDown();
- }
-
- @Override
- protected ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception
- {
- _storeFile = createStoreFile(brokerId, brokerAttributes);
- JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
- return store;
- }
-
- private File createStoreFile(UUID brokerId, Map<String, Object> brokerAttributes) throws IOException,
- JsonGenerationException, JsonMappingException
- {
- return createStoreFile(brokerId, brokerAttributes, true);
- }
-
- private File createStoreFile(UUID brokerId, Map<String, Object> brokerAttributes, boolean setVersion) throws IOException,
- JsonGenerationException, JsonMappingException
- {
- Map<String, Object> brokerObjectMap = new HashMap<String, Object>();
- brokerObjectMap.put(Broker.ID, brokerId);
- if (setVersion)
- {
- brokerObjectMap.put(Broker.STORE_VERSION, MemoryConfigurationEntryStore.STORE_VERSION);
- }
- brokerObjectMap.put(Broker.NAME, getTestName());
- brokerObjectMap.putAll(brokerAttributes);
-
- StringWriter sw = new StringWriter();
- _objectMapper.writeValue(sw, brokerObjectMap);
-
- String brokerJson = sw.toString();
-
- return TestFileUtils.createTempFile(this, ".json", brokerJson);
- }
-
- @Override
- protected void addConfiguration(UUID id, String type, Map<String, Object> attributes)
- {
- ConfigurationEntryStore store = getStore();
- store.save(new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
- }
-
- public void testAttributeIsResolvedFromSystemProperties()
- {
- String defaultVhost = getTestName();
- setTestSystemProperty("my.test.property", defaultVhost);
-
- ConfigurationEntryStore store = getStore();
- ConfigurationEntry brokerConfigEntry = store.getRootEntry();
- Map<String, Object> attributes = new HashMap<String, Object>(brokerConfigEntry.getAttributes());
- attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "${my.test.property}");
- ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(brokerConfigEntry.getId(), Broker.class.getSimpleName(),
- attributes, brokerConfigEntry.getChildrenIds(), store);
- store.save(updatedBrokerEntry);
-
- JsonConfigurationEntryStore store2 = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
-
- assertEquals("Unresolved default virtualhost value", defaultVhost, store2.getRootEntry().getAttributes().get(Broker.DEFAULT_VIRTUAL_HOST));
- }
-
- public void testCreateEmptyStore()
- {
- File file = TestFileUtils.createTempFile(this, ".json");
- try
- {
- new JsonConfigurationEntryStore(file.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
- fail("Cannot create a new store without initial store");
- }
- catch(IllegalConfigurationException e)
- {
- // pass
- }
- }
-
- public void testCreateFromExistingLocation() throws Exception
- {
- UUID brokerId = UUID.randomUUID();
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- brokerAttributes.put(Broker.NAME, getTestName());
- File file = createStoreFile(brokerId, brokerAttributes);
-
- JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(file.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
- ConfigurationEntry root = store.getRootEntry();
- assertNotNull("Root entry is not found", root);
- assertEquals("Unexpected root entry", brokerId, root.getId());
- Map<String, Object> attributes = root.getAttributes();
- assertNotNull("Attributes not found", attributes);
- assertEquals("Unexpected number of attriburtes", 2, attributes.size());
- assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
- assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION));
- }
-
- public void testCreateFromInitialStore() throws Exception
- {
- UUID brokerId = UUID.randomUUID();
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- File initialStoreFile = createStoreFile(brokerId, brokerAttributes);
-
- JsonConfigurationEntryStore initialStore = new JsonConfigurationEntryStore(initialStoreFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
-
- File storeFile = TestFileUtils.createTempFile(this, ".json");
- JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), initialStore, false, Collections.<String,String>emptyMap());
-
- ConfigurationEntry root = store.getRootEntry();
- assertNotNull("Root entry is not found", root);
- assertEquals("Unexpected root entry", brokerId, root.getId());
- Map<String, Object> attributes = root.getAttributes();
- assertNotNull("Attributes not found", attributes);
- assertEquals("Unexpected number of attriburtes", 2, attributes.size());
- assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
- assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION));
- }
-
- public void testGetVersion()
- {
- assertEquals("Unexpected version", 1, getStore().getVersion());
- }
-
- public void testGetType()
- {
- assertEquals("Unexpected type", "json", getStore().getType());
- }
-
- public void testUnsupportedStoreVersion() throws Exception
- {
- UUID brokerId = UUID.randomUUID();
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- int[] storeVersions = {Integer.MAX_VALUE, 0};
- for (int storeVersion : storeVersions)
- {
- brokerAttributes.put(Broker.STORE_VERSION, storeVersion);
- File storeFile = null;
- try
- {
- storeFile = createStoreFile(brokerId, brokerAttributes);
- new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), null, false, Collections.<String, String>emptyMap());
- fail("The store creation should fail due to unsupported store version");
- }
- catch (IllegalConfigurationException e)
- {
- assertEquals("The data of version " + storeVersion
- + " can not be loaded by store of version " + MemoryConfigurationEntryStore.STORE_VERSION, e.getMessage());
- }
- finally
- {
- if (storeFile != null)
- {
- storeFile.delete();
- }
- }
- }
- }
-
- public void testStoreVersionNotSpecified() throws Exception
- {
- UUID brokerId = UUID.randomUUID();
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- File storeFile = null;
- try
- {
- storeFile = createStoreFile(brokerId, brokerAttributes, false);
- new JsonConfigurationEntryStore(storeFile.getAbsolutePath(), null, false, Collections.<String, String>emptyMap());
- fail("The store creation should fail due to unspecified store version");
- }
- catch (IllegalConfigurationException e)
- {
- assertEquals("Broker " + Broker.STORE_VERSION + " attribute must be specified", e.getMessage());
- }
- finally
- {
- if (storeFile != null)
- {
- storeFile.delete();
- }
- }
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java
deleted file mode 100644
index d7ecaeafd2..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStoreTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration.store;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.server.BrokerOptions;
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.model.Broker;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class MemoryConfigurationEntryStoreTest extends ConfigurationEntryStoreTestCase
-{
-
- @Override
- protected ConfigurationEntryStore createStore(UUID brokerId, Map<String, Object> brokerAttributes) throws Exception
- {
- Map<String, Object> broker = new HashMap<String, Object>();
- broker.put(Broker.ID, brokerId);
- broker.putAll(brokerAttributes);
- ObjectMapper mapper = new ObjectMapper();
-
- return new MemoryConfigurationEntryStore(mapper.writeValueAsString(broker), Collections.<String,String>emptyMap());
- }
-
- @Override
- protected void addConfiguration(UUID id, String type, Map<String, Object> attributes)
- {
- ConfigurationEntryStore store = getStore();
- store.save(new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
- }
-
- public void testCreateWithNullLocationAndNullInitialStore()
- {
- try
- {
- new MemoryConfigurationEntryStore(null, null, Collections.<String,String>emptyMap());
- fail("Cannot create a memory store without either initial store or path to an initial store file");
- }
- catch(IllegalConfigurationException e)
- {
- // pass
- }
- }
-
- public void testCreateWithNullJson()
- {
- MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, Collections.<String,String>emptyMap());
-
- ConfigurationEntry root = store.getRootEntry();
- assertNotNull("Root entry is not found", root);
- }
-
- public void testOpenInMemoryWithInitialStore() throws Exception
- {
- UUID brokerId = UUID.randomUUID();
- Map<String, Object> brokerAttributes = new HashMap<String, Object>();
- brokerAttributes.put(Broker.NAME, getTestName());
- MemoryConfigurationEntryStore initialStoreFile = (MemoryConfigurationEntryStore)createStore(brokerId, brokerAttributes);
- MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, initialStoreFile, Collections.<String,String>emptyMap());
-
- ConfigurationEntry root = store.getRootEntry();
- assertNotNull("Root entry is not found", root);
- assertEquals("Unexpected root entry", brokerId, root.getId());
- Map<String, Object> attributes = root.getAttributes();
- assertNotNull("Attributes not found", attributes);
- assertEquals("Unexpected number of attriburtes", 1, attributes.size());
- assertEquals("Unexpected name attribute", getTestName(), attributes.get(Broker.NAME));
- }
-
-
- public void testOpenWithDefaultInitialStore() throws Exception
- {
- // check whether QPID_HOME JVM system property is set
- if (QPID_HOME == null)
- {
- // set the properties in order to resolve the defaults store settings
- setTestSystemProperty("QPID_HOME", TMP_FOLDER);
- setTestSystemProperty("QPID_WORK", TMP_FOLDER + File.separator + "work");
- }
- MemoryConfigurationEntryStore initialStore = new MemoryConfigurationEntryStore(BrokerOptions.DEFAULT_INITIAL_CONFIG_LOCATION, null, new BrokerOptions().getConfigProperties());
- ConfigurationEntry initialStoreRoot = initialStore.getRootEntry();
- assertNotNull("Initial store root entry is not found", initialStoreRoot);
-
- MemoryConfigurationEntryStore store = new MemoryConfigurationEntryStore(null, initialStore, Collections.<String,String>emptyMap());
-
- ConfigurationEntry root = store.getRootEntry();
- assertNotNull("Root entry is not found", root);
-
- assertEquals("Unexpected broker attributes", initialStoreRoot.getAttributes(), root.getAttributes());
- assertEquals("Unexpected broker children", initialStoreRoot.getChildrenIds(), root.getChildrenIds());
- }
-
- public void testGetVersion()
- {
- assertEquals("Unexpected version", 1, getStore().getVersion());
- }
-
- public void testGetType()
- {
- assertEquals("Unexpected type", "memory", getStore().getType());
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
deleted file mode 100644
index ce213ee582..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.configuration.ConfigurationEntry;
-import org.apache.qpid.server.configuration.RecovererProvider;
-import org.apache.qpid.server.configuration.startup.VirtualHostRecoverer;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.logging.SystemOutMessageLogger;
-import org.apache.qpid.server.logging.actors.CurrentActor;
-import org.apache.qpid.server.logging.actors.TestLogActor;
-import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.store.TestMemoryMessageStore;
-import org.apache.qpid.server.util.BrokerTestHelper;
-import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
-
-public class VirtualHostTest extends TestCase
-{
-
- private Broker _broker;
- private StatisticsGatherer _statisticsGatherer;
- private RecovererProvider _recovererProvider;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- CurrentActor.set(new TestLogActor(new SystemOutMessageLogger()));
-
- _broker = BrokerTestHelper.createBrokerMock();
- TaskExecutor taslExecutor = mock(TaskExecutor.class);
- when(taslExecutor.isTaskExecutorThread()).thenReturn(true);
- when(_broker.getTaskExecutor()).thenReturn(taslExecutor);
-
- _recovererProvider = mock(RecovererProvider.class);
- _statisticsGatherer = mock(StatisticsGatherer.class);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- CurrentActor.remove();
- }
-
- public void testInitialisingState()
- {
- VirtualHost host = createHost();
-
- assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
- }
-
- public void testActiveState()
- {
- VirtualHost host = createHost();
-
- host.setDesiredState(State.INITIALISING, State.ACTIVE);
- assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
- }
-
- public void testQuiescedState()
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(VirtualHost.NAME, getName());
- attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
- attributes.put(VirtualHost.STORE_TYPE, TestMemoryMessageStore.TYPE);
- attributes.put(VirtualHost.STATE, State.QUIESCED);
-
- VirtualHost host = createHost(attributes);
-
- assertEquals("Unexpected state", State.QUIESCED, host.getAttribute(VirtualHost.STATE));
-
- host.setDesiredState(State.QUIESCED, State.ACTIVE);
- assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
- }
-
- public void testStoppedState()
- {
- VirtualHost host = createHost();
-
- assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
-
- host.setDesiredState(State.INITIALISING, State.ACTIVE);
- assertEquals("Unexpected state", State.ACTIVE, host.getAttribute(VirtualHost.STATE));
-
- host.setDesiredState(State.ACTIVE, State.STOPPED);
- assertEquals("Unexpected state", State.STOPPED, host.getAttribute(VirtualHost.STATE));
- }
-
- public void testDeletedState()
- {
- VirtualHost host = createHost();
-
- assertEquals("Unexpected state", State.INITIALISING, host.getAttribute(VirtualHost.STATE));
-
- host.setDesiredState(State.INITIALISING, State.DELETED);
- assertEquals("Unexpected state", State.DELETED, host.getAttribute(VirtualHost.STATE));
- }
-
- private VirtualHost createHost()
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(VirtualHost.NAME, getName());
- attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
- attributes.put(VirtualHost.STORE_TYPE, TestMemoryMessageStore.TYPE);
-
- VirtualHost host = createHost(attributes);
- return host;
- }
-
- private VirtualHost createHost(Map<String, Object> attributes)
- {
- ConfigurationEntry entry = new ConfigurationEntry(UUID.randomUUID(), VirtualHost.class.getSimpleName(), attributes,
- Collections.<UUID> emptySet(), null);
-
- return new VirtualHostRecoverer(_statisticsGatherer).create(_recovererProvider, entry, _broker);
- }
-
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java
deleted file mode 100644
index ed22843e07..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactoryTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.never;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-
-public class AuthenticationProviderFactoryTest extends TestCase
-{
- private PreferencesProviderCreator _preferencesProviderCreator = mock(PreferencesProviderCreator.class);
-
- public void testCreatePasswordCredentialManagingAuthenticationProvider()
- {
- AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
- AuthenticationProvider provider = testForFactory(am, true);
- assertTrue("The created provider should match the factory's AuthenticationManager type",
- provider instanceof PasswordCredentialManagingAuthenticationProvider);
- verify(am).onCreate();
- }
-
- public void testCreateNonPasswordCredentialManagingAuthenticationProvider()
- {
- AuthenticationManager am = mock(AuthenticationManager.class);
- AuthenticationProvider provider = testForFactory(am, true);
- assertFalse("The created provider should match the factory's AuthenticationManager type",
- provider instanceof PasswordCredentialManagingAuthenticationProvider);
- verify(am).onCreate();
- }
-
- public void testRecoverPasswordCredentialManagingAuthenticationProvider()
- {
- AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
- AuthenticationProvider provider = testForFactory(am, false);
- assertTrue("The created provider should match the factory's AuthenticationManager type",
- provider instanceof PasswordCredentialManagingAuthenticationProvider);
- verify(am, never()).onCreate();
- }
-
- public void testRecoverNonPasswordCredentialManagingAuthenticationProvider()
- {
- AuthenticationManager am = mock(AuthenticationManager.class);
- AuthenticationProvider provider = testForFactory(am, false);
- assertFalse("The created provider should match the factory's AuthenticationManager type",
- provider instanceof PasswordCredentialManagingAuthenticationProvider);
- verify(am, never()).onCreate();
- }
-
- @SuppressWarnings("unchecked")
- private AuthenticationProvider testForFactory(AuthenticationManager authenticationManager, boolean create)
- {
- UUID id = UUID.randomUUID();
- Map<String, Object> attributes = new HashMap<String, Object>();
-
- QpidServiceLoader<AuthenticationManagerFactory> authManagerFactoryServiceLoader = mock(QpidServiceLoader.class);
- AuthenticationManagerFactory authenticationManagerFactory = mock(AuthenticationManagerFactory.class);
-
- Broker broker = mock(Broker.class);
-
- when(authManagerFactoryServiceLoader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(
- Collections.singleton(authenticationManagerFactory));
- when(authenticationManagerFactory.createInstance(attributes)).thenReturn(authenticationManager);
-
- AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(authManagerFactoryServiceLoader, _preferencesProviderCreator);
-
- AuthenticationProvider provider = null;
- if (create)
- {
- provider = providerFactory.create(id, broker, attributes);
- }
- else
- {
- provider = providerFactory.recover(id, attributes, broker);
- }
-
- assertNotNull("Provider is not created", provider);
- assertEquals("Unexpected ID", id, provider.getId());
-
- return provider;
- }
-
- public void testCreatePasswordCredentialManagingAuthenticationProviderFailsWhenAnotherOneAlready()
- {
- Broker broker = mock(Broker.class);
- PasswordCredentialManagingAuthenticationProvider anotherProvider = mock(PasswordCredentialManagingAuthenticationProvider.class);
- when(broker.getAuthenticationProviders()).thenReturn(Collections.<AuthenticationProvider>singleton(anotherProvider));
-
- QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
- AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
- when(managerFactory.createInstance(any(Map.class))).thenReturn(mock(PrincipalDatabaseAuthenticationManager.class));
- when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));
-
- AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader, _preferencesProviderCreator);
-
- UUID randomUUID = UUID.randomUUID();
- AuthenticationProvider provider = providerFactory.create(randomUUID, broker, new HashMap<String, Object>());
-
- assertNotNull("Provider is not created", provider);
- assertEquals("Unexpected ID", randomUUID, provider.getId());
- }
-
- @SuppressWarnings("unchecked")
- public void testCreateNonPasswordCredentialManagingAuthenticationProviderWhenAnotherOneAlreadyExist()
- {
- Broker broker = mock(Broker.class);
- AuthenticationProvider anotherProvider = mock(AuthenticationProvider.class);
- when(broker.getAuthenticationProviders()).thenReturn(Collections.singleton(anotherProvider));
-
- QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
- AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
- when(managerFactory.createInstance(any(Map.class))).thenReturn(mock(AuthenticationManager.class));
- when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));
-
- AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader, _preferencesProviderCreator);
- UUID id = UUID.randomUUID();
- AuthenticationProvider provider = providerFactory.create(id, broker, new HashMap<String, Object>());
-
- assertNotNull("Provider is not created", provider);
- assertEquals("Unexpected ID", id, provider.getId());
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java
deleted file mode 100644
index 0eab93541f..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.model.adapter;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.util.BrokerTestHelper;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.test.utils.TestFileUtils;
-
-public class FileSystemPreferencesProviderTest extends QpidTestCase
-{
- private static final String TEST_PREFERENCES = "{\"user1\":{\"pref1\":\"pref1User1Value\", \"pref2\": true, \"pref3\": 1.0, \"pref4\": 2},"
- + "\"user2\":{\"pref1\":\"pref1User2Value\", \"pref2\": false, \"pref3\": 2.0, \"pref4\": 3}}";
- private FileSystemPreferencesProvider _preferencesProvider;
- private AuthenticationProvider _authenticationProvider;
- private Broker _broker;
- private String _user1, _user2;
- private File _preferencesFile;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- BrokerTestHelper.setUp();
- _authenticationProvider = mock(AuthenticationProvider.class);
- _user1 = "user1";
- _user2 = "user2";
- _preferencesFile = TestFileUtils.createTempFile(this, ".prefs.json", TEST_PREFERENCES);
-
- _broker = BrokerTestHelper.createBrokerMock();
- TaskExecutor taslExecutor = mock(TaskExecutor.class);
- when(taslExecutor.isTaskExecutorThread()).thenReturn(true);
- when(_broker.getTaskExecutor()).thenReturn(taslExecutor);
- when(_authenticationProvider.getParent(Broker.class)).thenReturn(_broker);
- }
-
- protected void tearDown() throws Exception
- {
- try
- {
- BrokerTestHelper.tearDown();
- _preferencesFile.delete();
- }
- finally
- {
- super.tearDown();
- }
- }
-
- public void testConstructionWithExistingFile()
- {
- _preferencesProvider = createPreferencesProvider();
- assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
- }
-
- public void testConstructionWithNonExistingFile()
- {
- File nonExistingFile = new File(TMP_FOLDER, "preferences-" + UUID.randomUUID() + ".json");
- assertFalse("Preferences file exists", nonExistingFile.exists());
- try
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(FileSystemPreferencesProvider.PATH, nonExistingFile.getAbsolutePath());
- _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
- _preferencesProvider.createStoreIfNotExist();
- assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
- assertTrue("Preferences file was not created", nonExistingFile.exists());
- }
- finally
- {
- nonExistingFile.delete();
- }
- }
-
- public void testConstructionWithEmptyFile() throws Exception
- {
- File emptyPrefsFile = new File(TMP_FOLDER, "preferences-" + UUID.randomUUID() + ".json");
- emptyPrefsFile.createNewFile();
- assertTrue("Preferences file does notexists", emptyPrefsFile.exists());
- try
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(FileSystemPreferencesProvider.PATH, emptyPrefsFile.getAbsolutePath());
- _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
- assertEquals(State.INITIALISING, _preferencesProvider.getActualState());
- }
- finally
- {
- emptyPrefsFile.delete();
- }
- }
-
- public void testActivate()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- assertEquals("Unexpexpected state", State.ACTIVE, _preferencesProvider.getActualState());
- }
-
- public void testChangeAttributes()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- File newPrefsFile = TestFileUtils.createTempFile(this, ".prefs.json", "{\"user3\":{\"pref1\":\"pref1User3Value\", \"pref3\": 2.0}}");
- try
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(FileSystemPreferencesProvider.PATH, newPrefsFile.getAbsolutePath());
- _preferencesProvider.changeAttributes(attributes);
- assertEquals("Unexpected path", newPrefsFile.getAbsolutePath(),
- _preferencesProvider.getAttribute(FileSystemPreferencesProvider.PATH));
-
- Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
- assertTrue("Unexpected preferences for user1", preferences1.isEmpty());
-
- String user3 = "user3";
- Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
- assertFalse("No preference found for user3", preferences3.isEmpty());
- assertEquals("Unexpected preference 1 for user 3", "pref1User3Value", preferences3.get("pref1"));
- assertEquals("Unexpected preference 3 for user 3", 2.0, ((Number) preferences3.get("pref3")).floatValue(), 0.01);
- }
- finally
- {
- newPrefsFile.delete();
- }
- }
-
- public void testGetPreferences()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- Map<String, Object> preferences1 = _preferencesProvider.getPreferences(_user1);
- assertUser1Preferences(preferences1);
-
- Map<String, Object> preferences2 = _preferencesProvider.getPreferences(_user2);
- assertUser2Preferences(preferences2);
-
- String user3 = "user3";
- Map<String, Object> preferences3 = _preferencesProvider.getPreferences(user3);
- assertTrue("No preference found for user3", preferences3.isEmpty());
- }
-
- public void testSetPrefernces()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- Map<String, Object> newPreferences = new HashMap<String, Object>();
- newPreferences.put("pref2", false);
- newPreferences.put("pref4", 8);
- Map<String, Object> pref5 = new HashMap<String, Object>();
- pref5.put("test1", "test1Value");
- pref5.put("test2", 5);
- newPreferences.put("pref5", pref5);
-
- _preferencesProvider.setPreferences(_user1, newPreferences);
-
- FileSystemPreferencesProvider newProvider = createPreferencesProvider();
- Map<String, Object> preferences1 = newProvider.getPreferences(_user1);
- assertNotNull("Preferences should not be null for user 1", preferences1);
- assertEquals("Unexpected preference 1 for user 1", "pref1User1Value", preferences1.get("pref1"));
- assertEquals("Unexpected preference 2 for user 1", false, preferences1.get("pref2"));
- assertEquals("Unexpected preference 3 for user 1", 1.0, ((Number) preferences1.get("pref3")).floatValue(), 0.01);
- assertEquals("Unexpected preference 4 for user 1", 8, preferences1.get("pref4"));
- assertNotNull("Unexpected preference 5 for user 1", preferences1.get("pref5"));
- assertEquals("Unexpected preference 5 for user 1", pref5, preferences1.get("pref5"));
-
- Map<String, Object> preferences2 = newProvider.getPreferences(_user2);
- assertUser2Preferences(preferences2);
-
- String user3 = "user3";
- Map<String, Object> preferences3 = newProvider.getPreferences(user3);
- assertTrue("No preference found for user3", preferences3.isEmpty());
- }
-
- public void testDeletePrefernces()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- _preferencesProvider.deletePreferences(_user1);
-
- FileSystemPreferencesProvider newProvider = createPreferencesProvider();
- Map<String, Object> preferences1 = newProvider.getPreferences(_user1);
- assertTrue("Preferences should not be set for user 1", preferences1.isEmpty());
-
- Map<String, Object> preferences2 = newProvider.getPreferences(_user2);
- assertUser2Preferences(preferences2);
-
- String user3 = "user3";
- Map<String, Object> preferences3 = newProvider.getPreferences(user3);
- assertTrue("No preference found for user3", preferences3.isEmpty());
- }
-
- public void testListUserNames()
- {
- _preferencesProvider = createPreferencesProvider();
- _preferencesProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
-
- Set<String> userNames = _preferencesProvider.listUserIDs();
-
- assertEquals("Unexpected user names", new HashSet<String>(Arrays.asList("user1", "user2")), userNames);
- }
-
- private FileSystemPreferencesProvider createPreferencesProvider()
- {
- Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(FileSystemPreferencesProvider.PATH, _preferencesFile.getAbsolutePath());
- attributes.put(FileSystemPreferencesProvider.NAME, "test");
- return _preferencesProvider = new FileSystemPreferencesProvider(UUID.randomUUID(), attributes, _authenticationProvider, _broker.getTaskExecutor());
- }
-
- private void assertUser1Preferences(Map<String, Object> preferences1)
- {
- assertNotNull("Preferences should not be null for user 1", preferences1);
- assertEquals("Unexpected preference 1 for user 1", "pref1User1Value", preferences1.get("pref1"));
- assertEquals("Unexpected preference 2 for user 1", true, preferences1.get("pref2"));
- assertEquals("Unexpected preference 3 for user 1", 1.0, ((Number) preferences1.get("pref3")).floatValue(), 0.01);
- assertEquals("Unexpected preference 4 for user 1", 2, preferences1.get("pref4"));
- assertNull("Unexpected preference 5 for user 1", preferences1.get("pref5"));
- }
-
- private void assertUser2Preferences(Map<String, Object> preferences2)
- {
- assertNotNull("Preferences should not be null for user 2", preferences2);
- assertEquals("Unexpected preference 1 for user 2", "pref1User2Value", preferences2.get("pref1"));
- assertEquals("Unexpected preference 2 for user 2", false, preferences2.get("pref2"));
- assertEquals("Unexpected preference 2 for user 2", 2.0, ((Number) preferences2.get("pref3")).floatValue(), 0.01);
- assertEquals("Unexpected preference 3 for user 2", 3, preferences2.get("pref4"));
- assertNull("Unexpected preference 5 for user 2", preferences2.get("pref5"));
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
deleted file mode 100644
index 9a2c5bc166..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.queue;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyMap;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.server.configuration.BrokerProperties;
-import org.apache.qpid.server.configuration.QueueConfiguration;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.exchange.DefaultExchangeFactory;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.logging.LogActor;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.actors.CurrentActor;
-import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.plugin.ExchangeType;
-import org.apache.qpid.server.store.DurableConfigurationStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.mockito.ArgumentCaptor;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-public class AMQQueueFactoryTest extends QpidTestCase
-{
- private QueueRegistry _queueRegistry;
- private VirtualHost _virtualHost;
- private AMQQueueFactory _queueFactory;
- private List<AMQQueue> _queues;
- private QueueConfiguration _queueConfiguration;
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
-
- _queues = new ArrayList<AMQQueue>();
-
- _virtualHost = mock(VirtualHost.class);
-
- VirtualHostConfiguration vhostConfig = mock(VirtualHostConfiguration.class);
- when(_virtualHost.getConfiguration()).thenReturn(vhostConfig);
- _queueConfiguration = mock(QueueConfiguration.class);
- when(vhostConfig.getQueueConfiguration(anyString())).thenReturn(_queueConfiguration);
- LogActor logActor = mock(LogActor.class);
- CurrentActor.set(logActor);
- RootMessageLogger rootLogger = mock(RootMessageLogger.class);
- when(logActor.getRootMessageLogger()).thenReturn(rootLogger);
- DurableConfigurationStore store = mock(DurableConfigurationStore.class);
- when(_virtualHost.getDurableConfigurationStore()).thenReturn(store);
-
- mockExchangeCreation();
- mockQueueRegistry();
- delegateVhostQueueCreation();
-
- when(_virtualHost.getQueues()).thenReturn(_queues);
-
-
- _queueFactory = new AMQQueueFactory(_virtualHost, _queueRegistry);
-
-
-
- }
-
- private void delegateVhostQueueCreation() throws AMQException
- {
- final ArgumentCaptor<UUID> id = ArgumentCaptor.forClass(UUID.class);
- final ArgumentCaptor<String> queueName = ArgumentCaptor.forClass(String.class);
- final ArgumentCaptor<Boolean> durable = ArgumentCaptor.forClass(Boolean.class);
- final ArgumentCaptor<String> owner = ArgumentCaptor.forClass(String.class);
- final ArgumentCaptor<Boolean> autoDelete = ArgumentCaptor.forClass(Boolean.class);
- final ArgumentCaptor<Boolean> exclusive = ArgumentCaptor.forClass(Boolean.class);
- final ArgumentCaptor<Boolean> deleteOnNoConsumer = ArgumentCaptor.forClass(Boolean.class);
- final ArgumentCaptor<Map> arguments = ArgumentCaptor.forClass(Map.class);
-
- when(_virtualHost.createQueue(id.capture(), queueName.capture(), durable.capture(), owner.capture(),
- autoDelete.capture(), exclusive.capture(), deleteOnNoConsumer.capture(), arguments.capture())).then(
- new Answer<AMQQueue>()
- {
- @Override
- public AMQQueue answer(InvocationOnMock invocation) throws Throwable
- {
- return _queueFactory.createQueue(id.getValue(),
- queueName.getValue(),
- durable.getValue(),
- owner.getValue(),
- autoDelete.getValue(),
- exclusive.getValue(),
- deleteOnNoConsumer.getValue(),
- arguments.getValue());
- }
- }
- );
- }
-
- private void mockQueueRegistry()
- {
- _queueRegistry = mock(QueueRegistry.class);
-
- final ArgumentCaptor<AMQQueue> capturedQueue = ArgumentCaptor.forClass(AMQQueue.class);
- doAnswer(new Answer()
- {
-
- @Override
- public Object answer(final InvocationOnMock invocation) throws Throwable
- {
- AMQQueue queue = capturedQueue.getValue();
- when(_queueRegistry.getQueue(eq(queue.getId()))).thenReturn(queue);
- when(_queueRegistry.getQueue(eq(queue.getName()))).thenReturn(queue);
- when(_virtualHost.getQueue(eq(queue.getId()))).thenReturn(queue);
- when(_virtualHost.getQueue(eq(queue.getName()))).thenReturn(queue);
- _queues.add(queue);
-
- return null;
- }
- }).when(_queueRegistry).registerQueue(capturedQueue.capture());
- }
-
- private void mockExchangeCreation() throws AMQException
- {
- final ArgumentCaptor<UUID> idCapture = ArgumentCaptor.forClass(UUID.class);
- final ArgumentCaptor<String> exchangeNameCapture = ArgumentCaptor.forClass(String.class);
- final ArgumentCaptor<String> type = ArgumentCaptor.forClass(String.class);
-
- when(_virtualHost.createExchange(idCapture.capture(), exchangeNameCapture.capture(), type.capture(),
- anyBoolean(), anyBoolean(), anyString())).then(
- new Answer<Exchange>()
- {
- @Override
- public Exchange answer(InvocationOnMock invocation) throws Throwable
- {
- final String name = exchangeNameCapture.getValue();
- final UUID id = idCapture.getValue();
-
- final Exchange exchange = mock(Exchange.class);
- ExchangeType exType = mock(ExchangeType.class);
-
- when(exchange.getName()).thenReturn(name);
- when(exchange.getId()).thenReturn(id);
- when(exchange.getType()).thenReturn(exType);
-
- final String typeName = type.getValue();
- when(exType.getType()).thenReturn(typeName);
- when(exchange.getTypeName()).thenReturn(typeName);
-
- when(_virtualHost.getExchange(eq(name))).thenReturn(exchange);
- when(_virtualHost.getExchange(eq(id))).thenReturn(exchange);
-
- final ArgumentCaptor<AMQQueue> queue = ArgumentCaptor.forClass(AMQQueue.class);
-
- when(exchange.addBinding(anyString(),queue.capture(),anyMap())).then(new Answer<Boolean>() {
-
- @Override
- public Boolean answer(InvocationOnMock invocation) throws Throwable
- {
- when(exchange.isBound(eq(queue.getValue()))).thenReturn(true);
- return true;
- }
- });
-
- return exchange;
- }
- }
- );
- }
-
- @Override
- public void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void verifyRegisteredQueueCount(int count)
- {
- assertEquals("Queue was not registered in virtualhost", count, _virtualHost.getQueues().size());
- }
-
-
- private void verifyQueueRegistered(String queueName)
- {
- assertNotNull("Queue " + queueName + " was not created", _virtualHost.getQueue(queueName));
- }
-
- public void testPriorityQueueRegistration() throws Exception
- {
- Map<String,Object> attributes = Collections.singletonMap(Queue.PRIORITIES, (Object) 5);
-
-
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- "testPriorityQueue",
- false,
- "owner",
- false,
- false,
- false,
- attributes);
-
- assertEquals("Queue not a priorty queue", AMQPriorityQueue.class, queue.getClass());
- verifyQueueRegistered("testPriorityQueue");
- verifyRegisteredQueueCount(1);
- }
-
-
- public void testSimpleQueueRegistration() throws Exception
- {
- String queueName = getName();
- String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
-
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner", false,
- false,
- false,
- null);
- assertEquals("Queue not a simple queue", SimpleAMQQueue.class, queue.getClass());
- verifyQueueRegistered(queueName);
-
- //verify that no alternate exchange or DLQ were produced
-
- assertNull("Queue should not have an alternate exchange as DLQ wasnt enabled", queue.getAlternateExchange());
- assertNull("The DLQ should not exist", _virtualHost.getQueue(dlQueueName));
-
- verifyRegisteredQueueCount(1);
- }
-
- /**
- * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true does
- * cause the alternate exchange to be set and DLQ to be produced.
- * @throws AMQException
- */
- public void testDeadLetterQueueEnabled() throws AMQException
- {
- Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
-
- String queueName = "testDeadLetterQueueEnabled";
- String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
- String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
-
- assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
- assertNull("The alternate exchange should not yet exist", _virtualHost.getExchange(dlExchangeName));
-
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- queueName,
- false,
- "owner",
- false,
- false,
- false,
- attributes);
-
- Exchange altExchange = queue.getAlternateExchange();
- assertNotNull("Queue should have an alternate exchange as DLQ is enabled", altExchange);
- assertEquals("Alternate exchange name was not as expected", dlExchangeName, altExchange.getName());
- assertEquals("Alternate exchange type was not as expected", ExchangeDefaults.FANOUT_EXCHANGE_CLASS, altExchange.getTypeName());
-
- assertNotNull("The alternate exchange was not registered as expected", _virtualHost.getExchange(dlExchangeName));
- assertEquals("The registered exchange was not the expected exchange instance", altExchange, _virtualHost.getExchange(dlExchangeName));
-
- AMQQueue dlQueue = _virtualHost.getQueue(dlQueueName);
- assertNotNull("The DLQ was not registered as expected", dlQueue);
- assertTrue("DLQ should have been bound to the alternate exchange", altExchange.isBound(dlQueue));
- assertNull("DLQ should have no alternate exchange", dlQueue.getAlternateExchange());
- assertEquals("DLQ should have a zero maximum delivery count", 0, dlQueue.getMaximumDeliveryCount());
-
- //2 queues should have been registered
- verifyRegisteredQueueCount(2);
- }
-
- /**
- * Tests that the deadLetterQueues/maximumDeliveryCount settings from the configuration
- * are not applied to the DLQ itself.
- * @throws AMQException
- */
- public void testDeadLetterQueueDoesNotInheritDLQorMDCSettings() throws Exception
- {
-
- String queueName = "testDeadLetterQueueEnabled";
- String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
- String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
-
- when(_queueConfiguration.getMaxDeliveryCount()).thenReturn(5);
- when(_queueConfiguration.isDeadLetterQueueEnabled()).thenReturn(true);
-
- assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
- assertNull("The alternate exchange should not yet exist", _virtualHost.getExchange(dlExchangeName));
-
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- queueName,
- false,
- "owner",
- false,
- false,
- false,
- null);
-
- assertEquals("Unexpected maximum delivery count", 5, queue.getMaximumDeliveryCount());
- Exchange altExchange = queue.getAlternateExchange();
- assertNotNull("Queue should have an alternate exchange as DLQ is enabled", altExchange);
- assertEquals("Alternate exchange name was not as expected", dlExchangeName, altExchange.getName());
- assertEquals("Alternate exchange type was not as expected", ExchangeDefaults.FANOUT_EXCHANGE_CLASS, altExchange.getTypeName());
-
- assertNotNull("The alternate exchange was not registered as expected", _virtualHost.getExchange(dlExchangeName));
- assertEquals("The registered exchange was not the expected exchange instance", altExchange, _virtualHost.getExchange(dlExchangeName));
-
- AMQQueue dlQueue = _virtualHost.getQueue(dlQueueName);
- assertNotNull("The DLQ was not registered as expected", dlQueue);
- assertTrue("DLQ should have been bound to the alternate exchange", altExchange.isBound(dlQueue));
- assertNull("DLQ should have no alternate exchange", dlQueue.getAlternateExchange());
- assertEquals("DLQ should have a zero maximum delivery count", 0, dlQueue.getMaximumDeliveryCount());
-
- //2 queues should have been registered
- verifyRegisteredQueueCount(2);
- }
-
- /**
- * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument false does not
- * result in the alternate exchange being set and DLQ being created.
- * @throws AMQException
- */
- public void testDeadLetterQueueDisabled() throws AMQException
- {
- Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) false);
-
- String queueName = "testDeadLetterQueueDisabled";
- String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
- String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
-
- assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
- assertNull("The alternate exchange should not exist", _virtualHost.getExchange(dlExchangeName));
-
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- queueName,
- false,
- "owner",
- false,
- false,
- false,
- attributes);
-
- assertNull("Queue should not have an alternate exchange as DLQ is disabled", queue.getAlternateExchange());
- assertNull("The alternate exchange should still not exist", _virtualHost.getExchange(dlExchangeName));
-
- assertNull("The DLQ should still not exist", _virtualHost.getQueue(dlQueueName));
-
- //only 1 queue should have been registered
- verifyRegisteredQueueCount(1);
- }
-
- /**
- * Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true but
- * creating an auto-delete queue, does not result in the alternate exchange
- * being set and DLQ being created.
- * @throws AMQException
- */
- public void testDeadLetterQueueNotCreatedForAutodeleteQueues() throws AMQException
- {
- Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
-
- String queueName = "testDeadLetterQueueNotCreatedForAutodeleteQueues";
- String dlExchangeName = queueName + DefaultExchangeFactory.DEFAULT_DLE_NAME_SUFFIX;
- String dlQueueName = queueName + AMQQueueFactory.DEFAULT_DLQ_NAME_SUFFIX;
-
- assertNull("The DLQ should not yet exist", _virtualHost.getQueue(dlQueueName));
- assertNull("The alternate exchange should not exist", _virtualHost.getExchange(dlExchangeName));
-
- //create an autodelete queue
- AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- queueName,
- false,
- "owner",
- true,
- false,
- false,
- attributes);
- assertTrue("Queue should be autodelete", queue.isAutoDelete());
-
- //ensure that the autodelete property overrides the request to enable DLQ
- assertNull("Queue should not have an alternate exchange as queue is autodelete", queue.getAlternateExchange());
- assertNull("The alternate exchange should not exist as queue is autodelete", _virtualHost.getExchange(dlExchangeName));
- assertNull("The DLQ should not exist as queue is autodelete", _virtualHost.getQueue(dlQueueName));
-
- //only 1 queue should have been registered
- verifyRegisteredQueueCount(1);
- }
-
- /**
- * Tests that setting the {@link QueueArgumentsConverter#X_QPID_MAXIMUM_DELIVERY_COUNT} argument has
- * the desired effect.
- */
- public void testMaximumDeliveryCount() throws Exception
- {
- Map<String,Object> attributes = Collections.singletonMap(Queue.MAXIMUM_DELIVERY_ATTEMPTS, (Object) 5);
-
- final AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- "testMaximumDeliveryCount",
- false,
- "owner",
- false,
- false,
- false,
- attributes);
-
- assertNotNull("The queue was not registered as expected ", queue);
- assertEquals("Maximum delivery count not as expected", 5, queue.getMaximumDeliveryCount());
-
- verifyRegisteredQueueCount(1);
- }
-
- /**
- * Tests that omitting the {@link QueueArgumentsConverter#X_QPID_MAXIMUM_DELIVERY_COUNT} argument means
- * that queue is created with a default maximumDeliveryCount of zero (unless set in config).
- */
- public void testMaximumDeliveryCountDefault() throws Exception
- {
- final AMQQueue queue = _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(),
- "testMaximumDeliveryCount",
- false,
- "owner",
- false,
- false,
- false,
- null);
-
- assertNotNull("The queue was not registered as expected ", queue);
- assertEquals("Maximum delivery count not as expected", 0, queue.getMaximumDeliveryCount());
-
- verifyRegisteredQueueCount(1);
- }
-
- /**
- * Tests queue creation with queue name set to null
- */
- public void testQueueNameNullValidation()
- {
- try
- {
- _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), null, false, "owner", true, false,
- false,
- null);
- fail("queue with null name can not be created!");
- }
- catch (Exception e)
- {
- assertTrue(e instanceof IllegalArgumentException);
- assertEquals("Queue name must not be null", e.getMessage());
- }
- }
-
- /**
- * Tests queue creation with queue name length less 255 characters but
- * corresponding DLQ name length greater than 255.
- */
- public void testQueueNameWithLengthLessThan255ButDLQNameWithLengthGreaterThan255()
- {
- String queueName = "test-" + generateStringWithLength('a', 245);
- try
- {
- // change DLQ name to make its length bigger than exchange name
- setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_EXCHANGE_SUFFIX, "_DLE");
- setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_QUEUE_SUFFIX, "_DLQUEUE");
- Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
- _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner",
- false, false, false, attributes);
- fail("queue with DLQ name having more than 255 characters can not be created!");
- }
- catch (Exception e)
- {
- assertTrue("Unexpected exception is thrown!", e instanceof IllegalArgumentException);
- assertTrue("Unexpected exception message!", e.getMessage().contains("DLQ queue name")
- && e.getMessage().contains("length exceeds limit of 255"));
- }
- }
-
- /**
- * Tests queue creation with queue name length less 255 characters but
- * corresponding DL exchange name length greater than 255.
- */
- public void testQueueNameWithLengthLessThan255ButDLExchangeNameWithLengthGreaterThan255()
- {
- String queueName = "test-" + generateStringWithLength('a', 245);
- try
- {
- // change DLQ name to make its length bigger than exchange name
- setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_EXCHANGE_SUFFIX, "_DLEXCHANGE");
- setTestSystemProperty(BrokerProperties.PROPERTY_DEAD_LETTER_QUEUE_SUFFIX, "_DLQ");
- Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
- _queueFactory.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, "owner",
- false, false, false, attributes);
- fail("queue with DLE name having more than 255 characters can not be created!");
- }
- catch (Exception e)
- {
- assertTrue("Unexpected exception is thrown!", e instanceof IllegalArgumentException);
- assertTrue("Unexpected exception message!", e.getMessage().contains("DL exchange name")
- && e.getMessage().contains("length exceeds limit of 255"));
- }
- }
-
- public void testMessageGroupFromConfig() throws Exception
- {
-
- Map<String,String> arguments = new HashMap<String, String>();
- arguments.put("qpid.group_header_key","mykey");
- arguments.put("qpid.shared_msg_group","1");
-
- QueueConfiguration qConf = mock(QueueConfiguration.class);
- when(qConf.getArguments()).thenReturn(arguments);
- when(qConf.getName()).thenReturn("test");
-
- AMQQueue queue = _queueFactory.createAMQQueueImpl(qConf);
- assertEquals("mykey", queue.getAttribute(Queue.MESSAGE_GROUP_KEY));
- assertEquals(Boolean.TRUE, queue.getAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS));
- }
-
- private String generateStringWithLength(char ch, int length)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < length; i++)
- {
- sb.append(ch);
- }
- return sb.toString();
- }
-
-
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java
deleted file mode 100644
index 04e09e073f..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordFileAuthenticationManagerFactoryTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
-
-public class Base64MD5PasswordFileAuthenticationManagerFactoryTest extends TestCase
-{
- AuthenticationManagerFactory _factory = new Base64MD5PasswordFileAuthenticationManagerFactory();
- private Map<String, Object> _configuration = new HashMap<String, Object>();
- private File _emptyPasswordFile;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- _emptyPasswordFile = File.createTempFile(getName(), "passwd");
- _emptyPasswordFile.deleteOnExit();
- }
-
- public void testBase64MD5InstanceCreated() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNotNull(manager);
- assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
- assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof Base64MD5PasswordFilePrincipalDatabase);
- }
-
- public void testPasswordFileNotFound() throws Exception
- {
- //delete the file
- _emptyPasswordFile.delete();
-
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
-
- try
- {
- _factory.createInstance(_configuration);
- }
- catch (RuntimeException re)
- {
- assertTrue(re.getCause() instanceof FileNotFoundException);
- }
- }
-
- public void testReturnsNullWhenNoConfig() throws Exception
- {
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- public void testReturnsNullWhenConfigForOtherAuthManagerType() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, "other-auth-manager");
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- public void testReturnsNullWhenConfigForPlainPDImplementationNoPasswordFileValueSpecified() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- if (_emptyPasswordFile == null && _emptyPasswordFile.exists())
- {
- _emptyPasswordFile.delete();
- }
- }
- finally
- {
- super.tearDown();
- }
- }
-} \ No newline at end of file
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java
deleted file mode 100644
index cc11a94db8..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/PlainPasswordFileAuthenticationManagerFactoryTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase;
-
-public class PlainPasswordFileAuthenticationManagerFactoryTest extends TestCase
-{
- AuthenticationManagerFactory _factory = new PlainPasswordFileAuthenticationManagerFactory();
- private Map<String, Object> _configuration = new HashMap<String, Object>();
- private File _emptyPasswordFile;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- _emptyPasswordFile = File.createTempFile(getName(), "passwd");
- _emptyPasswordFile.deleteOnExit();
- }
-
- public void testPlainInstanceCreated() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNotNull(manager);
- assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
- assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof PlainPasswordFilePrincipalDatabase);
- }
-
- public void testPasswordFileNotFound() throws Exception
- {
- //delete the file
- _emptyPasswordFile.delete();
-
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _emptyPasswordFile.getAbsolutePath());
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
-
- assertNotNull(manager);
- assertTrue(manager instanceof PrincipalDatabaseAuthenticationManager);
- assertTrue(((PrincipalDatabaseAuthenticationManager)manager).getPrincipalDatabase() instanceof PlainPasswordFilePrincipalDatabase);
- }
-
- public void testReturnsNullWhenNoConfig() throws Exception
- {
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- public void testReturnsNullWhenConfigForOtherAuthManagerType() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, "other-auth-manager");
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- public void testReturnsNullWhenConfigForPlainPDImplementationNoPasswordFileValueSpecified() throws Exception
- {
- _configuration.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- if (_emptyPasswordFile == null && _emptyPasswordFile.exists())
- {
- _emptyPasswordFile.delete();
- }
- }
- finally
- {
- super.tearDown();
- }
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java
deleted file mode 100644
index 1424bee611..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactoryTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-import junit.framework.TestCase;
-
-public class SimpleLDAPAuthenticationManagerFactoryTest extends TestCase
-{
- private SimpleLDAPAuthenticationManagerFactory _factory = new SimpleLDAPAuthenticationManagerFactory();
- private Map<String, Object> _configuration = new HashMap<String, Object>();
-
- public void testInstanceCreated() throws Exception
- {
- _configuration.put(SimpleLDAPAuthenticationManagerFactory.ATTRIBUTE_TYPE, SimpleLDAPAuthenticationManagerFactory.PROVIDER_TYPE);
- _configuration.put("providerUrl", "ldaps://example.com:636/");
- _configuration.put("searchContext", "dc=example");
-
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNotNull(manager);
- }
-
- public void testReturnsNullWhenNoConfig() throws Exception
- {
- AuthenticationManager manager = _factory.createInstance(_configuration);
- assertNull(manager);
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java
deleted file mode 100644
index b23890b10c..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.store;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.message.EnqueableMessage;
-import org.apache.qpid.server.plugin.MessageMetaDataType;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.util.FileUtils;
-
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public abstract class MessageStoreQuotaEventsTestBase extends QpidTestCase implements EventListener, TransactionLogResource
-{
- private static final Logger _logger = Logger.getLogger(MessageStoreQuotaEventsTestBase.class);
-
- protected static final byte[] MESSAGE_DATA = new byte[32 * 1024];
-
- private MessageStore _store;
- private File _storeLocation;
-
- private List<Event> _events;
- private UUID _transactionResource;
-
- protected abstract MessageStore createStore() throws Exception;
-
- protected abstract void applyStoreSpecificConfiguration(VirtualHost virtualHost);
-
- protected abstract int getNumberOfMessagesToFillStore();
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
-
- _storeLocation = new File(new File(TMP_FOLDER), getTestName());
- FileUtils.delete(_storeLocation, true);
-
-
- VirtualHost vhost = mock(VirtualHost.class);
- when(vhost.getAttribute(eq(VirtualHost.STORE_PATH))).thenReturn(_storeLocation.getAbsolutePath());
- when(vhost.getName()).thenReturn("test");
-
- applyStoreSpecificConfiguration(vhost);
-
- _store = createStore();
- ((DurableConfigurationStore)_store).configureConfigStore(vhost, null);
- _store.configureMessageStore(vhost, null, null);
-
- _transactionResource = UUID.randomUUID();
- _events = new ArrayList<Event>();
- _store.addEventListener(this, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
- }
-
- @Override
- public void tearDown() throws Exception
- {
- try
- {
- super.tearDown();
- }
- finally
- {
- if (_store != null)
- {
- _store.close();
- }
- FileUtils.delete(_storeLocation, true);
- }
- }
-
- public void testOverflow() throws Exception
- {
- Transaction transaction = _store.newTransaction();
-
- List<EnqueableMessage> messages = new ArrayList<EnqueableMessage>();
- for (int i = 0; i < getNumberOfMessagesToFillStore(); i++)
- {
- EnqueableMessage m = addMessage(i);
- messages.add(m);
- transaction.enqueueMessage(this, m);
- }
- transaction.commitTran();
-
- assertEvent(1, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL);
-
- for (EnqueableMessage m : messages)
- {
- m.getStoredMessage().remove();
- }
-
- assertEvent(2, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
- }
-
- protected EnqueableMessage addMessage(long id)
- {
- StorableMessageMetaData metaData = createMetaData(id, MESSAGE_DATA.length);
- StoredMessage handle = _store.addMessage(metaData);
- handle.addContent(0, ByteBuffer.wrap(MESSAGE_DATA));
- TestMessage message = new TestMessage(id, handle);
- return message;
- }
-
- private StorableMessageMetaData createMetaData(long id, int length)
- {
- StorableMessageMetaData metaData = mock(StorableMessageMetaData.class);
- when(metaData.isPersistent()).thenReturn(true);
- when(metaData.getContentSize()).thenReturn(length);
- when(metaData.getStorableSize()).thenReturn(0);
- MessageMetaDataType type = mock(MessageMetaDataType.class);
- when(type.ordinal()).thenReturn(-1);
- when(metaData.getType()).thenReturn(type);
- return metaData;
- }
-
- @Override
- public void event(Event event)
- {
- _logger.debug("Test event listener received event " + event);
- _events.add(event);
- }
-
- private void assertEvent(int expectedNumberOfEvents, Event... expectedEvents)
- {
- assertEquals("Unexpected number of events received ", expectedNumberOfEvents, _events.size());
- for (Event event : expectedEvents)
- {
- assertTrue("Expected event is not found:" + event, _events.contains(event));
- }
- }
-
- @Override
- public UUID getId()
- {
- return _transactionResource;
- }
-
- private static class TestMessage implements EnqueableMessage
- {
- private final StoredMessage<?> _handle;
- private final long _messageId;
-
- public TestMessage(long messageId, StoredMessage<?> handle)
- {
- _messageId = messageId;
- _handle = handle;
- }
-
- public long getMessageNumber()
- {
- return _messageId;
- }
-
- public boolean isPersistent()
- {
- return true;
- }
-
- public StoredMessage<?> getStoredMessage()
- {
- return _handle;
- }
- }
-}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/StringUtilTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/util/StringUtilTest.java
deleted file mode 100644
index 29dc54a8f8..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/StringUtilTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.util;
-
-import org.apache.qpid.server.util.StringUtil;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public class StringUtilTest extends QpidTestCase
-{
- private StringUtil _util;
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- _util = new StringUtil();
- }
-
- public void testRandomAlphaNumericStringInt()
- {
- String password = _util.randomAlphaNumericString(10);
- assertEquals("Unexpected password string length", 10, password.length());
- assertCharacters(password);
- }
-
- private void assertCharacters(String password)
- {
- String numbers = "0123456789";
- String letters = "abcdefghijklmnopqrstuvwxwy";
- String others = "_-";
- String expectedCharacters = (numbers + letters + letters.toUpperCase() + others);
- char[] chars = password.toCharArray();
- for (int i = 0; i < chars.length; i++)
- {
- char ch = chars[i];
- assertTrue("Unexpected character " + ch, expectedCharacters.indexOf(ch) != -1);
- }
- }
-
-}
diff --git a/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm b/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
deleted file mode 100644
index cddfcfb581..0000000000
--- a/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *
- */
-package ${package};
-
-import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.configuration.BrokerProperties;
-import org.apache.qpid.server.logging.LogMessage;
-
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-/**
- * Generated Using GeneratedLogMessages and LogMessages.vm
- *
- * This file is based on the content of LogMessages.properties
- *
- * It is generated so that we can provide compile time validation of the
- * message parameters.
- *
- * DO NOT EDIT DIRECTLY THIS FILE IS GENERATED.
- *
- */
-public class ${type.name}Messages
-{
- private static ResourceBundle _messages;
- private static Locale _currentLocale = BrokerProperties.getLocale();
-
- public static final String ${type.name.toUpperCase()}_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "${type.name.toLowerCase()}";
-#foreach( $message in ${type.list} )
- public static final String ${message.methodName.toUpperCase()}_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "${type.name.toLowerCase()}.${message.methodName.toLowerCase()}";
-#end
-
- static
- {
- Logger.getLogger(${type.name.toUpperCase()}_LOG_HIERARCHY);
-#foreach( $message in ${type.list} )
- Logger.getLogger(${message.methodName.toUpperCase()}_LOG_HIERARCHY);
-#end
-
- _messages = ResourceBundle.getBundle("${resource}", _currentLocale);
- }
-
-##
-## The list stored under key 'list' in the 'type' HashMap contains all the
-## log messages that this class should contain. So for each entry in the list
-## this template will create a new log method.
-##
-#foreach( $message in ${type.list} )
- /**
- * Log a ${type.name} message of the Format:
- * <pre>${message.format}</pre>
- * Optional values are contained in [square brackets] and are numbered
- * sequentially in the method call.
- *
- */
-## There is a lot in the method header here. To make it more readable/understandable
-## This is the same text laid out to be easier to read:
-## public static LogMessage ${message.methodName} (
-## #foreach($parameter in ${message.parameters})
-## ${parameter.type} ${parameter.name}
-## #if (${velocityCount} != ${message.parameters.size()} )
-## ,
-## #end
-## #end
-## #if(${message.parameters.size()} > 0 && ${message.options.size()} > 0)
-## ,
-## #end
-## #foreach($option in ${message.options})
-## boolean ${option.name}
-## #if (${velocityCount} != ${message.options.size()} )
-## ,
-## #end
-## #end
-## )
-##
-## What is going on is that we set the method name based on the HashMap lookup
-## for 'methodName' Then for each entry(another HashMap) in the list stored
-## in the HashMap under 'parameters' build the argument list of from the 'type'
-## and 'name' values. Ensuring that we add a ', ' between each entry.
-##
-## However, check that we are not at the last entry of the list as we don't
-## want to add ', ' at then end.
-##
-## Before we go on to the options we perform a check to see if we had any
-## parameters. If we did and we have options to add then we add ', ' to keep
-## the syntax correct.
-##
-## We then go on to the options that are again retrieved from the top HashMap
-## with key 'options'. For each option a boolean argument is created and the
-## name is retrieved from the option HashMap with key 'name'
-##
- public static LogMessage ${message.methodName}(#foreach($parameter in ${message.parameters})${parameter.type} ${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end
-#end#if(${message.parameters.size()} > 0 && ${message.options.size()} > 0), #end#foreach($option in ${message.options})boolean ${option.name}#if (${velocityCount} != ${message.options.size()} ), #end#end)
- {
- String rawMessage = _messages.getString("${message.name}");
-## If we have some options then we need to build the message based
-## on those values so only provide that logic if we need it.
-#if(${message.options.size()} > 0)
- StringBuffer msg = new StringBuffer();
-
- // Split the formatted message up on the option values so we can
- // rebuild the message based on the configured options.
- String[] parts = rawMessage.split("\\[");
- msg.append(parts[0]);
-
- int end;
- if (parts.length > 1)
- {
-## For Each Optional value check if it has been enabled and then
-## append it to the log.
-#foreach($option in ${message.options})
-
- // Add Option : ${option.value}.
- end = parts[${velocityCount}].indexOf(']');
- if (${option.name})
- {
- msg.append(parts[${velocityCount}].substring(0, end));
- }
-
- // Use 'end + 1' to remove the ']' from the output
- msg.append(parts[${velocityCount}].substring(end + 1));
-#end
- }
-
- rawMessage = msg.toString();
-#end
-
-##
-## If we don't have any parameters then we don't need the overhead of using the
-## message formatter so we can just set our return message to the retreived
-## fixed string. So we don't need to create a new MessageFormat
-##
-## Here we setup rawMessage to be the formatted message ready for direct return
-## with the message.name or further processing to remove options.
-##
-#if(${message.parameters.size()} > 0)
- final Object[] messageArguments = {#foreach($parameter in ${message.parameters})${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end#end};
- // Create a new MessageFormat to ensure thread safety.
- // Sharing a MessageFormat and using applyPattern is not thread safe
- MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
-
- final String message = formatter.format(messageArguments);
-#else
-## If we have no parameters then we can skip the formating and set the log
- final String message = rawMessage;
-#end
-
- return new LogMessage()
- {
- public String toString()
- {
- return message;
- }
-
- public String getLogHierarchy()
- {
- return ${message.methodName.toUpperCase()}_LOG_HIERARCHY;
- }
- };
- }
-
-#end
-
- private ${type.name}Messages()
- {
- }
-
-}
diff --git a/qpid/java/build.deps b/qpid/java/build.deps
index ebb6517738..67a67783c9 100644
--- a/qpid/java/build.deps
+++ b/qpid/java/build.deps
@@ -26,6 +26,8 @@ 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
+
derby-db=lib/required/derby-10.8.2.2.jar
geronimo-jms=lib/required/geronimo-jms_1.1_spec-1.0.jar
@@ -57,7 +59,8 @@ jetty-servlet=lib/required/jetty-servlet-7.6.10.v20130312.jar
jetty-websocket=lib/required/jetty-websocket-7.6.10.v20130312.jar
servlet-api=${geronimo-servlet}
-dojo=lib/required/dojo-war-1.8.3.war
+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
@@ -72,11 +75,14 @@ amqp-1-0-client.libs=
amqp-1-0-client-example.libs=${commons-cli}
amqp-1-0-client-jms.libs=${geronimo-jms}
tools.libs=${commons-configuration.libs} ${log4j}
-broker.libs=${commons-cli} ${commons-logging} ${log4j} ${slf4j-log4j} \
+broker-core.libs=${commons-cli} ${commons-logging} ${log4j} ${slf4j-log4j} \
${xalan} ${derby-db} ${commons-configuration.libs} \
- ${jackson-core} ${jackson-mapper} ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket}
+ ${jackson-core} ${jackson-mapper} ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket} ${bcel}
+
+#Borrow the broker-core libs, hack for release binary generation
+broker.libs=${broker-core.libs}
-broker-plugins-management-http.libs=${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jackson-core} ${jackson-mapper}
+broker-plugins-management-http.libs=${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jackson-core} ${jackson-mapper} ${dojo}
broker-plugins.libs=${log4j} ${commons-configuration.libs}
test.libs=${slf4j-log4j} ${log4j} ${junit} ${slf4j-api} ${mockito-all}
@@ -87,11 +93,13 @@ management-common.libs=
common.test.libs=${test.libs}
broker.test.libs=${test.libs}
+broker-core.test.libs=${test.libs}
client.test.libs=${test.libs}
client-example.test.libs=${test.libs}
tools.test.libs=
systests.libs=${test.libs}
perftests.test.libs=${test.libs}
+qpid-test-utils.libs = ${test.libs} ${geronimo-jms}
broker-plugins-access-control.test.libs=${test.libs}
broker-plugins-management-http.test.libs=${test.libs}
@@ -110,7 +118,7 @@ jca.libs=${geronimo-j2ee} ${geronimo-jta} ${geronimo-jms} ${geronimo-openejb} ${
jca.test.libs=${test.libs}
# optional bdbstore module deps
-bdb-je=lib/bdbstore/je-5.0.84.jar
+bdb-je=lib/bdbstore/je-5.0.97.jar
bdbstore.libs=${bdb-je}
bdbstore.test.libs=${test.libs}
diff --git a/qpid/java/build.xml b/qpid/java/build.xml
index 5d2269d2d4..e761677f6d 100644
--- a/qpid/java/build.xml
+++ b/qpid/java/build.xml
@@ -23,7 +23,7 @@
<import file="common.xml"/>
<property name="optional" value="false"/>
- <property name="modules.opt.default" value="bdbstore bdbstore/jmx perftests/visualisation-jfc"/>
+ <property name="modules.opt.default" value="bdbstore bdbstore/jmx bdbstore/systests perftests/visualisation-jfc"/>
<condition property="modules.opt" value="" else="${modules.opt.default}">
<isfalse value="${optional}"/>
</condition>
@@ -34,7 +34,7 @@
<findSubProjects name="broker-plugins" dir="broker-plugins" excludes="${broker-plugins-exclude}"/>
<findSubProjects name="client-plugins" dir="client-plugins"/>
- <property name="modules.core" value="common management/common amqp-1-0-common broker client amqp-1-0-client amqp-1-0-client-jms tools"/>
+ <property name="modules.core" value="qpid-test-utils common management/common amqp-1-0-common broker-core broker client amqp-1-0-client amqp-1-0-client-jms tools"/>
<property name="modules.examples" value="client/example management/example amqp-1-0-client/example amqp-1-0-client-jms/example"/>
<property name="modules.tests" value="systests perftests"/>
<property name="modules.plugin" value="${broker-plugins} ${client-plugins}"/>
diff --git a/qpid/java/client/build.xml b/qpid/java/client/build.xml
index 707bfda024..0375b83c65 100644
--- a/qpid/java/client/build.xml
+++ b/qpid/java/client/build.xml
@@ -21,7 +21,7 @@
<project name="AMQ Client" default="build">
<property name="module.depends" value="common"/>
- <property name="module.test.depends" value="common/tests" />
+ <property name="module.test.depends" value="qpid-test-utils" />
<property name="module.genpom" value="true"/>
<property name="module.genpom.args" value="-Sgeronimo-jms_1.1_spec=provided"/>
diff --git a/qpid/java/client/pom.xml b/qpid/java/client/pom.xml
new file mode 100644
index 0000000000..e97b5b7a0d
--- /dev/null
+++ b/qpid/java/client/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-client</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </testResource>
+ <testResource>
+ <directory>${basedir}/src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/qpid-client-bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/client/src/main/assembly/qpid-client-bin.xml b/qpid/java/client/src/main/assembly/qpid-client-bin.xml
new file mode 100644
index 0000000000..cc48890fa0
--- /dev/null
+++ b/qpid/java/client/src/main/assembly/qpid-client-bin.xml
@@ -0,0 +1,27 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <baseDirectory>qpid-client/${project.version}</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
index a8fdaeb65c..0329deee03 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
@@ -80,4 +80,6 @@ public interface AMQConnectionDelegate
boolean isSupportedServerFeature(final String featureName);
void setHeartbeatListener(HeartbeatListener listener);
+
+ boolean supportsIsBound();
}
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
index 69e79d42a0..66590aa0d7 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
@@ -530,4 +530,11 @@ public class AMQConnectionDelegate_0_10 implements AMQConnectionDelegate, Connec
}
return true;
}
+
+ @Override
+ public boolean supportsIsBound()
+ {
+ //0-10 supports the isBound method
+ return true;
+ }
}
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
index 67d7c2a78c..340aca70eb 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
@@ -22,7 +22,6 @@ package org.apache.qpid.client;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.qpid.AMQException;
import org.apache.qpid.client.failover.FailoverException;
import org.apache.qpid.client.failover.FailoverProtectedOperation;
@@ -35,13 +34,14 @@ import org.apache.qpid.framing.BasicQosBody;
import org.apache.qpid.framing.BasicQosOkBody;
import org.apache.qpid.framing.ChannelOpenBody;
import org.apache.qpid.framing.ChannelOpenOkBody;
+import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.framing.ProtocolVersion;
import org.apache.qpid.framing.TxSelectBody;
import org.apache.qpid.framing.TxSelectOkBody;
import org.apache.qpid.jms.BrokerDetails;
import org.apache.qpid.jms.ChannelLimitReachedException;
import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.ssl.SSLContextFactory;
+import org.apache.qpid.properties.ConnectionStartProperties;
import org.apache.qpid.transport.ConnectionSettings;
import org.apache.qpid.transport.network.NetworkConnection;
import org.apache.qpid.transport.network.OutgoingNetworkTransport;
@@ -51,11 +51,10 @@ import org.apache.qpid.transport.network.security.SecurityLayerFactory;
import javax.jms.JMSException;
import javax.jms.XASession;
-import javax.net.ssl.SSLContext;
+
import java.io.IOException;
import java.net.ConnectException;
import java.nio.channels.UnresolvedAddressException;
-import java.security.GeneralSecurityException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.EnumSet;
@@ -384,4 +383,33 @@ public class AMQConnectionDelegate_8_0 implements AMQConnectionDelegate
{
_conn.getProtocolHandler().setHeartbeatListener(listener);
}
+
+ @Override
+ public boolean supportsIsBound()
+ {
+ //Rough check whether the 'isBound' AMQP extension method is supported, by trying to determine if we are connected to Qpid.
+ //As older versions of the Qpid broker did not send properties, the value will be assumed true if no server properties
+ //are found, or the 'product' entry isn't present, and will only be false if it is present but doesn't match expectation.
+ boolean connectedToQpid = true;
+
+ FieldTable serverProperties = _conn.getProtocolHandler().getProtocolSession().getConnectionStartServerProperties();
+ if(serverProperties != null)
+ {
+ if(serverProperties.containsKey(ConnectionStartProperties.PRODUCT))
+ {
+ //String.valueof to ensure it is non-null, then lowercase it
+ String product = String.valueOf(serverProperties.getString(ConnectionStartProperties.PRODUCT)).toLowerCase();
+
+ //value is "unknown" when the naming properties file hasn't been found, e.g in IDE.
+ connectedToQpid = product.contains("qpid") || product.equals("unknown");
+ }
+ }
+
+ if(_logger.isDebugEnabled())
+ {
+ _logger.debug("supportsIsBound: " + connectedToQpid);
+ }
+
+ return connectedToQpid;
+ }
}
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
index 9a9da62f2a..3ff7416d8f 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
@@ -397,10 +397,19 @@ public class AMQSession_0_8 extends AMQSession<BasicMessageConsumer_0_8, BasicMe
}
}
+ /**
+ * Checks if a particular queue is bound to an exchange with a given key.
+ *
+ * Returns false if not connected to a Qpid broker which supports the necessary AMQP extension.
+ */
@Override
protected boolean isBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey)
throws AMQException
{
+ if(!getAMQConnection().getDelegate().supportsIsBound())
+ {
+ return false;
+ }
AMQMethodEvent response = new FailoverNoopSupport<AMQMethodEvent, AMQException>(
new FailoverProtectedOperation<AMQMethodEvent, AMQException>()
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java
index bb270b0878..3cb723e5a8 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java
@@ -24,6 +24,7 @@ import org.apache.qpid.AMQException;
import org.apache.qpid.client.message.AMQMessageDelegate_0_8;
import org.apache.qpid.client.message.AbstractJMSMessage;
import org.apache.qpid.client.protocol.AMQProtocolHandler;
+import org.apache.qpid.configuration.ClientProperties;
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.BasicContentHeaderProperties;
import org.apache.qpid.framing.BasicPublishBody;
@@ -32,7 +33,6 @@ import org.apache.qpid.framing.ContentBody;
import org.apache.qpid.framing.ContentHeaderBody;
import org.apache.qpid.framing.ExchangeDeclareBody;
import org.apache.qpid.framing.MethodRegistry;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,12 +40,14 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.Topic;
+
import java.nio.ByteBuffer;
import java.util.UUID;
public class BasicMessageProducer_0_8 extends BasicMessageProducer
{
- private static final Logger _logger = LoggerFactory.getLogger(BasicMessageProducer_0_8.class);
+ private static final Logger _logger = LoggerFactory.getLogger(BasicMessageProducer_0_8.class);
+ private static final boolean SET_EXPIRATION_AS_TTL = Boolean.getBoolean(ClientProperties.SET_EXPIRATION_AS_TTL);
BasicMessageProducer_0_8(AMQConnection connection, AMQDestination destination, boolean transacted, int channelId,
AMQSession session, AMQProtocolHandler protocolHandler, long producerId, Boolean immediate, Boolean mandatory) throws AMQException
@@ -118,7 +120,16 @@ public class BasicMessageProducer_0_8 extends BasicMessageProducer
if (timeToLive > 0)
{
- contentHeaderProperties.setExpiration(currentTime + timeToLive);
+ if(!SET_EXPIRATION_AS_TTL)
+ {
+ //default behaviour used by Qpid
+ contentHeaderProperties.setExpiration(currentTime + timeToLive);
+ }
+ else
+ {
+ //alternative behaviour for brokers interpreting the expiration header directly as a TTL.
+ contentHeaderProperties.setExpiration(timeToLive);
+ }
}
else
{
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java b/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
index 366b5f115e..b0c30f82fa 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
@@ -168,6 +168,8 @@ public class ConnectionStartMethodHandler implements StateAwareMethodListener<Co
ConnectionStartProperties.getPID());
FieldTable serverProperties = body.getServerProperties();
+ session.setConnectionStartServerProperties(serverProperties);
+
ConnectionURL url = getConnectionURL(session);
_closeWhenNoRouteHelper.setClientProperties(clientProperties, url, serverProperties);
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
index b26d67783d..ea0319c9df 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
@@ -129,7 +129,7 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate
if (subject != null)
{
messageProps.getApplicationHeaders().remove(QpidMessageProperties.QPID_SUBJECT);
- messageProps.getApplicationHeaders().put("JMS_" + QpidMessageProperties.QPID_SUBJECT,subject);
+ messageProps.getApplicationHeaders().put("JMS_" + QpidMessageProperties.QPID_SUBJECT_JMS_PROPER,subject);
}
}
dest = (AMQDestination) convertToAddressBasedDestination(_deliveryProps.getExchange(),
@@ -746,7 +746,7 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate
}
else if (isStrictJMS && QpidMessageProperties.QPID_SUBJECT.equals(propertyName))
{
- return (String)getApplicationHeaders().get("JMS_" + QpidMessageProperties.QPID_SUBJECT);
+ return (String)getApplicationHeaders().get("JMS_" + QpidMessageProperties.QPID_SUBJECT_JMS_PROPER);
}
else
{
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/message/QpidMessageProperties.java b/qpid/java/client/src/main/java/org/apache/qpid/client/message/QpidMessageProperties.java
index 663dfd39b1..21bb206349 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/message/QpidMessageProperties.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/message/QpidMessageProperties.java
@@ -30,6 +30,7 @@ public class QpidMessageProperties
}
public static final String QPID_SUBJECT = "qpid.subject";
+ public static final String QPID_SUBJECT_JMS_PROPER = "qpid_subject";
// AMQP 0-10 related properties
public static final String AMQP_0_10_APP_ID = "x-amqp-0-10.app-id";
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/QpidQueueOptions.java b/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/QpidQueueOptions.java
index 04aa7d146f..5b6c027f4a 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/QpidQueueOptions.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/QpidQueueOptions.java
@@ -27,7 +27,6 @@ public class QpidQueueOptions extends HashMap<String,Object>
public static final String QPID_MAX_COUNT = "qpid.max_count";
public static final String QPID_MAX_SIZE = "qpid.max_size";
public static final String QPID_POLICY_TYPE = "qpid.policy_type";
- public static final String QPID_PERSIST_LAST_NODE = "qpid.persist_last_node";
public static final String QPID_LVQ_KEY = "qpid.LVQ_key";
public static final String QPID_LAST_VALUE_QUEUE = "qpid.last_value_queue";
public static final String QPID_LAST_VALUE_QUEUE_NO_BROWSE = "qpid.last_value_queue_no_browse";
@@ -60,11 +59,7 @@ public class QpidQueueOptions extends HashMap<String,Object>
this.put(QPID_MAX_SIZE, i);
}
- public void setPersistLastNode()
- {
- this.put(QPID_PERSIST_LAST_NODE, 1);
- }
-
+
public void setOrderingPolicy(String s)
{
if (QpidQueueOptions.QPID_LAST_VALUE_QUEUE.equals(s))
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
index aed10cf15f..67bd8de846 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
@@ -22,7 +22,6 @@ package org.apache.qpid.client.protocol;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQSession;
@@ -36,6 +35,7 @@ import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.ContentBody;
import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.framing.HeartbeatBody;
import org.apache.qpid.framing.MethodDispatcher;
import org.apache.qpid.framing.MethodRegistry;
@@ -101,6 +101,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
private final AMQConnection _connection;
private ConnectionTuneParameters _connectionTuneParameters;
+ private FieldTable _connectionStartServerProperties;
private SaslClient _saslClient;
@@ -529,4 +530,14 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
{
return _connection;
}
+
+ public void setConnectionStartServerProperties(FieldTable serverProperties)
+ {
+ _connectionStartServerProperties = serverProperties;
+ }
+
+ public FieldTable getConnectionStartServerProperties()
+ {
+ return _connectionStartServerProperties;
+ }
}
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/client/AMQSession_0_8Test.java b/qpid/java/client/src/test/java/org/apache/qpid/client/AMQSession_0_8Test.java
index d9caa68ef8..c56cf9a72b 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/client/AMQSession_0_8Test.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/client/AMQSession_0_8Test.java
@@ -21,10 +21,10 @@
package org.apache.qpid.client;
import org.apache.qpid.AMQException;
+import org.apache.qpid.client.transport.TestNetworkConnection;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.amqp_0_91.QueueDeclareOkBodyImpl;
import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.transport.TestNetworkConnection;
import org.apache.qpid.transport.network.NetworkConnection;
import org.apache.qpid.url.AMQBindingURL;
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10Test.java b/qpid/java/client/src/test/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10Test.java
index 3afeb79ac3..68f678c1b8 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10Test.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10Test.java
@@ -124,7 +124,7 @@ public class AMQMessageDelegate_0_10Test extends QpidTestCase
for (Enumeration props = delegate.getPropertyNames(); props.hasMoreElements();)
{
String key = (String)props.nextElement();
- if (key.equals("JMS_" + QpidMessageProperties.QPID_SUBJECT))
+ if (key.equals("JMS_" + QpidMessageProperties.QPID_SUBJECT_JMS_PROPER))
{
propFound = true;
}
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java b/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
index 9a5ca33174..4c9448cb39 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
@@ -28,12 +28,12 @@ import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQAuthenticationException;
import org.apache.qpid.client.MockAMQConnection;
import org.apache.qpid.client.state.AMQState;
+import org.apache.qpid.client.transport.TestNetworkConnection;
import org.apache.qpid.framing.AMQBody;
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.framing.amqp_8_0.BasicRecoverOkBodyImpl;
import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.transport.TestNetworkConnection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/client/transport/MockSender.java b/qpid/java/client/src/test/java/org/apache/qpid/client/transport/MockSender.java
new file mode 100644
index 0000000000..7c3988c19a
--- /dev/null
+++ b/qpid/java/client/src/test/java/org/apache/qpid/client/transport/MockSender.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.client.transport;
+
+import java.nio.ByteBuffer;
+
+import org.apache.qpid.transport.Sender;
+
+public class MockSender implements Sender<ByteBuffer>
+{
+
+ public void setIdleTimeout(int i)
+ {
+
+ }
+
+ public void send(ByteBuffer msg)
+ {
+
+ }
+
+ public void flush()
+ {
+
+ }
+
+ public void close()
+ {
+
+ }
+}
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/client/transport/TestNetworkConnection.java b/qpid/java/client/src/test/java/org/apache/qpid/client/transport/TestNetworkConnection.java
new file mode 100644
index 0000000000..1ec217e468
--- /dev/null
+++ b/qpid/java/client/src/test/java/org/apache/qpid/client/transport/TestNetworkConnection.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.client.transport;
+
+import java.security.Principal;
+import org.apache.qpid.protocol.ProtocolEngineFactory;
+import org.apache.qpid.ssl.SSLContextFactory;
+import org.apache.qpid.transport.NetworkTransportConfiguration;
+import org.apache.qpid.transport.Sender;
+import org.apache.qpid.transport.network.NetworkConnection;
+
+import java.net.BindException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * Test implementation of IoSession, which is required for some tests. Methods not being used are not implemented,
+ * so if this class is being used and some methods are to be used, then please update those.
+ */
+public class TestNetworkConnection implements NetworkConnection
+{
+ private String _remoteHost = "127.0.0.1";
+ private String _localHost = "127.0.0.1";
+ private int _port = 1;
+ private SocketAddress _localAddress = null;
+ private SocketAddress _remoteAddress = null;
+ private final MockSender _sender;
+
+ public TestNetworkConnection()
+ {
+ _sender = new MockSender();
+ }
+
+
+
+ public void bind(int port, InetAddress[] addresses, ProtocolEngineFactory protocolFactory,
+ NetworkTransportConfiguration config, SSLContextFactory sslFactory) throws BindException
+ {
+
+ }
+
+ public SocketAddress getLocalAddress()
+ {
+ return (_localAddress != null) ? _localAddress : new InetSocketAddress(_localHost, _port);
+ }
+
+ public SocketAddress getRemoteAddress()
+ {
+ return (_remoteAddress != null) ? _remoteAddress : new InetSocketAddress(_remoteHost, _port);
+ }
+
+ public void setMaxReadIdle(int idleTime)
+ {
+
+ }
+
+ @Override
+ public void setPeerPrincipal(Principal principal)
+ {
+ }
+
+ @Override
+ public Principal getPeerPrincipal()
+ {
+ return null;
+ }
+
+ @Override
+ public int getMaxReadIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public int getMaxWriteIdle()
+ {
+ return 0;
+ }
+
+ public void setMaxWriteIdle(int idleTime)
+ {
+
+ }
+
+ public void close()
+ {
+
+ }
+
+ public void flush()
+ {
+
+ }
+
+ public void send(ByteBuffer msg)
+ {
+
+ }
+
+ public void setIdleTimeout(int i)
+ {
+
+ }
+
+ public void setPort(int port)
+ {
+ _port = port;
+ }
+
+ public int getPort()
+ {
+ return _port;
+ }
+
+ public void setLocalHost(String host)
+ {
+ _localHost = host;
+ }
+
+ public void setRemoteHost(String host)
+ {
+ _remoteHost = host;
+ }
+
+ public void setLocalAddress(SocketAddress address)
+ {
+ _localAddress = address;
+ }
+
+ public void setRemoteAddress(SocketAddress address)
+ {
+ _remoteAddress = address;
+ }
+
+ public Sender<ByteBuffer> getSender()
+ {
+ return _sender;
+ }
+
+ public void start()
+ {
+ }
+}
diff --git a/qpid/java/common.xml b/qpid/java/common.xml
index c47cab2ac7..005dd261b4 100644
--- a/qpid/java/common.xml
+++ b/qpid/java/common.xml
@@ -50,8 +50,8 @@
<property name="build.coverage.src" location="${build}/coverage/src"/>
<property name="build.findbugs" location="${build}/findbugs"/>
- <property name="java.target" value="1.5"/>
- <property name="java.source" value="1.5"/>
+ <property name="java.target" value="1.6"/>
+ <property name="java.source" value="1.6"/>
<property name="release" location="${project.root}/release"/>
@@ -286,8 +286,8 @@
<!-- targets for downloading ivy and retrieving dependencies -->
<target name="retrieve-dependencies" depends="load-ivy, configure-ivy, retrieve-optional-dependencies" unless="${ivy.dont.retrieve}">
<echo message="Resolving and retrieving dependencies..."/>
- <ivy:resolve type="jar,bundle,war" file="${project.root}/ivy.retrieve.xml" conf="required"/>
- <ivy:retrieve type="jar,bundle,war" conf="required" sync="true"
+ <ivy:resolve type="jar,bundle,zip" file="${project.root}/ivy.retrieve.xml" conf="required"/>
+ <ivy:retrieve type="jar,bundle,zip" conf="required" sync="true"
pattern="${project.root}/lib/required/[artifact]-[revision].[ext]" />
</target>
@@ -314,7 +314,7 @@
fail so long as Ivy is in at least one of the locations. -->
<mkdir dir="${ivy.jar.dir}"/>
<path id="ivy.lib.path">
- <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+ <fileset dir="${ivy.jar.dir}" includes="*${ivy.install.version}*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
diff --git a/qpid/java/common/Composite.tpl b/qpid/java/common/Composite.tpl
index 2b2f8fda09..b03f002f16 100644
--- a/qpid/java/common/Composite.tpl
+++ b/qpid/java/common/Composite.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/Constant.tpl b/qpid/java/common/Constant.tpl
index da4233c847..911f790bcf 100644
--- a/qpid/java/common/Constant.tpl
+++ b/qpid/java/common/Constant.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/Enum.tpl b/qpid/java/common/Enum.tpl
index 0835d34a20..79ade419c5 100644
--- a/qpid/java/common/Enum.tpl
+++ b/qpid/java/common/Enum.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/Invoker.tpl b/qpid/java/common/Invoker.tpl
index 2087710517..3f317f96df 100644
--- a/qpid/java/common/Invoker.tpl
+++ b/qpid/java/common/Invoker.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/MethodDelegate.tpl b/qpid/java/common/MethodDelegate.tpl
index 27e20a7ef2..fd3e069b6b 100644
--- a/qpid/java/common/MethodDelegate.tpl
+++ b/qpid/java/common/MethodDelegate.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/Option.tpl b/qpid/java/common/Option.tpl
index c22b35b999..fc85d6b2f5 100644
--- a/qpid/java/common/Option.tpl
+++ b/qpid/java/common/Option.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/StructFactory.tpl b/qpid/java/common/StructFactory.tpl
index 09c669f74e..6e7d1158cd 100644
--- a/qpid/java/common/StructFactory.tpl
+++ b/qpid/java/common/StructFactory.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/Type.tpl b/qpid/java/common/Type.tpl
index 4635c4e367..31ac02af73 100644
--- a/qpid/java/common/Type.tpl
+++ b/qpid/java/common/Type.tpl
@@ -1,6 +1,6 @@
package org.apache.qpid.transport;
/*
- *
+ *
* 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
@@ -8,16 +8,16 @@ package org.apache.qpid.transport;
* 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.
- *
+ *
*/
diff --git a/qpid/java/common/bin/qpid-jaddr b/qpid/java/common/bin/qpid-jaddr
index d456171bf1..269a5379a0 100755
--- a/qpid/java/common/bin/qpid-jaddr
+++ b/qpid/java/common/bin/qpid-jaddr
@@ -23,8 +23,8 @@ if [ -z "$QPID_HOME" ]; then
export PATH=${PATH}:${QPID_HOME}/bin
fi
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
+# Set classpath to include Qpid jars
+QPID_LIBS="$QPID_HOME/lib/*"
# Set other variables used by the qpid-run script before calling
export JAVA=java \
diff --git a/qpid/java/common/build-generate-sources.xml b/qpid/java/common/build-generate-sources.xml
new file mode 100644
index 0000000000..339887f3dd
--- /dev/null
+++ b/qpid/java/common/build-generate-sources.xml
@@ -0,0 +1,115 @@
+<!--
+ -
+ - 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.
+ -
+ -->
+<project name="Qpid Common Generate Sources" default="generate-sources">
+
+ <fail message="A required property was not set">
+ <condition>
+ <not>
+ <and>
+ <isset property="generated-amqp-0-8-dir"/>
+ <isset property="generated-amqp-0-10-dir"/>
+ <isset property="gentools.classes"/>
+ <isset property="version.file"/>
+ </and>
+ </not>
+ </condition>
+ </fail>
+
+ <condition property="generate.protocol.sources" value="true">
+ <istrue value="${generate}"/>
+ </condition>
+
+ <property name="mllib.dir" value="${basedir}/../../python"/>
+ <property name="xml.spec.dir" value="${basedir}/../../specs"/>
+
+ <property name="xml.spec.0-8" value="amqp0-8-qpid.stripped.xml"/>
+ <property name="xml.spec.0-9" value="amqp0-9-qpid.stripped.xml"/>
+ <property name="xml.spec.0-9-1" value="amqp0-9-1.stripped.xml"/>
+ <property name="xml.spec.0-10" value="amqp.0-10-qpid-errata.stripped.xml"/>
+ <property name="xml.spec.deps.0-8" value="${xml.spec.0-8} ${xml.spec.0-9} ${xml.spec.0-9-1}"/>
+ <property name="xml.spec.list.0-8" value='"${xml.spec.dir}/${xml.spec.0-8}" "${xml.spec.dir}/${xml.spec.0-9}" "${xml.spec.dir}/${xml.spec.0-9-1}"'/>
+
+ <property name="gentools.src" value="${basedir}/gentools/src"/>
+ <property name="generated.package" value="org/apache/qpid/framing" />
+
+ <property file="${version.file}" prefix="old."/>
+
+ <target name="check-version">
+ <exec executable="svnversion" spawn="false" failifexecutionfails="false"
+ dir="${basedir}" outputproperty="svnversion.output">
+ <arg line="."/>
+ </exec>
+ <condition property="version.stale">
+ <not>
+ <equals arg1="${svnversion.output}" arg2="${old.qpid.svnversion}"/>
+ </not>
+ </condition>
+ </target>
+
+ <target name="create-version" depends="check-version" if="version.stale">
+ <echo message="Writing new qpidversion.properties file with svnversion: '${svnversion.output}'"/>
+ <!-- Write the version.properties out.-->
+ <!-- Echos exactly as shown, so leave no spaces before/after lines -->
+ <echo file="${version.file}" append="false">qpid.version=${project.version}
+qpid.svnversion=${svnversion.output}
+qpid.name=qpid
+</echo>
+ </target>
+
+ <target name="amqp-0-10-generation" if="generate.protocol.sources">
+ <mkdir dir="${generated-amqp-0-10-dir}"/>
+ <echo message="Generating AMQP 0-10 protocol classes..."/>
+ <java classname="org.python.util.jython" dir="${generated-amqp-0-10-dir}" fork="true" failonerror="true">
+ <arg value="${basedir}/codegen"/>
+ <arg value="${generated-amqp-0-10-dir}"/>
+ <arg value="${xml.spec.dir}/${xml.spec.0-10}"/>
+ <arg value="${basedir}"/>
+ <classpath>
+ <path refid="source.generation.classpathref"/>
+ </classpath>
+ <sysproperty key="python.path" value ="${mllib.dir}"/>
+ </java>
+ </target>
+
+ <target name="compile-gentools">
+ <mkdir dir="${gentools.classes}"/>
+ <javac srcdir="${gentools.src}" destdir="${gentools.classes}" source="${java.source}" target="${java.target}" fork="true" includeantruntime="false">
+ <classpath>
+ <path refid="source.generation.classpathref"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="amqp-0-8-generation" depends="compile-gentools" if="generate.protocol.sources">
+ <mkdir dir="${generated-amqp-0-8-dir}/${generated.package}"/>
+ <echo message="Generating AMQP 0-8/0-9/0-9-1 protocol classes..."/>
+ <java classname="org.apache.qpid.gentools.Main" fork="true" dir="${gentools.classes}" failonerror="true">
+ <arg line='-j -o "${generated-amqp-0-8-dir}/${generated.package}" -t "${basedir}/templates" ${xml.spec.list.0-8}'/>
+ <classpath>
+ <pathelement path="${gentools.classes}" />
+ <path refid="source.generation.classpathref"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="generate-sources" depends="amqp-0-8-generation, amqp-0-10-generation, create-version"/>
+
+</project>
diff --git a/qpid/java/common/build.xml b/qpid/java/common/build.xml
index 1316017909..c2f777b18b 100644
--- a/qpid/java/common/build.xml
+++ b/qpid/java/common/build.xml
@@ -20,89 +20,35 @@
-->
<project name="AMQ Common" default="build">
+ <property name="module.test.depends" value="qpid-test-utils" />
<property name="module.genpom" value="true"/>
<import file="../module.xml"/>
- <property name="generated.package" value="org/apache/qpid/framing" />
- <property name="framing.generated.dir" location="${module.precompiled}/${generated.package}" />
- <property name="qpidbuildversion.java" location="${module.precompiled}/org/apache/qpid/QpidBuildVersion.java" />
- <property name="xml.spec.dir" location="${project.root}/../specs" />
- <property name="xml.spec.deps" value="amqp0-8-qpid.stripped.xml amqp0-9-qpid.stripped.xml amqp0-9-1.stripped.xml" />
- <property name="xml.spec.list" value='"${xml.spec.dir}/amqp0-8-qpid.stripped.xml" "${xml.spec.dir}/amqp0-9-qpid.stripped.xml" "${xml.spec.dir}/amqp0-9-1.stripped.xml"' />
- <property name="gentools.timestamp" location="${framing.generated.dir}/gentools.timestamp" />
- <property name="jython.timestamp" location="${framing.generated.dir}/jython.timestamp" />
- <property name="selector.output.dir" value="${module.precompiled}/org/apache/qpid/filter/selector"/>
+ <property name="selector.output.dir" value="${module.src}/org/apache/qpid/filter/selector"/>
- <target name="check_jython_deps">
- <uptodate property="jython.notRequired" targetfile="${jython.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="amqp.0-10-qpid-errata.stripped.xml" />
- </uptodate>
- </target>
-
- <target name="jython" depends="check_jython_deps" unless="jython.notRequired">
- <jython path="${mllib.dir}">
- <args>
- <arg value="${basedir}/codegen"/>
- <arg value="${module.precompiled}"/>
- <arg value="${xml.spec.dir}/amqp.0-10-qpid-errata.stripped.xml"/>
- <arg value="${basedir}"/>
- </args>
- </jython>
- <touch file="${jython.timestamp}" />
- </target>
-
- <target name="compile_gentools">
- <mkdir dir="${gentools.build}/classes"/>
- <javac srcdir="${gentools.home}/src" destdir="${gentools.build}/classes" source="${java.source}" target="${java.target}" fork="true" includeantruntime="false">
- <classpath>
- <fileset dir="${project.root}">
- <include name="${velocity.jar}"/>
- <include name="${velocity-dep.jar}"/>
- </fileset>
- </classpath>
- </javac>
- </target>
-
- <target name="check_gentool_deps">
- <uptodate property="gentools.notRequired" targetfile="${gentools.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="${xml.spec.deps}" />
- </uptodate>
- </target>
+ <condition property="generate.selector.sources" value="true">
+ <istrue value="${generate}"/>
+ </condition>
- <target name="gentools" depends="compile_gentools,check_gentool_deps" unless="gentools.notRequired">
- <mkdir dir="${framing.generated.dir}"/>
- <java classname="org.apache.qpid.gentools.Main" fork="true" dir="${gentools.build}/classes" failonerror="true">
- <arg line='-j -o "${framing.generated.dir}" -t "${project.root}/common/templates" ${xml.spec.list}'/>
- <classpath>
- <pathelement path="${gentools.build}/classes" />
+ <path id="common.source.generation.classpathref">
+ <pathelement path="${project.root}/${jython}" />
<pathelement path="${project.root}/${velocity.jar}" />
<pathelement path="${project.root}/${velocity-dep.jar}" />
- </classpath>
- </java>
- <touch file="${gentools.timestamp}" />
- </target>
-
- <target name="build-version" depends="create-version" if="version-stale">
- <tstamp>
- <format property="build.time" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/>
- </tstamp>
-
- <echo file="${qpidbuildversion.java}" append="false">package org.apache.qpid;
-
-public class QpidBuildVersion
-{
- public static final String VERSION = "${project.version}";
- public static final String SVN_VERSION = "${svnversion.output}";
- public static final String BUILD_PROJECT = "${project.name}";
- public static final String BUILD_TIME = "${build.time}";
-
-}
-</echo>
-
+ </path>
+
+ <target name="generate-sources">
+ <ant antfile="build-generate-sources.xml">
+ <reference torefid="source.generation.classpathref" refid="common.source.generation.classpathref" />
+ <property name="generated-amqp-0-8-dir" value="${module.src}"/>
+ <property name="generated-amqp-0-10-dir" value="${module.src}"/>
+ <property name="gentools.classes" value="${build.scratch}/common/gentools/classes"/>
+ <property name="version.file" location="${module.classes}/qpidversion.properties"/>
+ </ant>
</target>
- <target name="jms-selector">
+ <target name="jms-selector" if="generate.selector.sources">
+ <echo>Generating JMS selector sources</echo>
<copy tofile="${module.build}/javacc.jar" failonerror="true">
<fileset dir="${project.root}/lib/required">
<include name="javacc-*.jar"/>
@@ -114,7 +60,7 @@ public class QpidBuildVersion
javacchome="${module.build}"/>
</target>
- <target name="precompile" depends="gentools,jython,create-version,build-version,jms-selector"/>
+ <target name="precompile" depends="generate-sources,jms-selector"/>
<target name="bundle" depends="bundle-tasks"/>
diff --git a/qpid/java/common/pom.xml b/qpid/java/common/pom.xml
new file mode 100644
index 0000000000..7aa4cd2a0c
--- /dev/null
+++ b/qpid/java/common/pom.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-common</artifactId>
+
+ <properties>
+ <!-- used during the antrun-plugin execution -->
+ <generated-amqp-0-8-dir>${basedir}/src/main/java</generated-amqp-0-8-dir>
+ <generated-amqp-0-10-dir>${basedir}/src/main/java</generated-amqp-0-10-dir>
+ <selector.output.dir>${basedir}/src/main/java/org/apache/qpid/filter/selector</selector.output.dir>
+ <version.file>${project.build.directory}/classes/qpidversion.properties</version.file>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>${basedir}/src/test/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </testResource>
+ <testResource>
+ <directory>${basedir}/src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>amqp-0-8-generated</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <ant antfile="build-generate-sources.xml">
+ <reference torefid="source.generation.classpathref" refid="maven.plugin.classpath" />
+ <property name="gentools.classes" value="${project.build.directory}/gentools-classes"/>
+ <property name="build.compiler" value="extJavac"/>
+ </ant>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.python</groupId>
+ <artifactId>jython-standalone</artifactId>
+ <version>2.5.3</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>generate-sources-common</id>
+ <activation>
+ <property>
+ <name>generate</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>jms-selector-generated</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${selector.output.dir}</outputDirectory>
+ <sourceDirectory>src/main/grammar</sourceDirectory>
+ <includes>
+ <include>SelectorParser.jj</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
index a0140785f4..51dad51bf9 100644
--- a/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
+++ b/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
@@ -208,6 +208,13 @@ public class ClientProperties
public static final String QPID_MAX_CACHED_ADDR_OPTION_STRINGS = "qpid.max_cached_address_option_strings";
public static final int DEFAULT_MAX_CACHED_ADDR_OPTION_STRINGS = 10;
+ /**
+ * System property to control whether the 0-8/0-9/0-9-1 client will set the message
+ * 'expiration' header using the computed expiration value (default, when false) or instead set
+ * it to the raw TTL (when true). May be necessary for interop with other vendors.
+ */
+ public static final String SET_EXPIRATION_AS_TTL = "qpid.set_expiration_as_ttl";
+
private ClientProperties()
{
//No instances
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java
new file mode 100644
index 0000000000..bf28ada12b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/ParseException.java
@@ -0,0 +1,208 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
+/* JavaCCOptions:KEEP_LINE_COL=null */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set.
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ )
+ {
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ }
+
+ /** Constructor with message. */
+ public ParseException(String message) {
+ super(message);
+ }
+
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser) the correct error message
+ * gets displayed.
+ */
+ private static String initialise(Token currentToken,
+ int[][] expectedTokenSequences,
+ String[] tokenImage) {
+ String eol = System.getProperty("line.separator", "\n");
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += " " + tokenImage[tok.kind];
+ retval += " \"";
+ retval += add_escapes(tok.image);
+ retval += " \"";
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ */
+ static String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+}
+/* JavaCC - OriginalChecksum=d315306e736475f86f69c53861799960 (do not edit this line) */
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java
new file mode 100644
index 0000000000..ed85de9d8e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java
@@ -0,0 +1,1224 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParser.java */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.PropertyExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
+ */
+public class SelectorParser implements SelectorParserConstants {
+
+ public SelectorParser()
+ {
+ this(new StringReader(""));
+ }
+
+ public BooleanExpression parse(String sql) throws ParseException
+ {
+ this.ReInit(new StringReader(sql));
+
+ return this.JmsSelector();
+
+ }
+
+ private BooleanExpression asBooleanExpression(Expression value) throws ParseException
+ {
+ if (value instanceof BooleanExpression)
+ {
+ return (BooleanExpression) value;
+ }
+ if (value instanceof PropertyExpression)
+ {
+ return UnaryExpression.createBooleanCast( value );
+ }
+ throw new ParseException("Expression will not result in a boolean value: " + value);
+ }
+
+// ----------------------------------------------------------------------------
+// Grammer
+// ----------------------------------------------------------------------------
+ final public BooleanExpression JmsSelector() throws ParseException {
+ Expression left=null;
+ left = orExpression();
+ {if (true) return asBooleanExpression(left);}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression orExpression() throws ParseException {
+ Expression left;
+ Expression right;
+ left = andExpression();
+ label_1:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case OR:
+ ;
+ break;
+ default:
+ break label_1;
+ }
+ jj_consume_token(OR);
+ right = andExpression();
+ left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression andExpression() throws ParseException {
+ Expression left;
+ Expression right;
+ left = equalityExpression();
+ label_2:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case AND:
+ ;
+ break;
+ default:
+ break label_2;
+ }
+ jj_consume_token(AND);
+ right = equalityExpression();
+ left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression equalityExpression() throws ParseException {
+ Expression left;
+ Expression right;
+ left = comparisonExpression();
+ label_3:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IS:
+ case 27:
+ case 28:
+ ;
+ break;
+ default:
+ break label_3;
+ }
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 27:
+ jj_consume_token(27);
+ right = comparisonExpression();
+ left = ComparisonExpression.createEqual(left, right);
+ break;
+ case 28:
+ jj_consume_token(28);
+ right = comparisonExpression();
+ left = ComparisonExpression.createNotEqual(left, right);
+ break;
+ default:
+ if (jj_2_1(2)) {
+ jj_consume_token(IS);
+ jj_consume_token(NULL);
+ left = ComparisonExpression.createIsNull(left);
+ } else {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IS:
+ jj_consume_token(IS);
+ jj_consume_token(NOT);
+ jj_consume_token(NULL);
+ left = ComparisonExpression.createIsNotNull(left);
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ }
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression comparisonExpression() throws ParseException {
+ Expression left;
+ Expression right;
+ Expression low;
+ Expression high;
+ String t, u;
+ boolean not;
+ ArrayList list;
+ left = addExpression();
+ label_4:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case NOT:
+ case BETWEEN:
+ case LIKE:
+ case IN:
+ case 29:
+ case 30:
+ case 31:
+ case 32:
+ ;
+ break;
+ default:
+ break label_4;
+ }
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 29:
+ jj_consume_token(29);
+ right = addExpression();
+ left = ComparisonExpression.createGreaterThan(left, right);
+ break;
+ case 30:
+ jj_consume_token(30);
+ right = addExpression();
+ left = ComparisonExpression.createGreaterThanEqual(left, right);
+ break;
+ case 31:
+ jj_consume_token(31);
+ right = addExpression();
+ left = ComparisonExpression.createLessThan(left, right);
+ break;
+ case 32:
+ jj_consume_token(32);
+ right = addExpression();
+ left = ComparisonExpression.createLessThanEqual(left, right);
+ break;
+ case LIKE:
+ u=null;
+ jj_consume_token(LIKE);
+ t = stringLiteral();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ESCAPE:
+ jj_consume_token(ESCAPE);
+ u = stringLiteral();
+ break;
+ default:
+ ;
+ }
+ left = ComparisonExpression.createLike(left, t, u);
+ break;
+ default:
+ if (jj_2_2(2)) {
+ u=null;
+ jj_consume_token(NOT);
+ jj_consume_token(LIKE);
+ t = stringLiteral();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ESCAPE:
+ jj_consume_token(ESCAPE);
+ u = stringLiteral();
+ break;
+ default:
+ ;
+ }
+ left = ComparisonExpression.createNotLike(left, t, u);
+ } else {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case BETWEEN:
+ jj_consume_token(BETWEEN);
+ low = addExpression();
+ jj_consume_token(AND);
+ high = addExpression();
+ left = ComparisonExpression.createBetween(left, low, high);
+ break;
+ default:
+ if (jj_2_3(2)) {
+ jj_consume_token(NOT);
+ jj_consume_token(BETWEEN);
+ low = addExpression();
+ jj_consume_token(AND);
+ high = addExpression();
+ left = ComparisonExpression.createNotBetween(left, low, high);
+ } else {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IN:
+ jj_consume_token(IN);
+ jj_consume_token(33);
+ t = stringLiteral();
+ list = new ArrayList();
+ list.add( t );
+ label_5:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 34:
+ ;
+ break;
+ default:
+ break label_5;
+ }
+ jj_consume_token(34);
+ t = stringLiteral();
+ list.add( t );
+ }
+ jj_consume_token(35);
+ left = ComparisonExpression.createInFilter(left, list);
+ break;
+ default:
+ if (jj_2_4(2)) {
+ jj_consume_token(NOT);
+ jj_consume_token(IN);
+ jj_consume_token(33);
+ t = stringLiteral();
+ list = new ArrayList();
+ list.add( t );
+ label_6:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 34:
+ ;
+ break;
+ default:
+ break label_6;
+ }
+ jj_consume_token(34);
+ t = stringLiteral();
+ list.add( t );
+ }
+ jj_consume_token(35);
+ left = ComparisonExpression.createNotInFilter(left, list);
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression addExpression() throws ParseException {
+ Expression left;
+ Expression right;
+ left = multExpr();
+ label_7:
+ while (true) {
+ if (jj_2_5(2147483647)) {
+ ;
+ } else {
+ break label_7;
+ }
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 36:
+ jj_consume_token(36);
+ right = multExpr();
+ left = ArithmeticExpression.createPlus(left, right);
+ break;
+ case 37:
+ jj_consume_token(37);
+ right = multExpr();
+ left = ArithmeticExpression.createMinus(left, right);
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression multExpr() throws ParseException {
+ Expression left;
+ Expression right;
+ left = unaryExpr();
+ label_8:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 38:
+ case 39:
+ case 40:
+ ;
+ break;
+ default:
+ break label_8;
+ }
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 38:
+ jj_consume_token(38);
+ right = unaryExpr();
+ left = ArithmeticExpression.createMultiply(left, right);
+ break;
+ case 39:
+ jj_consume_token(39);
+ right = unaryExpr();
+ left = ArithmeticExpression.createDivide(left, right);
+ break;
+ case 40:
+ jj_consume_token(40);
+ right = unaryExpr();
+ left = ArithmeticExpression.createMod(left, right);
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression unaryExpr() throws ParseException {
+ String s=null;
+ Expression left=null;
+ if (jj_2_6(2147483647)) {
+ jj_consume_token(36);
+ left = unaryExpr();
+ } else {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 37:
+ jj_consume_token(37);
+ left = unaryExpr();
+ left = UnaryExpression.createNegate(left);
+ break;
+ case NOT:
+ jj_consume_token(NOT);
+ left = unaryExpr();
+ left = UnaryExpression.createNOT( asBooleanExpression(left) );
+ break;
+ case TRUE:
+ case FALSE:
+ case NULL:
+ case DECIMAL_LITERAL:
+ case HEX_LITERAL:
+ case OCTAL_LITERAL:
+ case FLOATING_POINT_LITERAL:
+ case STRING_LITERAL:
+ case ID:
+ case QUOTED_ID:
+ case 33:
+ left = primaryExpr();
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Expression primaryExpr() throws ParseException {
+ Expression left=null;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case NULL:
+ case DECIMAL_LITERAL:
+ case HEX_LITERAL:
+ case OCTAL_LITERAL:
+ case FLOATING_POINT_LITERAL:
+ case STRING_LITERAL:
+ left = literal();
+ break;
+ case ID:
+ case QUOTED_ID:
+ left = variable();
+ break;
+ case 33:
+ jj_consume_token(33);
+ left = orExpression();
+ jj_consume_token(35);
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ConstantExpression literal() throws ParseException {
+ Token t;
+ String s;
+ ConstantExpression left=null;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case STRING_LITERAL:
+ s = stringLiteral();
+ left = new ConstantExpression(s);
+ break;
+ case DECIMAL_LITERAL:
+ t = jj_consume_token(DECIMAL_LITERAL);
+ left = ConstantExpression.createFromDecimal(t.image);
+ break;
+ case HEX_LITERAL:
+ t = jj_consume_token(HEX_LITERAL);
+ left = ConstantExpression.createFromHex(t.image);
+ break;
+ case OCTAL_LITERAL:
+ t = jj_consume_token(OCTAL_LITERAL);
+ left = ConstantExpression.createFromOctal(t.image);
+ break;
+ case FLOATING_POINT_LITERAL:
+ t = jj_consume_token(FLOATING_POINT_LITERAL);
+ left = ConstantExpression.createFloat(t.image);
+ break;
+ case TRUE:
+ jj_consume_token(TRUE);
+ left = ConstantExpression.TRUE;
+ break;
+ case FALSE:
+ jj_consume_token(FALSE);
+ left = ConstantExpression.FALSE;
+ break;
+ case NULL:
+ jj_consume_token(NULL);
+ left = ConstantExpression.NULL;
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String stringLiteral() throws ParseException {
+ Token t;
+ StringBuffer rc = new StringBuffer();
+ boolean first=true;
+ t = jj_consume_token(STRING_LITERAL);
+ // Decode the sting value.
+ String image = t.image;
+ for( int i=1; i < image.length()-1; i++ ) {
+ char c = image.charAt(i);
+ if( c == (char) 0x27 )//single quote
+ {
+ i++;
+ }
+ rc.append(c);
+ }
+ {if (true) return rc.toString();}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public PropertyExpression variable() throws ParseException {
+ Token t;
+ StringBuffer rc = new StringBuffer();
+ PropertyExpression left=null;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ID:
+ t = jj_consume_token(ID);
+ left = new PropertyExpression(t.image);
+ break;
+ case QUOTED_ID:
+ t = jj_consume_token(QUOTED_ID);
+ // Decode the sting value.
+ String image = t.image;
+ for( int i=1; i < image.length()-1; i++ ) {
+ char c = image.charAt(i);
+ if( c == '"' )
+ {
+ i++;
+ }
+ rc.append(c);
+ }
+ {if (true) return new PropertyExpression(rc.toString());}
+ break;
+ default:
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ {if (true) return left;}
+ throw new Error("Missing return statement in function");
+ }
+
+ private boolean jj_2_1(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_1(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_2_2(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_2(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_2_3(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_3(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_2_4(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_4(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_2_5(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_5(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_2_6(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_6(); }
+ catch(LookaheadSuccess ls) { return true; }
+ }
+
+ private boolean jj_3R_59() {
+ if (jj_scan_token(ESCAPE)) return true;
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_38() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_15() {
+ if (jj_3R_19()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_14() {
+ if (jj_scan_token(NOT)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_12() {
+ if (jj_scan_token(36)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_55() {
+ if (jj_scan_token(IN)) return true;
+ if (jj_scan_token(33)) return true;
+ if (jj_3R_38()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_60()) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(35)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_47() {
+ if (jj_scan_token(IS)) return true;
+ if (jj_scan_token(NOT)) return true;
+ if (jj_scan_token(NULL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_13() {
+ if (jj_scan_token(37)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_33() {
+ if (jj_scan_token(NULL)) return true;
+ return false;
+ }
+
+ private boolean jj_3_1() {
+ if (jj_scan_token(IS)) return true;
+ if (jj_scan_token(NULL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_10() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_12()) {
+ jj_scanpos = xsp;
+ if (jj_3R_13()) {
+ jj_scanpos = xsp;
+ if (jj_3R_14()) {
+ jj_scanpos = xsp;
+ if (jj_3R_15()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_46() {
+ if (jj_scan_token(28)) return true;
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_32() {
+ if (jj_scan_token(FALSE)) return true;
+ return false;
+ }
+
+ private boolean jj_3_3() {
+ if (jj_scan_token(NOT)) return true;
+ if (jj_scan_token(BETWEEN)) return true;
+ if (jj_3R_43()) return true;
+ if (jj_scan_token(AND)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_45() {
+ if (jj_scan_token(27)) return true;
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_42() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_45()) {
+ jj_scanpos = xsp;
+ if (jj_3R_46()) {
+ jj_scanpos = xsp;
+ if (jj_3_1()) {
+ jj_scanpos = xsp;
+ if (jj_3R_47()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_54() {
+ if (jj_scan_token(BETWEEN)) return true;
+ if (jj_3R_43()) return true;
+ if (jj_scan_token(AND)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_31() {
+ if (jj_scan_token(TRUE)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_58() {
+ if (jj_scan_token(ESCAPE)) return true;
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_18() {
+ if (jj_scan_token(40)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_30() {
+ if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_39() {
+ if (jj_3R_41()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_42()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3_2() {
+ if (jj_scan_token(NOT)) return true;
+ if (jj_scan_token(LIKE)) return true;
+ if (jj_3R_38()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_59()) jj_scanpos = xsp;
+ return false;
+ }
+
+ private boolean jj_3R_53() {
+ if (jj_scan_token(LIKE)) return true;
+ if (jj_3R_38()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_58()) jj_scanpos = xsp;
+ return false;
+ }
+
+ private boolean jj_3R_17() {
+ if (jj_scan_token(39)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_29() {
+ if (jj_scan_token(OCTAL_LITERAL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_16() {
+ if (jj_scan_token(38)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_11() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_16()) {
+ jj_scanpos = xsp;
+ if (jj_3R_17()) {
+ jj_scanpos = xsp;
+ if (jj_3R_18()) return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_40() {
+ if (jj_scan_token(AND)) return true;
+ if (jj_3R_39()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_28() {
+ if (jj_scan_token(HEX_LITERAL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_9() {
+ if (jj_3R_10()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_11()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_27() {
+ if (jj_scan_token(DECIMAL_LITERAL)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_57() {
+ if (jj_scan_token(37)) return true;
+ if (jj_3R_9()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_36() {
+ if (jj_3R_39()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_40()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3_5() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(36)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(37)) return true;
+ }
+ if (jj_3R_9()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_52() {
+ if (jj_scan_token(32)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_35() {
+ if (jj_scan_token(QUOTED_ID)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_56() {
+ if (jj_scan_token(36)) return true;
+ if (jj_3R_9()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_26() {
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_51() {
+ if (jj_scan_token(31)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_34() {
+ if (jj_scan_token(ID)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_61() {
+ if (jj_scan_token(34)) return true;
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_48() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_56()) {
+ jj_scanpos = xsp;
+ if (jj_3R_57()) return true;
+ }
+ return false;
+ }
+
+ private boolean jj_3R_37() {
+ if (jj_scan_token(OR)) return true;
+ if (jj_3R_36()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_23() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_26()) {
+ jj_scanpos = xsp;
+ if (jj_3R_27()) {
+ jj_scanpos = xsp;
+ if (jj_3R_28()) {
+ jj_scanpos = xsp;
+ if (jj_3R_29()) {
+ jj_scanpos = xsp;
+ if (jj_3R_30()) {
+ jj_scanpos = xsp;
+ if (jj_3R_31()) {
+ jj_scanpos = xsp;
+ if (jj_3R_32()) {
+ jj_scanpos = xsp;
+ if (jj_3R_33()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_50() {
+ if (jj_scan_token(30)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_24() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_34()) {
+ jj_scanpos = xsp;
+ if (jj_3R_35()) return true;
+ }
+ return false;
+ }
+
+ private boolean jj_3R_49() {
+ if (jj_scan_token(29)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_44() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_49()) {
+ jj_scanpos = xsp;
+ if (jj_3R_50()) {
+ jj_scanpos = xsp;
+ if (jj_3R_51()) {
+ jj_scanpos = xsp;
+ if (jj_3R_52()) {
+ jj_scanpos = xsp;
+ if (jj_3R_53()) {
+ jj_scanpos = xsp;
+ if (jj_3_2()) {
+ jj_scanpos = xsp;
+ if (jj_3R_54()) {
+ jj_scanpos = xsp;
+ if (jj_3_3()) {
+ jj_scanpos = xsp;
+ if (jj_3R_55()) {
+ jj_scanpos = xsp;
+ if (jj_3_4()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_43() {
+ if (jj_3R_9()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_48()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_25() {
+ if (jj_3R_36()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_37()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_22() {
+ if (jj_scan_token(33)) return true;
+ if (jj_3R_25()) return true;
+ if (jj_scan_token(35)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_21() {
+ if (jj_3R_24()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_20() {
+ if (jj_3R_23()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_60() {
+ if (jj_scan_token(34)) return true;
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_19() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_20()) {
+ jj_scanpos = xsp;
+ if (jj_3R_21()) {
+ jj_scanpos = xsp;
+ if (jj_3R_22()) return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_41() {
+ if (jj_3R_43()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_44()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3_4() {
+ if (jj_scan_token(NOT)) return true;
+ if (jj_scan_token(IN)) return true;
+ if (jj_scan_token(33)) return true;
+ if (jj_3R_38()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_61()) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(35)) return true;
+ return false;
+ }
+
+ private boolean jj_3_6() {
+ if (jj_scan_token(36)) return true;
+ if (jj_3R_10()) return true;
+ return false;
+ }
+
+ /** Generated Token Manager. */
+ public SelectorParserTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ /** Current token. */
+ public Token token;
+ /** Next token. */
+ public Token jj_nt;
+ private int jj_ntk;
+ private Token jj_scanpos, jj_lastpos;
+ private int jj_la;
+
+ /** Constructor with InputStream. */
+ public SelectorParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ /** Constructor with InputStream and supplied encoding */
+ public SelectorParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new SelectorParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Constructor. */
+ public SelectorParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new SelectorParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Constructor with generated Token Manager. */
+ public SelectorParser(SelectorParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(SelectorParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ }
+
+ private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ return token;
+ }
+ token = oldToken;
+ throw generateParseException();
+ }
+
+ static private final class LookaheadSuccess extends java.lang.Error { }
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+ private boolean jj_scan_token(int kind) {
+ if (jj_scanpos == jj_lastpos) {
+ jj_la--;
+ if (jj_scanpos.next == null) {
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+ } else {
+ jj_lastpos = jj_scanpos = jj_scanpos.next;
+ }
+ } else {
+ jj_scanpos = jj_scanpos.next;
+ }
+ if (jj_scanpos.kind != kind) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+ return false;
+ }
+
+
+/** Get the next Token. */
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ return token;
+ }
+
+/** Get the specific Token. */
+ final public Token getToken(int index) {
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ /** Generate ParseException. */
+ public ParseException generateParseException() {
+ Token errortok = token.next;
+ int line = errortok.beginLine, column = errortok.beginColumn;
+ String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
+ return new ParseException("Parse error at line " + line + ", column " + column + ". Encountered: " + mess);
+ }
+
+ /** Enable tracing. */
+ final public void enable_tracing() {
+ }
+
+ /** Disable tracing. */
+ final public void disable_tracing() {
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java
new file mode 100644
index 0000000000..2ffdcddc6c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserConstants.java
@@ -0,0 +1,125 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserConstants.java */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface SelectorParserConstants {
+
+ /** End of File. */
+ int EOF = 0;
+ /** RegularExpression Id. */
+ int LINE_COMMENT = 6;
+ /** RegularExpression Id. */
+ int BLOCK_COMMENT = 7;
+ /** RegularExpression Id. */
+ int NOT = 8;
+ /** RegularExpression Id. */
+ int AND = 9;
+ /** RegularExpression Id. */
+ int OR = 10;
+ /** RegularExpression Id. */
+ int BETWEEN = 11;
+ /** RegularExpression Id. */
+ int LIKE = 12;
+ /** RegularExpression Id. */
+ int ESCAPE = 13;
+ /** RegularExpression Id. */
+ int IN = 14;
+ /** RegularExpression Id. */
+ int IS = 15;
+ /** RegularExpression Id. */
+ int TRUE = 16;
+ /** RegularExpression Id. */
+ int FALSE = 17;
+ /** RegularExpression Id. */
+ int NULL = 18;
+ /** RegularExpression Id. */
+ int DECIMAL_LITERAL = 19;
+ /** RegularExpression Id. */
+ int HEX_LITERAL = 20;
+ /** RegularExpression Id. */
+ int OCTAL_LITERAL = 21;
+ /** RegularExpression Id. */
+ int FLOATING_POINT_LITERAL = 22;
+ /** RegularExpression Id. */
+ int EXPONENT = 23;
+ /** RegularExpression Id. */
+ int STRING_LITERAL = 24;
+ /** RegularExpression Id. */
+ int ID = 25;
+ /** RegularExpression Id. */
+ int QUOTED_ID = 26;
+
+ /** Lexical state. */
+ int DEFAULT = 0;
+
+ /** Literal token values. */
+ String[] tokenImage = {
+ "<EOF>",
+ "\" \"",
+ "\"\\t\"",
+ "\"\\n\"",
+ "\"\\r\"",
+ "\"\\f\"",
+ "<LINE_COMMENT>",
+ "<BLOCK_COMMENT>",
+ "\"NOT\"",
+ "\"AND\"",
+ "\"OR\"",
+ "\"BETWEEN\"",
+ "\"LIKE\"",
+ "\"ESCAPE\"",
+ "\"IN\"",
+ "\"IS\"",
+ "\"TRUE\"",
+ "\"FALSE\"",
+ "\"NULL\"",
+ "<DECIMAL_LITERAL>",
+ "<HEX_LITERAL>",
+ "<OCTAL_LITERAL>",
+ "<FLOATING_POINT_LITERAL>",
+ "<EXPONENT>",
+ "<STRING_LITERAL>",
+ "<ID>",
+ "<QUOTED_ID>",
+ "\"=\"",
+ "\"<>\"",
+ "\">\"",
+ "\">=\"",
+ "\"<\"",
+ "\"<=\"",
+ "\"(\"",
+ "\",\"",
+ "\")\"",
+ "\"+\"",
+ "\"-\"",
+ "\"*\"",
+ "\"/\"",
+ "\"%\"",
+ };
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserTokenManager.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserTokenManager.java
new file mode 100644
index 0000000000..96781acf84
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserTokenManager.java
@@ -0,0 +1,1066 @@
+/* Generated By:JavaCC: Do not edit this line. SelectorParserTokenManager.java */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+import java.io.StringReader;
+import java.util.ArrayList;
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.PropertyExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+/** Token Manager. */
+public class SelectorParserTokenManager implements SelectorParserConstants
+{
+
+ /** Debug output. */
+ public java.io.PrintStream debugStream = System.out;
+ /** Set debug output. */
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 9:
+ jjmatchedKind = 2;
+ return jjMoveNfa_0(5, 0);
+ case 10:
+ jjmatchedKind = 3;
+ return jjMoveNfa_0(5, 0);
+ case 12:
+ jjmatchedKind = 5;
+ return jjMoveNfa_0(5, 0);
+ case 13:
+ jjmatchedKind = 4;
+ return jjMoveNfa_0(5, 0);
+ case 32:
+ jjmatchedKind = 1;
+ return jjMoveNfa_0(5, 0);
+ case 37:
+ jjmatchedKind = 40;
+ return jjMoveNfa_0(5, 0);
+ case 40:
+ jjmatchedKind = 33;
+ return jjMoveNfa_0(5, 0);
+ case 41:
+ jjmatchedKind = 35;
+ return jjMoveNfa_0(5, 0);
+ case 42:
+ jjmatchedKind = 38;
+ return jjMoveNfa_0(5, 0);
+ case 43:
+ jjmatchedKind = 36;
+ return jjMoveNfa_0(5, 0);
+ case 44:
+ jjmatchedKind = 34;
+ return jjMoveNfa_0(5, 0);
+ case 45:
+ jjmatchedKind = 37;
+ return jjMoveNfa_0(5, 0);
+ case 47:
+ jjmatchedKind = 39;
+ return jjMoveNfa_0(5, 0);
+ case 60:
+ jjmatchedKind = 31;
+ return jjMoveStringLiteralDfa1_0(0x110000000L);
+ case 61:
+ jjmatchedKind = 27;
+ return jjMoveNfa_0(5, 0);
+ case 62:
+ jjmatchedKind = 29;
+ return jjMoveStringLiteralDfa1_0(0x40000000L);
+ case 65:
+ return jjMoveStringLiteralDfa1_0(0x200L);
+ case 66:
+ return jjMoveStringLiteralDfa1_0(0x800L);
+ case 69:
+ return jjMoveStringLiteralDfa1_0(0x2000L);
+ case 70:
+ return jjMoveStringLiteralDfa1_0(0x20000L);
+ case 73:
+ return jjMoveStringLiteralDfa1_0(0xc000L);
+ case 76:
+ return jjMoveStringLiteralDfa1_0(0x1000L);
+ case 78:
+ return jjMoveStringLiteralDfa1_0(0x40100L);
+ case 79:
+ return jjMoveStringLiteralDfa1_0(0x400L);
+ case 84:
+ return jjMoveStringLiteralDfa1_0(0x10000L);
+ case 97:
+ return jjMoveStringLiteralDfa1_0(0x200L);
+ case 98:
+ return jjMoveStringLiteralDfa1_0(0x800L);
+ case 101:
+ return jjMoveStringLiteralDfa1_0(0x2000L);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x20000L);
+ case 105:
+ return jjMoveStringLiteralDfa1_0(0xc000L);
+ case 108:
+ return jjMoveStringLiteralDfa1_0(0x1000L);
+ case 110:
+ return jjMoveStringLiteralDfa1_0(0x40100L);
+ case 111:
+ return jjMoveStringLiteralDfa1_0(0x400L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x10000L);
+ default :
+ return jjMoveNfa_0(5, 0);
+ }
+}
+private int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 0);
+ }
+ switch(curChar)
+ {
+ case 61:
+ if ((active0 & 0x40000000L) != 0L)
+ {
+ jjmatchedKind = 30;
+ jjmatchedPos = 1;
+ }
+ else if ((active0 & 0x100000000L) != 0L)
+ {
+ jjmatchedKind = 32;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 62:
+ if ((active0 & 0x10000000L) != 0L)
+ {
+ jjmatchedKind = 28;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 65:
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
+ case 69:
+ return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+ case 73:
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+ case 78:
+ if ((active0 & 0x4000L) != 0L)
+ {
+ jjmatchedKind = 14;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+ case 79:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 82:
+ if ((active0 & 0x400L) != 0L)
+ {
+ jjmatchedKind = 10;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
+ case 83:
+ if ((active0 & 0x8000L) != 0L)
+ {
+ jjmatchedKind = 15;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+ case 85:
+ return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
+ case 101:
+ return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+ case 105:
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+ case 110:
+ if ((active0 & 0x4000L) != 0L)
+ {
+ jjmatchedKind = 14;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+ case 111:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 114:
+ if ((active0 & 0x400L) != 0L)
+ {
+ jjmatchedKind = 10;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000L);
+ case 115:
+ if ((active0 & 0x8000L) != 0L)
+ {
+ jjmatchedKind = 15;
+ jjmatchedPos = 1;
+ }
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 1);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(5, 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 1);
+ }
+ switch(curChar)
+ {
+ case 67:
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+ case 68:
+ if ((active0 & 0x200L) != 0L)
+ {
+ jjmatchedKind = 9;
+ jjmatchedPos = 2;
+ }
+ break;
+ case 75:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+ case 76:
+ return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
+ case 84:
+ if ((active0 & 0x100L) != 0L)
+ {
+ jjmatchedKind = 8;
+ jjmatchedPos = 2;
+ }
+ return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+ case 85:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
+ case 99:
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+ case 100:
+ if ((active0 & 0x200L) != 0L)
+ {
+ jjmatchedKind = 9;
+ jjmatchedPos = 2;
+ }
+ break;
+ case 107:
+ return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+ case 108:
+ return jjMoveStringLiteralDfa3_0(active0, 0x60000L);
+ case 116:
+ if ((active0 & 0x100L) != 0L)
+ {
+ jjmatchedKind = 8;
+ jjmatchedPos = 2;
+ }
+ return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 2);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(5, 2);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 2);
+ }
+ switch(curChar)
+ {
+ case 65:
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
+ case 69:
+ if ((active0 & 0x1000L) != 0L)
+ {
+ jjmatchedKind = 12;
+ jjmatchedPos = 3;
+ }
+ else if ((active0 & 0x10000L) != 0L)
+ {
+ jjmatchedKind = 16;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 76:
+ if ((active0 & 0x40000L) != 0L)
+ {
+ jjmatchedKind = 18;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 83:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
+ case 87:
+ return jjMoveStringLiteralDfa4_0(active0, 0x800L);
+ case 97:
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
+ case 101:
+ if ((active0 & 0x1000L) != 0L)
+ {
+ jjmatchedKind = 12;
+ jjmatchedPos = 3;
+ }
+ else if ((active0 & 0x10000L) != 0L)
+ {
+ jjmatchedKind = 16;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 108:
+ if ((active0 & 0x40000L) != 0L)
+ {
+ jjmatchedKind = 18;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
+ case 119:
+ return jjMoveStringLiteralDfa4_0(active0, 0x800L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 3);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(5, 3);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 3);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x20000L) != 0L)
+ {
+ jjmatchedKind = 17;
+ jjmatchedPos = 4;
+ }
+ return jjMoveStringLiteralDfa5_0(active0, 0x800L);
+ case 80:
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
+ case 101:
+ if ((active0 & 0x20000L) != 0L)
+ {
+ jjmatchedKind = 17;
+ jjmatchedPos = 4;
+ }
+ return jjMoveStringLiteralDfa5_0(active0, 0x800L);
+ case 112:
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 4);
+}
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(5, 4);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 4);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x2000L) != 0L)
+ {
+ jjmatchedKind = 13;
+ jjmatchedPos = 5;
+ }
+ return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+ case 101:
+ if ((active0 & 0x2000L) != 0L)
+ {
+ jjmatchedKind = 13;
+ jjmatchedPos = 5;
+ }
+ return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 5);
+}
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(5, 5);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(5, 5);
+ }
+ switch(curChar)
+ {
+ case 78:
+ if ((active0 & 0x800L) != 0L)
+ {
+ jjmatchedKind = 11;
+ jjmatchedPos = 6;
+ }
+ break;
+ case 110:
+ if ((active0 & 0x800L) != 0L)
+ {
+ jjmatchedKind = 11;
+ jjmatchedPos = 6;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(5, 6);
+}
+static final long[] jjbitVec0 = {
+ 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private int jjMoveNfa_0(int startState, int curPos)
+{
+ int strKind = jjmatchedKind;
+ int strPos = jjmatchedPos;
+ int seenUpto;
+ input_stream.backup(seenUpto = curPos + 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error"); }
+ curPos = 0;
+ int startsAt = 0;
+ jjnewStateCnt = 48;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ else if (curChar == 34)
+ jjCheckNAddStates(4, 6);
+ else if (curChar == 36)
+ {
+ if (kind > 25)
+ kind = 25;
+ jjCheckNAdd(27);
+ }
+ else if (curChar == 39)
+ jjCheckNAddStates(7, 9);
+ else if (curChar == 46)
+ jjCheckNAdd(17);
+ else if (curChar == 47)
+ jjstateSet[jjnewStateCnt++] = 6;
+ else if (curChar == 45)
+ jjstateSet[jjnewStateCnt++] = 0;
+ if ((0x3fe000000000000L & l) != 0L)
+ {
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAddTwoStates(14, 15);
+ }
+ else if (curChar == 48)
+ {
+ if (kind > 21)
+ kind = 21;
+ jjCheckNAddTwoStates(45, 47);
+ }
+ break;
+ case 0:
+ if (curChar == 45)
+ jjCheckNAddStates(10, 12);
+ break;
+ case 1:
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(10, 12);
+ break;
+ case 2:
+ if ((0x2400L & l) != 0L && kind > 6)
+ kind = 6;
+ break;
+ case 3:
+ if (curChar == 10 && kind > 6)
+ kind = 6;
+ break;
+ case 4:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 6:
+ if (curChar == 42)
+ jjCheckNAddTwoStates(7, 8);
+ break;
+ case 7:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(7, 8);
+ break;
+ case 8:
+ if (curChar == 42)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 9:
+ if ((0xffff7bffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(10, 8);
+ break;
+ case 10:
+ if ((0xfffffbffffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(10, 8);
+ break;
+ case 11:
+ if (curChar == 47 && kind > 7)
+ kind = 7;
+ break;
+ case 12:
+ if (curChar == 47)
+ jjstateSet[jjnewStateCnt++] = 6;
+ break;
+ case 13:
+ if ((0x3fe000000000000L & l) == 0L)
+ break;
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAddTwoStates(14, 15);
+ break;
+ case 14:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 19)
+ kind = 19;
+ jjCheckNAddTwoStates(14, 15);
+ break;
+ case 16:
+ if (curChar == 46)
+ jjCheckNAdd(17);
+ break;
+ case 17:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(17, 18);
+ break;
+ case 19:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(20);
+ break;
+ case 20:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAdd(20);
+ break;
+ case 21:
+ case 22:
+ if (curChar == 39)
+ jjCheckNAddStates(7, 9);
+ break;
+ case 23:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 22;
+ break;
+ case 24:
+ if ((0xffffff7fffffffffL & l) != 0L)
+ jjCheckNAddStates(7, 9);
+ break;
+ case 25:
+ if (curChar == 39 && kind > 24)
+ kind = 24;
+ break;
+ case 26:
+ if (curChar != 36)
+ break;
+ if (kind > 25)
+ kind = 25;
+ jjCheckNAdd(27);
+ break;
+ case 27:
+ if ((0x3ff001000000000L & l) == 0L)
+ break;
+ if (kind > 25)
+ kind = 25;
+ jjCheckNAdd(27);
+ break;
+ case 28:
+ case 29:
+ if (curChar == 34)
+ jjCheckNAddStates(4, 6);
+ break;
+ case 30:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 29;
+ break;
+ case 31:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ jjCheckNAddStates(4, 6);
+ break;
+ case 32:
+ if (curChar == 34 && kind > 26)
+ kind = 26;
+ break;
+ case 33:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 34:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(34, 35);
+ break;
+ case 35:
+ if (curChar != 46)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(36, 37);
+ break;
+ case 36:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(36, 37);
+ break;
+ case 38:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(39);
+ break;
+ case 39:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAdd(39);
+ break;
+ case 40:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(40, 41);
+ break;
+ case 42:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(43);
+ break;
+ case 43:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAdd(43);
+ break;
+ case 44:
+ if (curChar != 48)
+ break;
+ if (kind > 21)
+ kind = 21;
+ jjCheckNAddTwoStates(45, 47);
+ break;
+ case 46:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 20)
+ kind = 20;
+ jjstateSet[jjnewStateCnt++] = 46;
+ break;
+ case 47:
+ if ((0xff000000000000L & l) == 0L)
+ break;
+ if (kind > 21)
+ kind = 21;
+ jjCheckNAdd(47);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ case 27:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 25)
+ kind = 25;
+ jjCheckNAdd(27);
+ break;
+ case 1:
+ jjAddStates(10, 12);
+ break;
+ case 7:
+ jjCheckNAddTwoStates(7, 8);
+ break;
+ case 9:
+ case 10:
+ jjCheckNAddTwoStates(10, 8);
+ break;
+ case 15:
+ if ((0x100000001000L & l) != 0L && kind > 19)
+ kind = 19;
+ break;
+ case 18:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(16, 17);
+ break;
+ case 24:
+ jjAddStates(7, 9);
+ break;
+ case 31:
+ jjAddStates(4, 6);
+ break;
+ case 37:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(18, 19);
+ break;
+ case 41:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(20, 21);
+ break;
+ case 45:
+ if ((0x100000001000000L & l) != 0L)
+ jjCheckNAdd(46);
+ break;
+ case 46:
+ if ((0x7e0000007eL & l) == 0L)
+ break;
+ if (kind > 20)
+ kind = 20;
+ jjCheckNAdd(46);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 1:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(10, 12);
+ break;
+ case 7:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(7, 8);
+ break;
+ case 9:
+ case 10:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(10, 8);
+ break;
+ case 24:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(7, 9);
+ break;
+ case 31:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(4, 6);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt)))
+ break;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { break; }
+ }
+ if (jjmatchedPos > strPos)
+ return curPos;
+
+ int toRet = Math.max(curPos, seenUpto);
+
+ if (curPos < toRet)
+ for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
+
+ if (jjmatchedPos < strPos)
+ {
+ jjmatchedKind = strKind;
+ jjmatchedPos = strPos;
+ }
+ else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
+ jjmatchedKind = strKind;
+
+ return toRet;
+}
+static final int[] jjnextStates = {
+ 34, 35, 40, 41, 30, 31, 32, 23, 24, 25, 1, 2, 4, 8, 9, 11,
+ 19, 20, 38, 39, 42, 43,
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec2[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec0[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+"\75", "\74\76", "\76", "\76\75", "\74", "\74\75", "\50", "\54", "\51", "\53", "\55",
+"\52", "\57", "\45", };
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+static final long[] jjtoToken = {
+ 0x1ffff7fff01L,
+};
+static final long[] jjtoSkip = {
+ 0xfeL,
+};
+static final long[] jjtoSpecial = {
+ 0x3eL,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[48];
+private final int[] jjstateSet = new int[96];
+protected char curChar;
+/** Constructor. */
+public SelectorParserTokenManager(SimpleCharStream stream){
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+
+/** Constructor. */
+public SelectorParserTokenManager(SimpleCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 48; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+
+/** Reinitialise parser. */
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+ ReInit(stream);
+ SwitchTo(lexState);
+}
+
+/** Switch to specified lex state. */
+public void SwitchTo(int lexState)
+{
+ if (lexState >= 1 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken()
+{
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ matchedToken.specialToken = specialToken;
+ return matchedToken;
+ }
+
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ matchedToken.specialToken = specialToken;
+ return matchedToken;
+ }
+ else
+ {
+ if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ if (specialToken == null)
+ specialToken = matchedToken;
+ else
+ {
+ matchedToken.specialToken = specialToken;
+ specialToken = (specialToken.next = matchedToken);
+ }
+ }
+ continue EOFLoop;
+ }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+}
+
+private void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SimpleCharStream.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SimpleCharStream.java
new file mode 100644
index 0000000000..c492e5cc23
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/SimpleCharStream.java
@@ -0,0 +1,492 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+/** Whether parser is static. */
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+/** Position in buffer. */
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+/** Start. */
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+/** Read a character. */
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return c;
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ @Deprecated
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token end column number. */
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /** Get token end line number. */
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ /** Get token beginning column number. */
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ /** Get token beginning line number. */
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+/** Backup a number of characters. */
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ /** Constructor. */
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ /** Get token literal value. */
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ /** Get the suffix. */
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ /** Reset buffer when finished. */
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
+/* JavaCC - OriginalChecksum=dcf3510e97e4ee9a841bdafac162a129 (do not edit this line) */
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/Token.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/Token.java
new file mode 100644
index 0000000000..aebd21dacc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/Token.java
@@ -0,0 +1,152 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token implements java.io.Serializable {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /** The line number of the first character of this Token. */
+ public int beginLine;
+ /** The column number of the first character of this Token. */
+ public int beginColumn;
+ /** The line number of the last character of this Token. */
+ public int endLine;
+ /** The column number of the last character of this Token. */
+ public int endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * An optional attribute value of the Token.
+ * Tokens which are not used as syntactic sugar will often contain
+ * meaningful values that will be used later on by the compiler or
+ * interpreter. This attribute value is often different from the image.
+ * Any subclass of Token that actually wants to return a non-null value can
+ * override this method as appropriate.
+ */
+ public Object getValue() {
+ return null;
+ }
+
+ /**
+ * No-argument constructor
+ */
+ public Token() {}
+
+ /**
+ * Constructs a new token for the specified Image.
+ */
+ public Token(int kind)
+ {
+ this(kind, null);
+ }
+
+ /**
+ * Constructs a new token for the specified Image and Kind.
+ */
+ public Token(int kind, String image)
+ {
+ this.kind = kind;
+ this.image = image;
+ }
+
+ /**
+ * Returns the image.
+ */
+ public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simply add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use sit in your lexical actions.
+ */
+ public static Token newToken(int ofKind, String image)
+ {
+ switch(ofKind)
+ {
+ default : return new Token(ofKind, image);
+ }
+ }
+
+ public static Token newToken(int ofKind)
+ {
+ return newToken(ofKind, null);
+ }
+
+}
+/* JavaCC - OriginalChecksum=dfd1857bf2f000661cadfe9ef672245e (do not edit this line) */
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/TokenMgrError.java b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/TokenMgrError.java
new file mode 100644
index 0000000000..835339dc53
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/filter/selector/TokenMgrError.java
@@ -0,0 +1,168 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
+/* JavaCCOptions: */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+/** Token Manager Error. */
+public class TokenMgrError extends Error
+{
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occurred.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt was made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their escaped (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexical error
+ * curLexState : lexical state in which this error occurred
+ * errorLine : line number when the error occurred
+ * errorColumn : column number when the error occurred
+ * errorAfter : prefix that was seen before this error occurred
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ /** No arg constructor. */
+ public TokenMgrError() {
+ }
+
+ /** Constructor with message and reason. */
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ /** Full Constructor. */
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
+/* JavaCC - OriginalChecksum=795daaee93a15e0081e60f73df35399f (do not edit this line) */
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java
new file mode 100644
index 0000000000..38701385d6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface AccessRequestBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getActive();
+
+ public boolean getExclusive();
+
+ public boolean getPassive();
+
+ public boolean getRead();
+
+ public AMQShortString getRealm();
+
+ public boolean getWrite();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java
new file mode 100644
index 0000000000..aa7c171411
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface AccessRequestOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java
new file mode 100644
index 0000000000..41c4af5ff0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicAckBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getDeliveryTag();
+
+ public boolean getMultiple();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java
new file mode 100644
index 0000000000..853b1583b9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicCancelBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getNowait();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java
new file mode 100644
index 0000000000..623e89275a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicCancelOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java
new file mode 100644
index 0000000000..d263899082
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicConsumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getArguments();
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getExclusive();
+
+ public boolean getNoAck();
+
+ public boolean getNoLocal();
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java
new file mode 100644
index 0000000000..a73cb9605d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicConsumeOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
index eb528159c0..366c8231a1 100644
--- a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
@@ -388,7 +388,15 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setContentType(AMQShortString contentType)
{
- _propertyFlags |= (CONTENT_TYPE_MASK);
+
+ if(contentType == null)
+ {
+ _propertyFlags &= (~CONTENT_TYPE_MASK);
+ }
+ else
+ {
+ _propertyFlags |= CONTENT_TYPE_MASK;
+ }
_contentType = contentType;
_encodedForm = null;
}
@@ -411,14 +419,19 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setEncoding(String encoding)
{
- _propertyFlags |= ENCODING_MASK;
- _encoding = (encoding == null) ? null : AMQShortString.valueOf(encoding);
- _encodedForm = null;
+ setEncoding(encoding == null ? null : AMQShortString.valueOf(encoding));
}
public void setEncoding(AMQShortString encoding)
{
- _propertyFlags |= ENCODING_MASK;
+ if(encoding == null)
+ {
+ _propertyFlags &= (~ENCODING_MASK);
+ }
+ else
+ {
+ _propertyFlags |= ENCODING_MASK;
+ }
_encoding = encoding;
_encodedForm = null;
}
@@ -435,7 +448,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setHeaders(FieldTable headers)
{
- _propertyFlags |= HEADERS_MASK;
+ if(headers == null)
+ {
+ _propertyFlags &= (~HEADERS_MASK);
+ }
+ else
+ {
+ _propertyFlags |= HEADERS_MASK;
+ }
_headers = headers;
_encodedForm = null;
}
@@ -481,7 +501,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setCorrelationId(AMQShortString correlationId)
{
- _propertyFlags |= CORRELATION_ID_MASK;
+ if(correlationId == null)
+ {
+ _propertyFlags &= (~CORRELATION_ID_MASK);
+ }
+ else
+ {
+ _propertyFlags |= CORRELATION_ID_MASK;
+ }
_correlationId = correlationId;
_encodedForm = null;
}
@@ -503,7 +530,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setReplyTo(AMQShortString replyTo)
{
- _propertyFlags |= REPLY_TO_MASK;
+ if(replyTo == null)
+ {
+ _propertyFlags &= (~REPLY_TO_MASK);
+ }
+ else
+ {
+ _propertyFlags |= REPLY_TO_MASK;
+ }
_replyTo = replyTo;
_encodedForm = null;
}
@@ -515,7 +549,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setExpiration(long expiration)
{
- _propertyFlags |= EXPIRATION_MASK;
+ if(expiration == 0l)
+ {
+ _propertyFlags &= (~EXPIRATION_MASK);
+ }
+ else
+ {
+ _propertyFlags |= EXPIRATION_MASK;
+ }
_expiration = expiration;
_encodedForm = null;
}
@@ -532,14 +573,19 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setMessageId(String messageId)
{
- _propertyFlags |= MESSAGE_ID_MASK;
- _messageId = (messageId == null) ? null : new AMQShortString(messageId);
- _encodedForm = null;
+ setMessageId(messageId == null ? null : new AMQShortString(messageId));
}
public void setMessageId(AMQShortString messageId)
{
- _propertyFlags |= MESSAGE_ID_MASK;
+ if(messageId == null)
+ {
+ _propertyFlags &= (~MESSAGE_ID_MASK);
+ }
+ else
+ {
+ _propertyFlags |= MESSAGE_ID_MASK;
+ }
_messageId = messageId;
_encodedForm = null;
}
@@ -573,7 +619,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setType(AMQShortString type)
{
- _propertyFlags |= TYPE_MASK;
+ if(type == null)
+ {
+ _propertyFlags &= (~TYPE_MASK);
+ }
+ else
+ {
+ _propertyFlags |= TYPE_MASK;
+ }
_type = type;
_encodedForm = null;
}
@@ -595,7 +648,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setUserId(AMQShortString userId)
{
- _propertyFlags |= USER_ID_MASK;
+ if(userId == null)
+ {
+ _propertyFlags &= (~USER_ID_MASK);
+ }
+ else
+ {
+ _propertyFlags |= USER_ID_MASK;
+ }
_userId = userId;
_encodedForm = null;
}
@@ -617,7 +677,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setAppId(AMQShortString appId)
{
- _propertyFlags |= APPLICATION_ID_MASK;
+ if(appId == null)
+ {
+ _propertyFlags &= (~APPLICATION_ID_MASK);
+ }
+ else
+ {
+ _propertyFlags |= APPLICATION_ID_MASK;
+ }
_appId = appId;
_encodedForm = null;
}
@@ -639,7 +706,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti
public void setClusterId(AMQShortString clusterId)
{
- _propertyFlags |= CLUSTER_ID_MASK;
+ if(clusterId == null)
+ {
+ _propertyFlags &= (~CLUSTER_ID_MASK);
+ }
+ else
+ {
+ _propertyFlags |= CLUSTER_ID_MASK;
+ }
_clusterId = clusterId;
_encodedForm = null;
}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java
new file mode 100644
index 0000000000..07781c0026
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicDeliverBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public long getDeliveryTag();
+
+ public AMQShortString getExchange();
+
+ public boolean getRedelivered();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java
new file mode 100644
index 0000000000..b2a27cf840
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicGetBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getNoAck();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java
new file mode 100644
index 0000000000..758d15ba37
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicGetEmptyBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getClusterId();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java
new file mode 100644
index 0000000000..fac54d975c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicGetOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getDeliveryTag();
+
+ public AMQShortString getExchange();
+
+ public long getMessageCount();
+
+ public boolean getRedelivered();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java
new file mode 100644
index 0000000000..f71e012cd8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicPublishBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public boolean getImmediate();
+
+ public boolean getMandatory();
+
+ public AMQShortString getRoutingKey();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java
new file mode 100644
index 0000000000..909a5dae8b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicQosBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getGlobal();
+
+ public int getPrefetchCount();
+
+ public long getPrefetchSize();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java
new file mode 100644
index 0000000000..b37cd30e73
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicQosOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java
new file mode 100644
index 0000000000..57e5637222
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicRecoverBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getRequeue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java
new file mode 100644
index 0000000000..a4abdd0cd7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicRecoverOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java
new file mode 100644
index 0000000000..9175da5796
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicRecoverSyncBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getRequeue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java
new file mode 100644
index 0000000000..c34aeda625
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicRecoverSyncOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java
new file mode 100644
index 0000000000..87cd1083fb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicRejectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getDeliveryTag();
+
+ public boolean getRequeue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java
new file mode 100644
index 0000000000..ace37b61fa
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface BasicReturnBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java
new file mode 100644
index 0000000000..5c2354551a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelAlertBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getDetails();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java
new file mode 100644
index 0000000000..d791b9125e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelCloseBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getClassId();
+
+ public int getMethodId();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java
new file mode 100644
index 0000000000..4d9b8b4c3a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelCloseOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java
new file mode 100644
index 0000000000..08a75df9a5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelFlowBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getActive();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java
new file mode 100644
index 0000000000..750156ea9c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelFlowOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getActive();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOkBody.java
new file mode 100644
index 0000000000..4f332aea8f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java
new file mode 100644
index 0000000000..0333cdae9f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelOpenBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getOutOfBand();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java
new file mode 100644
index 0000000000..7682cea782
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelOpenOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPingBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPingBody.java
new file mode 100644
index 0000000000..29f2013e79
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPingBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelPingBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPongBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPongBody.java
new file mode 100644
index 0000000000..2ac2388246
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelPongBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelPongBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelResumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelResumeBody.java
new file mode 100644
index 0000000000..f3b77e1db9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ChannelResumeBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ChannelResumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getChannelId();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java
new file mode 100644
index 0000000000..0b31d99463
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQException;
+
+public interface ClientMethodDispatcher
+{
+
+ public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java
new file mode 100644
index 0000000000..d03892d29f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionCloseBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getClassId();
+
+ public int getMethodId();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java
new file mode 100644
index 0000000000..f849095877
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionCloseOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java
new file mode 100644
index 0000000000..cfa52b5f44
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionOpenBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getCapabilities();
+
+ public boolean getInsist();
+
+ public AMQShortString getVirtualHost();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java
new file mode 100644
index 0000000000..eb2122fd74
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionOpenOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getKnownHosts();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java
new file mode 100644
index 0000000000..df200e8572
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionRedirectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getHost();
+
+ public AMQShortString getKnownHosts();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java
new file mode 100644
index 0000000000..ebcdc2cf4d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionSecureBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getChallenge();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java
new file mode 100644
index 0000000000..7abbe9d18c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionSecureOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getResponse();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java
new file mode 100644
index 0000000000..3219a9f392
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionStartBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getLocales();
+
+ public byte[] getMechanisms();
+
+ public FieldTable getServerProperties();
+
+ public short getVersionMajor();
+
+ public short getVersionMinor();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java
new file mode 100644
index 0000000000..bd45ce0fa0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionStartOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getClientProperties();
+
+ public AMQShortString getLocale();
+
+ public AMQShortString getMechanism();
+
+ public byte[] getResponse();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java
new file mode 100644
index 0000000000..82a1b2f04b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionTuneBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getChannelMax();
+
+ public long getFrameMax();
+
+ public int getHeartbeat();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java
new file mode 100644
index 0000000000..15cdd44c08
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ConnectionTuneOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getChannelMax();
+
+ public long getFrameMax();
+
+ public int getHeartbeat();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectBody.java
new file mode 100644
index 0000000000..d6d7c87e23
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface DtxSelectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectOkBody.java
new file mode 100644
index 0000000000..9ea4585b35
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxSelectOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface DtxSelectOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartBody.java
new file mode 100644
index 0000000000..e721bfcdd1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface DtxStartBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getDtxIdentifier();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartOkBody.java
new file mode 100644
index 0000000000..c16e9d7447
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/DtxStartOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface DtxStartOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java
new file mode 100644
index 0000000000..fa1fb441a8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeBoundBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public AMQShortString getQueue();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java
new file mode 100644
index 0000000000..7a60e4dc21
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeBoundOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java
new file mode 100644
index 0000000000..8ffb998e47
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java
@@ -0,0 +1,52 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeDeclareBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getArguments();
+
+ public boolean getAutoDelete();
+
+ public boolean getDurable();
+
+ public AMQShortString getExchange();
+
+ public boolean getInternal();
+
+ public boolean getNowait();
+
+ public boolean getPassive();
+
+ public int getTicket();
+
+ public AMQShortString getType();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java
new file mode 100644
index 0000000000..848963ce1b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeDeclareOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java
new file mode 100644
index 0000000000..5ce3a7415f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeDeleteBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public boolean getIfUnused();
+
+ public boolean getNowait();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java
new file mode 100644
index 0000000000..54ce0940d5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface ExchangeDeleteOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileAckBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileAckBody.java
new file mode 100644
index 0000000000..9d5f186521
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileAckBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileAckBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getDeliveryTag();
+
+ public boolean getMultiple();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelBody.java
new file mode 100644
index 0000000000..ac85455ff5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileCancelBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getNowait();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelOkBody.java
new file mode 100644
index 0000000000..40364887c8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileCancelOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileCancelOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeBody.java
new file mode 100644
index 0000000000..632bc1cf85
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeBody.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileConsumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getExclusive();
+
+
+ public boolean getNoAck();
+
+ public boolean getNoLocal();
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeOkBody.java
new file mode 100644
index 0000000000..dd6dd3f64b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileConsumeOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileConsumeOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileDeliverBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileDeliverBody.java
new file mode 100644
index 0000000000..3b8fa3fe79
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileDeliverBody.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileDeliverBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public long getDeliveryTag();
+
+ public AMQShortString getExchange();
+
+ public AMQShortString getIdentifier();
+
+ public boolean getRedelivered();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenBody.java
new file mode 100644
index 0000000000..25ea3834bc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileOpenBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getContentSize();
+
+ public AMQShortString getIdentifier();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenOkBody.java
new file mode 100644
index 0000000000..4edff34eb4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileOpenOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileOpenOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getStagedSize();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FilePublishBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FilePublishBody.java
new file mode 100644
index 0000000000..5377882c27
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FilePublishBody.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FilePublishBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public AMQShortString getIdentifier();
+
+ public boolean getImmediate();
+
+ public boolean getMandatory();
+
+ public AMQShortString getRoutingKey();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosBody.java
new file mode 100644
index 0000000000..378b6a3b5d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileQosBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getGlobal();
+
+ public int getPrefetchCount();
+
+ public long getPrefetchSize();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosOkBody.java
new file mode 100644
index 0000000000..7296b36cc2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileQosOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileQosOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileRejectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileRejectBody.java
new file mode 100644
index 0000000000..c569d8ed9f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileRejectBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileRejectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getDeliveryTag();
+
+ public boolean getRequeue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileReturnBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileReturnBody.java
new file mode 100644
index 0000000000..8bd5825141
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileReturnBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileReturnBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FileStageBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileStageBody.java
new file mode 100644
index 0000000000..976fa3b0da
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FileStageBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface FileStageBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageAppendBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageAppendBody.java
new file mode 100644
index 0000000000..c981ad00f8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageAppendBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageAppendBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getBytes();
+
+ public byte[] getReference();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCancelBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCancelBody.java
new file mode 100644
index 0000000000..e440aca42f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCancelBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageCancelBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getDestination();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCheckpointBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCheckpointBody.java
new file mode 100644
index 0000000000..1cc6dc598b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCheckpointBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageCheckpointBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getIdentifier();
+
+ public byte[] getReference();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCloseBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCloseBody.java
new file mode 100644
index 0000000000..6898edec00
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageCloseBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageCloseBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getReference();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageConsumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageConsumeBody.java
new file mode 100644
index 0000000000..13fe4aec2b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageConsumeBody.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageConsumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getDestination();
+
+ public boolean getExclusive();
+
+ public FieldTable getFilter();
+
+ public boolean getNoAck();
+
+ public boolean getNoLocal();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageEmptyBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageEmptyBody.java
new file mode 100644
index 0000000000..d4f1c6e02a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageEmptyBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageEmptyBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageGetBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageGetBody.java
new file mode 100644
index 0000000000..c2641679a8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageGetBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageGetBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getDestination();
+
+ public boolean getNoAck();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOffsetBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOffsetBody.java
new file mode 100644
index 0000000000..3b7d94ae2e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOffsetBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageOffsetBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getValue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOkBody.java
new file mode 100644
index 0000000000..c349acd2bb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOpenBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOpenBody.java
new file mode 100644
index 0000000000..da021bd42c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageOpenBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageOpenBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getReference();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageQosBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageQosBody.java
new file mode 100644
index 0000000000..ecedcebcee
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageQosBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageQosBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getGlobal();
+
+ public int getPrefetchCount();
+
+ public long getPrefetchSize();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRecoverBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRecoverBody.java
new file mode 100644
index 0000000000..37188d5dc9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRecoverBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageRecoverBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getRequeue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRejectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRejectBody.java
new file mode 100644
index 0000000000..3bd858c20d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageRejectBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageRejectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public int getCode();
+
+ public AMQShortString getText();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageResumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageResumeBody.java
new file mode 100644
index 0000000000..ef68b97c19
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageResumeBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageResumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getIdentifier();
+
+ public byte[] getReference();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageTransferBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageTransferBody.java
new file mode 100644
index 0000000000..11f8848431
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MessageTransferBody.java
@@ -0,0 +1,78 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MessageTransferBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getAppId();
+
+ public FieldTable getApplicationHeaders();
+
+ public Content getBody();
+
+ public AMQShortString getContentEncoding();
+
+ public AMQShortString getContentType();
+
+ public AMQShortString getCorrelationId();
+
+ public short getDeliveryMode();
+
+ public AMQShortString getDestination();
+
+ public AMQShortString getExchange();
+
+ public long getExpiration();
+
+ public boolean getImmediate();
+
+ public AMQShortString getMessageId();
+
+ public short getPriority();
+
+ public boolean getRedelivered();
+
+ public AMQShortString getReplyTo();
+
+ public AMQShortString getRoutingKey();
+
+ public byte[] getSecurityToken();
+
+ public int getTicket();
+
+ public long getTimestamp();
+
+ public AMQShortString getTransactionId();
+
+ public long getTtl();
+
+ public AMQShortString getUserId();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodDispatcher.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodDispatcher.java
new file mode 100644
index 0000000000..03b122a7a7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodDispatcher.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface MethodDispatcher extends
+ ClientMethodDispatcher, ServerMethodDispatcher
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java
new file mode 100644
index 0000000000..84274ba3a6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java
@@ -0,0 +1,358 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+import java.io.IOException;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.codec.MarkableDataInput;
+
+import java.util.Map;
+import java.util.HashMap;
+
+
+public abstract class MethodRegistry
+{
+ private static final Map<ProtocolVersion, MethodRegistry> _registries =
+ new HashMap<ProtocolVersion, MethodRegistry>();
+
+
+ public static final MethodRegistry registry_0_9 =
+ new org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9();
+
+ public static final MethodRegistry registry_0_91 =
+ new org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91();
+
+ public static final MethodRegistry registry_8_0 =
+ new org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0();
+
+ public abstract AMQMethodBody convertToBody(MarkableDataInput in, long size)
+ throws AMQFrameDecodingException, IOException;
+
+ public abstract int getMaxClassId();
+
+ public abstract int getMaxMethodId(int classId);
+
+ protected MethodRegistry(ProtocolVersion pv)
+ {
+ _registries.put(pv, this);
+ }
+
+ public static MethodRegistry getMethodRegistry(ProtocolVersion pv)
+ {
+ return _registries.get(pv);
+ }
+
+
+
+
+ public abstract BasicAckBody createBasicAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ );
+
+ public abstract BasicCancelBody createBasicCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ );
+
+ public abstract BasicCancelOkBody createBasicCancelOkBody(
+ final AMQShortString consumerTag
+ );
+
+ public abstract BasicConsumeBody createBasicConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable arguments
+ );
+
+ public abstract BasicConsumeOkBody createBasicConsumeOkBody(
+ final AMQShortString consumerTag
+ );
+
+ public abstract BasicDeliverBody createBasicDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ );
+
+ public abstract BasicGetBody createBasicGetBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean noAck
+ );
+
+ public abstract BasicGetEmptyBody createBasicGetEmptyBody(
+ final AMQShortString clusterId
+ );
+
+ public abstract BasicGetOkBody createBasicGetOkBody(
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final long messageCount
+ );
+
+ public abstract BasicPublishBody createBasicPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ );
+
+ public abstract BasicQosBody createBasicQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ );
+
+ public abstract BasicQosOkBody createBasicQosOkBody(
+ );
+
+ public abstract BasicRecoverBody createBasicRecoverBody(
+ final boolean requeue
+ );
+
+ public abstract BasicRejectBody createBasicRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ );
+
+ public abstract BasicReturnBody createBasicReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ );
+
+
+ public abstract ChannelCloseBody createChannelCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ );
+
+ public abstract ChannelCloseOkBody createChannelCloseOkBody(
+ );
+
+ public abstract ChannelFlowBody createChannelFlowBody(
+ final boolean active
+ );
+
+ public abstract ChannelFlowOkBody createChannelFlowOkBody(
+ final boolean active
+ );
+
+ public abstract ChannelOpenBody createChannelOpenBody(
+ final AMQShortString outOfBand
+ );
+
+
+ public abstract ConnectionCloseBody createConnectionCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ );
+
+ public abstract ConnectionCloseOkBody createConnectionCloseOkBody(
+ );
+
+ public abstract ConnectionOpenBody createConnectionOpenBody(
+ final AMQShortString virtualHost,
+ final AMQShortString capabilities,
+ final boolean insist
+ );
+
+ public abstract ConnectionOpenOkBody createConnectionOpenOkBody(
+ final AMQShortString knownHosts
+ );
+
+ public abstract ConnectionSecureBody createConnectionSecureBody(
+ final byte[] challenge
+ );
+
+ public abstract ConnectionSecureOkBody createConnectionSecureOkBody(
+ final byte[] response
+ );
+
+ public abstract ConnectionStartBody createConnectionStartBody(
+ final short versionMajor,
+ final short versionMinor,
+ final FieldTable serverProperties,
+ final byte[] mechanisms,
+ final byte[] locales
+ );
+
+ public abstract ConnectionStartOkBody createConnectionStartOkBody(
+ final FieldTable clientProperties,
+ final AMQShortString mechanism,
+ final byte[] response,
+ final AMQShortString locale
+ );
+
+ public abstract ConnectionTuneBody createConnectionTuneBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ );
+
+ public abstract ConnectionTuneOkBody createConnectionTuneOkBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ );
+
+
+
+ public abstract ExchangeBoundBody createExchangeBoundBody(
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString queue
+ );
+
+ public abstract ExchangeBoundOkBody createExchangeBoundOkBody(
+ final int replyCode,
+ final AMQShortString replyText
+ );
+
+ public abstract ExchangeDeclareBody createExchangeDeclareBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString type,
+ final boolean passive,
+ final boolean durable,
+ final boolean autoDelete,
+ final boolean internal,
+ final boolean nowait,
+ final FieldTable arguments
+ );
+
+ public abstract ExchangeDeclareOkBody createExchangeDeclareOkBody(
+ );
+
+ public abstract ExchangeDeleteBody createExchangeDeleteBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final boolean ifUnused,
+ final boolean nowait
+ );
+
+ public abstract ExchangeDeleteOkBody createExchangeDeleteOkBody(
+ );
+
+
+
+
+ public abstract QueueBindBody createQueueBindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean nowait,
+ final FieldTable arguments
+ );
+
+ public abstract QueueBindOkBody createQueueBindOkBody(
+ );
+
+ public abstract QueueDeclareBody createQueueDeclareBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean passive,
+ final boolean durable,
+ final boolean exclusive,
+ final boolean autoDelete,
+ final boolean nowait,
+ final FieldTable arguments
+ );
+
+ public abstract QueueDeclareOkBody createQueueDeclareOkBody(
+ final AMQShortString queue,
+ final long messageCount,
+ final long consumerCount
+ );
+
+ public abstract QueueDeleteBody createQueueDeleteBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean ifUnused,
+ final boolean ifEmpty,
+ final boolean nowait
+ );
+
+ public abstract QueueDeleteOkBody createQueueDeleteOkBody(
+ final long messageCount
+ );
+
+ public abstract QueuePurgeBody createQueuePurgeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean nowait
+ );
+
+ public abstract QueuePurgeOkBody createQueuePurgeOkBody(
+ final long messageCount
+ );
+
+
+
+
+
+ public abstract TxCommitBody createTxCommitBody(
+ );
+
+ public abstract TxCommitOkBody createTxCommitOkBody(
+ );
+
+ public abstract TxRollbackBody createTxRollbackBody(
+ );
+
+ public abstract TxRollbackOkBody createTxRollbackOkBody(
+ );
+
+ public abstract TxSelectBody createTxSelectBody(
+ );
+
+ public abstract TxSelectOkBody createTxSelectOkBody(
+ );
+
+ public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolVersion.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolVersion.java
new file mode 100644
index 0000000000..33c613ec94
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolVersion.java
@@ -0,0 +1,188 @@
+/*
+*
+* 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+* Supported AMQP versions:
+* 0-9
+* 0-91
+* 8-0
+*/
+
+package org.apache.qpid.framing;
+
+import java.util.SortedSet;
+import java.util.Collections;
+import java.util.TreeSet;
+import java.util.Map;
+import java.util.HashMap;
+
+public class ProtocolVersion implements Comparable
+{
+ private final byte _majorVersion;
+ private final byte _minorVersion;
+ private final String _stringFormat;
+
+ public ProtocolVersion(byte majorVersion, byte minorVersion)
+ {
+ _majorVersion = majorVersion;
+ _minorVersion = minorVersion;
+ _stringFormat = _majorVersion+"-"+_minorVersion;
+ }
+
+ public byte getMajorVersion()
+ {
+ return _majorVersion;
+ }
+
+ public byte getMinorVersion()
+ {
+ return _minorVersion;
+ }
+
+ public byte getActualMinorVersion()
+ {
+ return _minorVersion > 90 ? (byte) (_minorVersion / 10) : _minorVersion;
+ }
+
+ public byte getRevisionVersion()
+ {
+ return _minorVersion > 90 ? (byte) (_minorVersion % 10) : (byte) 0;
+ }
+
+ public String toString()
+ {
+ return _stringFormat;
+ }
+
+ public int compareTo(Object o)
+ {
+ ProtocolVersion pv = (ProtocolVersion) o;
+
+ /*
+ * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
+ * so we need to deal with that case specially
+ */
+
+ if((_majorVersion == (byte) 8) && (_minorVersion == (byte) 0))
+ {
+ ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
+ return fixedThis.compareTo(pv);
+ }
+
+ if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
+ {
+ ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
+ return this.compareTo(fixedOther);
+ }
+
+ if(_majorVersion > pv.getMajorVersion())
+ {
+ return 1;
+ }
+ else if(_majorVersion < pv.getMajorVersion())
+ {
+ return -1;
+ }
+ else if(_minorVersion > pv.getMinorVersion())
+ {
+ return 1;
+ }
+ else if(getMinorVersion() < pv.getMinorVersion())
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+
+ }
+
+ public boolean equals(Object o)
+ {
+ return o != null && (o == this || (compareTo(o) == 0));
+ }
+
+ public int hashCode()
+ {
+ return (0xFF & (int)_minorVersion) | ((0xFF & (int)_majorVersion) << 8);
+ }
+
+ public boolean isSupported()
+ {
+ return _supportedVersions.contains(this);
+ }
+
+ public static ProtocolVersion getLatestSupportedVersion()
+ {
+ return _supportedVersions.last();
+ }
+
+ private static final SortedSet<ProtocolVersion> _supportedVersions;
+ private static final Map<String, ProtocolVersion> _nameToVersionMap =
+ new HashMap<String, ProtocolVersion>();
+ private static final ProtocolVersion _defaultVersion;
+
+ public static final ProtocolVersion v0_10 = new ProtocolVersion((byte)0,(byte)10);
+
+ public static final ProtocolVersion v0_9 = new ProtocolVersion((byte)0,(byte)9);
+ public static final ProtocolVersion v0_91 = new ProtocolVersion((byte)0,(byte)91);
+ public static final ProtocolVersion v8_0 = new ProtocolVersion((byte)8,(byte)0);
+
+ static
+ {
+ SortedSet<ProtocolVersion> versions = new TreeSet<ProtocolVersion>();
+
+ versions.add(v0_10);
+ _nameToVersionMap.put("0-10", v0_10);
+ versions.add(v0_9);
+ _nameToVersionMap.put("0-9", v0_9);
+ versions.add(v0_91);
+ _nameToVersionMap.put("0-91", v0_91);
+ versions.add(v8_0);
+ _nameToVersionMap.put("8-0", v8_0);
+ _supportedVersions = Collections.unmodifiableSortedSet(versions);
+
+ ProtocolVersion systemDefinedVersion =
+ _nameToVersionMap.get(System.getProperty("org.apache.qpid.amqp_version"));
+
+ _defaultVersion = (systemDefinedVersion == null)
+ ? getLatestSupportedVersion()
+ : systemDefinedVersion;
+ }
+
+ public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
+ {
+ return _supportedVersions;
+ }
+
+ public static ProtocolVersion parse(String name)
+ {
+ return _nameToVersionMap.get(name);
+ }
+
+ public static ProtocolVersion defaultProtocolVersion()
+ {
+ return _defaultVersion;
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java
new file mode 100644
index 0000000000..d5f3b2b924
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueBindBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getArguments();
+
+ public AMQShortString getExchange();
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public AMQShortString getRoutingKey();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java
new file mode 100644
index 0000000000..3e2f0104f8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueBindOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java
new file mode 100644
index 0000000000..23066457e6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueDeclareBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getArguments();
+
+ public boolean getAutoDelete();
+
+ public boolean getDurable();
+
+ public boolean getExclusive();
+
+ public boolean getNowait();
+
+ public boolean getPassive();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java
new file mode 100644
index 0000000000..0557f2c54d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueDeclareOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getConsumerCount();
+
+ public long getMessageCount();
+
+ public AMQShortString getQueue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java
new file mode 100644
index 0000000000..2cced4d67e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueDeleteBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getIfEmpty();
+
+ public boolean getIfUnused();
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java
new file mode 100644
index 0000000000..41acf6f246
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueDeleteOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getMessageCount();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java
new file mode 100644
index 0000000000..1965345997
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueuePurgeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java
new file mode 100644
index 0000000000..2641dcf81d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueuePurgeOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getMessageCount();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java
new file mode 100644
index 0000000000..9c6caafc74
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueUnbindBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getArguments();
+
+ public AMQShortString getExchange();
+
+ public AMQShortString getQueue();
+
+ public AMQShortString getRoutingKey();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java
new file mode 100644
index 0000000000..bdd8eb9359
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface QueueUnbindOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java
new file mode 100644
index 0000000000..6df8defed1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQException;
+
+public interface ServerMethodDispatcher
+{
+
+ public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelBody.java
new file mode 100644
index 0000000000..f5325ae4c0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamCancelBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getNowait();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelOkBody.java
new file mode 100644
index 0000000000..f19410d97f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamCancelOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamCancelOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeBody.java
new file mode 100644
index 0000000000..0226547fd8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeBody.java
@@ -0,0 +1,47 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamConsumeBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public boolean getExclusive();
+
+
+ public boolean getNoLocal();
+
+ public boolean getNowait();
+
+ public AMQShortString getQueue();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeOkBody.java
new file mode 100644
index 0000000000..3d089823e2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamConsumeOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamConsumeOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamDeliverBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamDeliverBody.java
new file mode 100644
index 0000000000..76a6231ad6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamDeliverBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamDeliverBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getConsumerTag();
+
+ public long getDeliveryTag();
+
+ public AMQShortString getExchange();
+
+ public AMQShortString getQueue();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamPublishBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamPublishBody.java
new file mode 100644
index 0000000000..98860389bc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamPublishBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamPublishBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public boolean getImmediate();
+
+ public boolean getMandatory();
+
+ public AMQShortString getRoutingKey();
+
+ public int getTicket();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosBody.java
new file mode 100644
index 0000000000..e28c4abd59
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamQosBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getConsumeRate();
+
+ public boolean getGlobal();
+
+ public int getPrefetchCount();
+
+ public long getPrefetchSize();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosOkBody.java
new file mode 100644
index 0000000000..1a71ba1dfa
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamQosOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamQosOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamReturnBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamReturnBody.java
new file mode 100644
index 0000000000..e87863080d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/StreamReturnBody.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface StreamReturnBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public AMQShortString getExchange();
+
+ public int getReplyCode();
+
+ public AMQShortString getReplyText();
+
+ public AMQShortString getRoutingKey();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentBody.java
new file mode 100644
index 0000000000..96b5a056c5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestContentBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentOkBody.java
new file mode 100644
index 0000000000..9da514a20b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestContentOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestContentOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getContentChecksum();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerBody.java
new file mode 100644
index 0000000000..a024aba9c6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerBody.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestIntegerBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public short getInteger1();
+
+ public int getInteger2();
+
+ public long getInteger3();
+
+ public long getInteger4();
+
+ public short getOperation();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerOkBody.java
new file mode 100644
index 0000000000..7f7003031c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestIntegerOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestIntegerOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getResult();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringBody.java
new file mode 100644
index 0000000000..9474521aad
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestStringBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public short getOperation();
+
+ public AMQShortString getString1();
+
+ public byte[] getString2();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringOkBody.java
new file mode 100644
index 0000000000..7dc519a92e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestStringOkBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestStringOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public byte[] getResult();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableBody.java
new file mode 100644
index 0000000000..4b80b72771
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableBody.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestTableBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public short getIntegerOp();
+
+ public short getStringOp();
+
+ public FieldTable getTable();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableOkBody.java
new file mode 100644
index 0000000000..af3f3ca864
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TestTableOkBody.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TestTableOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public long getIntegerResult();
+
+ public byte[] getStringResult();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TunnelRequestBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TunnelRequestBody.java
new file mode 100644
index 0000000000..98785aa4cc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TunnelRequestBody.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TunnelRequestBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+ public FieldTable getMetaData();
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java
new file mode 100644
index 0000000000..189ea0cd40
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxCommitBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java
new file mode 100644
index 0000000000..3df65e0504
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxCommitOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java
new file mode 100644
index 0000000000..d440dc8e04
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxRollbackBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java
new file mode 100644
index 0000000000..c542ff790a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxRollbackOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java
new file mode 100644
index 0000000000..c3c881cd9d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxSelectBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java
new file mode 100644
index 0000000000..6841283bb2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ * 0-91
+ * 8-0
+ */
+
+package org.apache.qpid.framing;
+
+public interface TxSelectOkBody extends EncodableAMQDataBlock, AMQMethodBody
+{
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java
new file mode 100644
index 0000000000..88897e0ff6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class AccessRequestBodyImpl extends AMQMethodBody_0_9 implements AccessRequestBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new AccessRequestBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 30;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final AMQShortString _realm; // [realm]
+ private final byte _bitfield0; // [exclusive, passive, active, write, read]
+
+ // Constructor
+ public AccessRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _realm = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public AccessRequestBodyImpl(
+ AMQShortString realm,
+ boolean exclusive,
+ boolean passive,
+ boolean active,
+ boolean write,
+ boolean read
+ )
+ {
+ _realm = realm;
+ byte bitfield0 = (byte)0;
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( write )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( read )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getRealm()
+ {
+ return _realm;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getWrite()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getRead()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _realm );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _realm );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchAccessRequest(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[AccessRequestBodyImpl: ");
+ buf.append( "realm=" );
+ buf.append( getRealm() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append( ", " );
+ buf.append( "write=" );
+ buf.append( getWrite() );
+ buf.append( ", " );
+ buf.append( "read=" );
+ buf.append( getRead() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java
new file mode 100644
index 0000000000..95087228f2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class AccessRequestOkBodyImpl extends AMQMethodBody_0_9 implements AccessRequestOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new AccessRequestOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 30;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+
+ // Constructor
+ public AccessRequestOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ }
+
+ public AccessRequestOkBodyImpl(
+ int ticket
+ )
+ {
+ _ticket = ticket;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchAccessRequestOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[AccessRequestOkBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicAckBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicAckBodyImpl.java
new file mode 100644
index 0000000000..b1f9757391
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicAckBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicAckBodyImpl extends AMQMethodBody_0_9 implements BasicAckBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicAckBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [multiple]
+
+ // Constructor
+ public BasicAckBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicAckBodyImpl(
+ long deliveryTag,
+ boolean multiple
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( multiple )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getMultiple()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicAck(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicAckBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "multiple=" );
+ buf.append( getMultiple() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelBodyImpl.java
new file mode 100644
index 0000000000..f536b9d8a5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelBodyImpl extends AMQMethodBody_0_9 implements BasicCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public BasicCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelOkBodyImpl.java
new file mode 100644
index 0000000000..ae2fe58ff9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelOkBodyImpl extends AMQMethodBody_0_9 implements BasicCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeBodyImpl.java
new file mode 100644
index 0000000000..177dc6ace2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeBodyImpl extends AMQMethodBody_0_9 implements BasicConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public BasicConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public BasicConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..647c58cbc4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeOkBodyImpl extends AMQMethodBody_0_9 implements BasicConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicDeliverBodyImpl.java
new file mode 100644
index 0000000000..3d2602e605
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicDeliverBodyImpl.java
@@ -0,0 +1,168 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicDeliverBodyImpl extends AMQMethodBody_0_9 implements BasicDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetBodyImpl.java
new file mode 100644
index 0000000000..0b21ddf8e9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetBodyImpl extends AMQMethodBody_0_9 implements BasicGetBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [noAck]
+
+ // Constructor
+ public BasicGetBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicGetBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean noAck
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicGet(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetEmptyBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetEmptyBodyImpl.java
new file mode 100644
index 0000000000..29cf72d053
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetEmptyBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetEmptyBodyImpl extends AMQMethodBody_0_9 implements BasicGetEmptyBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetEmptyBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 72;
+
+ // Fields declared in specification
+ private final AMQShortString _clusterId; // [clusterId]
+
+ // Constructor
+ public BasicGetEmptyBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clusterId = readAMQShortString( buffer );
+ }
+
+ public BasicGetEmptyBodyImpl(
+ AMQShortString clusterId
+ )
+ {
+ _clusterId = clusterId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getClusterId()
+ {
+ return _clusterId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clusterId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _clusterId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicGetEmpty(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetEmptyBodyImpl: ");
+ buf.append( "clusterId=" );
+ buf.append( getClusterId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetOkBodyImpl.java
new file mode 100644
index 0000000000..00bbdd7082
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicGetOkBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetOkBodyImpl extends AMQMethodBody_0_9 implements BasicGetOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 71;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public BasicGetOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public BasicGetOkBodyImpl(
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ long messageCount
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 13;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicGetOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetOkBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicPublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicPublishBodyImpl.java
new file mode 100644
index 0000000000..b9f941b85e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicPublishBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicPublishBodyImpl extends AMQMethodBody_0_9 implements BasicPublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicPublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+
+ // Constructor
+ public BasicPublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicPublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicPublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicPublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosBodyImpl.java
new file mode 100644
index 0000000000..c461f6b118
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosBodyImpl extends AMQMethodBody_0_9 implements BasicQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public BasicQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosOkBodyImpl.java
new file mode 100644
index 0000000000..9bc5d6f3b8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosOkBodyImpl extends AMQMethodBody_0_9 implements BasicQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverBodyImpl.java
new file mode 100644
index 0000000000..498e8f85dc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverBodyImpl extends AMQMethodBody_0_9 implements BasicRecoverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRecoverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRecoverBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicRecover(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java
new file mode 100644
index 0000000000..05390ea493
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverSyncBodyImpl extends AMQMethodBody_0_9 implements BasicRecoverSyncBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverSyncBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 102;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRecoverSyncBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRecoverSyncBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicRecoverSync(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverSyncBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java
new file mode 100644
index 0000000000..0b889e4a21
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverSyncOkBodyImpl extends AMQMethodBody_0_9 implements BasicRecoverSyncOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverSyncOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 101;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicRecoverSyncOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicRecoverSyncOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicRecoverSyncOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverSyncOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRejectBodyImpl.java
new file mode 100644
index 0000000000..3e8cf6b825
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRejectBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRejectBodyImpl extends AMQMethodBody_0_9 implements BasicRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRejectBodyImpl(
+ long deliveryTag,
+ boolean requeue
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRejectBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicReturnBodyImpl.java
new file mode 100644
index 0000000000..c88391dca3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicReturnBodyImpl extends AMQMethodBody_0_9 implements BasicReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchBasicReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseBodyImpl.java
new file mode 100644
index 0000000000..ceadeb8f7c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseBodyImpl extends AMQMethodBody_0_9 implements ChannelCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ChannelCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ChannelCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseOkBodyImpl.java
new file mode 100644
index 0000000000..5df83134f7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseOkBodyImpl extends AMQMethodBody_0_9 implements ChannelCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowBodyImpl.java
new file mode 100644
index 0000000000..62e9bf90a0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowBodyImpl extends AMQMethodBody_0_9 implements ChannelFlowBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelFlow(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowOkBodyImpl.java
new file mode 100644
index 0000000000..5c73bd2ff4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelFlowOkBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowOkBodyImpl extends AMQMethodBody_0_9 implements ChannelFlowOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowOkBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelFlowOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowOkBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOkBodyImpl.java
new file mode 100644
index 0000000000..7945fcec47
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOkBodyImpl extends AMQMethodBody_0_9 implements ChannelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenBodyImpl.java
new file mode 100644
index 0000000000..10c06cb132
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenBodyImpl extends AMQMethodBody_0_9 implements ChannelOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final AMQShortString _outOfBand; // [outOfBand]
+
+ // Constructor
+ public ChannelOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _outOfBand = readAMQShortString( buffer );
+ }
+
+ public ChannelOpenBodyImpl(
+ AMQShortString outOfBand
+ )
+ {
+ _outOfBand = outOfBand;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getOutOfBand()
+ {
+ return _outOfBand;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _outOfBand );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _outOfBand );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenBodyImpl: ");
+ buf.append( "outOfBand=" );
+ buf.append( getOutOfBand() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java
new file mode 100644
index 0000000000..1c2a3f4a57
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenOkBodyImpl extends AMQMethodBody_0_9 implements ChannelOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final byte[] _channelId; // [channelId]
+
+ // Constructor
+ public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelId = readBytes( buffer );
+ }
+
+ public ChannelOpenOkBodyImpl(
+ byte[] channelId
+ )
+ {
+ _channelId = channelId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChannelId()
+ {
+ return _channelId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _channelId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _channelId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: ");
+ buf.append( "channelId=" );
+ buf.append( getChannelId() == null ? "null" : java.util.Arrays.toString( getChannelId() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPingBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPingBodyImpl.java
new file mode 100644
index 0000000000..ba02f17b99
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPingBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelPingBodyImpl extends AMQMethodBody_0_9 implements ChannelPingBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelPingBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelPingBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelPingBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelPing(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelPingBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPongBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPongBodyImpl.java
new file mode 100644
index 0000000000..da37e5127e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelPongBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelPongBodyImpl extends AMQMethodBody_0_9 implements ChannelPongBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelPongBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelPongBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelPongBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelPong(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelPongBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelResumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelResumeBodyImpl.java
new file mode 100644
index 0000000000..47fc5c60be
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelResumeBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelResumeBodyImpl extends AMQMethodBody_0_9 implements ChannelResumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelResumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final byte[] _channelId; // [channelId]
+
+ // Constructor
+ public ChannelResumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelId = readBytes( buffer );
+ }
+
+ public ChannelResumeBodyImpl(
+ byte[] channelId
+ )
+ {
+ _channelId = channelId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChannelId()
+ {
+ return _channelId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _channelId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _channelId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchChannelResume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelResumeBodyImpl: ");
+ buf.append( "channelId=" );
+ buf.append( getChannelId() == null ? "null" : java.util.Arrays.toString( getChannelId() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ClientMethodDispatcher_0_9.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ClientMethodDispatcher_0_9.java
new file mode 100644
index 0000000000..f1bf0d5a53
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ClientMethodDispatcher_0_9.java
@@ -0,0 +1,97 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+public interface ClientMethodDispatcher_0_9 extends ClientMethodDispatcher
+{
+
+ public boolean dispatchAccessRequestOk(AccessRequestOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecoverSyncOk(BasicRecoverSyncOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOk(ChannelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelPing(ChannelPingBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelPong(ChannelPongBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionRedirect(ConnectionRedirectBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxSelectOk(DtxSelectOkBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxStartOk(DtxStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileCancelOk(FileCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileConsumeOk(FileConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileDeliver(FileDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileQosOk(FileQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileReturn(FileReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageAppend(MessageAppendBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageCheckpoint(MessageCheckpointBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageClose(MessageCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageEmpty(MessageEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOffset(MessageOffsetBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOk(MessageOkBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOpen(MessageOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageReject(MessageRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageResume(MessageResumeBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageTransfer(MessageTransferBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueUnbindOk(QueueUnbindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamCancelOk(StreamCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamConsumeOk(StreamConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamDeliver(StreamDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamQosOk(StreamQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamReturn(StreamReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java
new file mode 100644
index 0000000000..e0f8704f67
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseBodyImpl extends AMQMethodBody_0_9 implements ConnectionCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ConnectionCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java
new file mode 100644
index 0000000000..98f73b0beb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseOkBodyImpl extends AMQMethodBody_0_9 implements ConnectionCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 51;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ConnectionCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenBodyImpl.java
new file mode 100644
index 0000000000..86c40656bb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenBodyImpl.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenBodyImpl extends AMQMethodBody_0_9 implements ConnectionOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final AMQShortString _virtualHost; // [virtualHost]
+ private final AMQShortString _capabilities; // [capabilities]
+ private final byte _bitfield0; // [insist]
+
+ // Constructor
+ public ConnectionOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _virtualHost = readAMQShortString( buffer );
+ _capabilities = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ConnectionOpenBodyImpl(
+ AMQShortString virtualHost,
+ AMQShortString capabilities,
+ boolean insist
+ )
+ {
+ _virtualHost = virtualHost;
+ _capabilities = capabilities;
+ byte bitfield0 = (byte)0;
+ if( insist )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getVirtualHost()
+ {
+ return _virtualHost;
+ }
+ public final AMQShortString getCapabilities()
+ {
+ return _capabilities;
+ }
+ public final boolean getInsist()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _virtualHost );
+ size += getSizeOf( _capabilities );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _virtualHost );
+ writeAMQShortString( buffer, _capabilities );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenBodyImpl: ");
+ buf.append( "virtualHost=" );
+ buf.append( getVirtualHost() );
+ buf.append( ", " );
+ buf.append( "capabilities=" );
+ buf.append( getCapabilities() );
+ buf.append( ", " );
+ buf.append( "insist=" );
+ buf.append( getInsist() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenOkBodyImpl.java
new file mode 100644
index 0000000000..0439fc01b8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionOpenOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenOkBodyImpl extends AMQMethodBody_0_9 implements ConnectionOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final AMQShortString _knownHosts; // [knownHosts]
+
+ // Constructor
+ public ConnectionOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _knownHosts = readAMQShortString( buffer );
+ }
+
+ public ConnectionOpenOkBodyImpl(
+ AMQShortString knownHosts
+ )
+ {
+ _knownHosts = knownHosts;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getKnownHosts()
+ {
+ return _knownHosts;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _knownHosts );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _knownHosts );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenOkBodyImpl: ");
+ buf.append( "knownHosts=" );
+ buf.append( getKnownHosts() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java
new file mode 100644
index 0000000000..270161db47
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionRedirectBodyImpl extends AMQMethodBody_0_9 implements ConnectionRedirectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionRedirectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 42;
+
+ // Fields declared in specification
+ private final AMQShortString _host; // [host]
+ private final AMQShortString _knownHosts; // [knownHosts]
+
+ // Constructor
+ public ConnectionRedirectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _host = readAMQShortString( buffer );
+ _knownHosts = readAMQShortString( buffer );
+ }
+
+ public ConnectionRedirectBodyImpl(
+ AMQShortString host,
+ AMQShortString knownHosts
+ )
+ {
+ _host = host;
+ _knownHosts = knownHosts;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getHost()
+ {
+ return _host;
+ }
+ public final AMQShortString getKnownHosts()
+ {
+ return _knownHosts;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _host );
+ size += getSizeOf( _knownHosts );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _host );
+ writeAMQShortString( buffer, _knownHosts );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionRedirect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionRedirectBodyImpl: ");
+ buf.append( "host=" );
+ buf.append( getHost() );
+ buf.append( ", " );
+ buf.append( "knownHosts=" );
+ buf.append( getKnownHosts() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureBodyImpl.java
new file mode 100644
index 0000000000..19b9532f5b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureBodyImpl extends AMQMethodBody_0_9 implements ConnectionSecureBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte[] _challenge; // [challenge]
+
+ // Constructor
+ public ConnectionSecureBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _challenge = readBytes( buffer );
+ }
+
+ public ConnectionSecureBodyImpl(
+ byte[] challenge
+ )
+ {
+ _challenge = challenge;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChallenge()
+ {
+ return _challenge;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _challenge );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _challenge );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionSecure(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureBodyImpl: ");
+ buf.append( "challenge=" );
+ buf.append( getChallenge() == null ? "null" : java.util.Arrays.toString( getChallenge() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureOkBodyImpl.java
new file mode 100644
index 0000000000..7891d7d24c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionSecureOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureOkBodyImpl extends AMQMethodBody_0_9 implements ConnectionSecureOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte[] _response; // [response]
+
+ // Constructor
+ public ConnectionSecureOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _response = readBytes( buffer );
+ }
+
+ public ConnectionSecureOkBodyImpl(
+ byte[] response
+ )
+ {
+ _response = response;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _response );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _response );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionSecureOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureOkBodyImpl: ");
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartBodyImpl.java
new file mode 100644
index 0000000000..ec82327f4d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartBodyImpl.java
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartBodyImpl extends AMQMethodBody_0_9 implements ConnectionStartBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final short _versionMajor; // [versionMajor]
+ private final short _versionMinor; // [versionMinor]
+ private final FieldTable _serverProperties; // [serverProperties]
+ private final byte[] _mechanisms; // [mechanisms]
+ private final byte[] _locales; // [locales]
+
+ // Constructor
+ public ConnectionStartBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _versionMajor = readUnsignedByte( buffer );
+ _versionMinor = readUnsignedByte( buffer );
+ _serverProperties = readFieldTable( buffer );
+ _mechanisms = readBytes( buffer );
+ _locales = readBytes( buffer );
+ }
+
+ public ConnectionStartBodyImpl(
+ short versionMajor,
+ short versionMinor,
+ FieldTable serverProperties,
+ byte[] mechanisms,
+ byte[] locales
+ )
+ {
+ _versionMajor = versionMajor;
+ _versionMinor = versionMinor;
+ _serverProperties = serverProperties;
+ _mechanisms = mechanisms;
+ _locales = locales;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final short getVersionMajor()
+ {
+ return _versionMajor;
+ }
+ public final short getVersionMinor()
+ {
+ return _versionMinor;
+ }
+ public final FieldTable getServerProperties()
+ {
+ return _serverProperties;
+ }
+ public final byte[] getMechanisms()
+ {
+ return _mechanisms;
+ }
+ public final byte[] getLocales()
+ {
+ return _locales;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _serverProperties );
+ size += getSizeOf( _mechanisms );
+ size += getSizeOf( _locales );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedByte( buffer, _versionMajor );
+ writeUnsignedByte( buffer, _versionMinor );
+ writeFieldTable( buffer, _serverProperties );
+ writeBytes( buffer, _mechanisms );
+ writeBytes( buffer, _locales );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionStart(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartBodyImpl: ");
+ buf.append( "versionMajor=" );
+ buf.append( getVersionMajor() );
+ buf.append( ", " );
+ buf.append( "versionMinor=" );
+ buf.append( getVersionMinor() );
+ buf.append( ", " );
+ buf.append( "serverProperties=" );
+ buf.append( getServerProperties() );
+ buf.append( ", " );
+ buf.append( "mechanisms=" );
+ buf.append( getMechanisms() == null ? "null" : java.util.Arrays.toString( getMechanisms() ) );
+ buf.append( ", " );
+ buf.append( "locales=" );
+ buf.append( getLocales() == null ? "null" : java.util.Arrays.toString( getLocales() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartOkBodyImpl.java
new file mode 100644
index 0000000000..cdc77c87fd
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionStartOkBodyImpl.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartOkBodyImpl extends AMQMethodBody_0_9 implements ConnectionStartOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final FieldTable _clientProperties; // [clientProperties]
+ private final AMQShortString _mechanism; // [mechanism]
+ private final byte[] _response; // [response]
+ private final AMQShortString _locale; // [locale]
+
+ // Constructor
+ public ConnectionStartOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clientProperties = readFieldTable( buffer );
+ _mechanism = readAMQShortString( buffer );
+ _response = readBytes( buffer );
+ _locale = readAMQShortString( buffer );
+ }
+
+ public ConnectionStartOkBodyImpl(
+ FieldTable clientProperties,
+ AMQShortString mechanism,
+ byte[] response,
+ AMQShortString locale
+ )
+ {
+ _clientProperties = clientProperties;
+ _mechanism = mechanism;
+ _response = response;
+ _locale = locale;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getClientProperties()
+ {
+ return _clientProperties;
+ }
+ public final AMQShortString getMechanism()
+ {
+ return _mechanism;
+ }
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+ public final AMQShortString getLocale()
+ {
+ return _locale;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clientProperties );
+ size += getSizeOf( _mechanism );
+ size += getSizeOf( _response );
+ size += getSizeOf( _locale );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _clientProperties );
+ writeAMQShortString( buffer, _mechanism );
+ writeBytes( buffer, _response );
+ writeAMQShortString( buffer, _locale );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionStartOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartOkBodyImpl: ");
+ buf.append( "clientProperties=" );
+ buf.append( getClientProperties() );
+ buf.append( ", " );
+ buf.append( "mechanism=" );
+ buf.append( getMechanism() );
+ buf.append( ", " );
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append( ", " );
+ buf.append( "locale=" );
+ buf.append( getLocale() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneBodyImpl.java
new file mode 100644
index 0000000000..a5cb1f4d77
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneBodyImpl extends AMQMethodBody_0_9 implements ConnectionTuneBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionTune(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneOkBodyImpl.java
new file mode 100644
index 0000000000..2dee4765f5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionTuneOkBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneOkBodyImpl extends AMQMethodBody_0_9 implements ConnectionTuneOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneOkBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionTuneOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneOkBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectBodyImpl.java
new file mode 100644
index 0000000000..5739697389
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxSelectBodyImpl extends AMQMethodBody_0_9 implements DtxSelectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxSelectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxSelectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxSelectBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchDtxSelect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxSelectBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectOkBodyImpl.java
new file mode 100644
index 0000000000..b379501617
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxSelectOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxSelectOkBodyImpl extends AMQMethodBody_0_9 implements DtxSelectOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxSelectOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxSelectOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxSelectOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchDtxSelectOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxSelectOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartBodyImpl.java
new file mode 100644
index 0000000000..162c0b31ad
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxStartBodyImpl extends AMQMethodBody_0_9 implements DtxStartBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxStartBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final AMQShortString _dtxIdentifier; // [dtxIdentifier]
+
+ // Constructor
+ public DtxStartBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _dtxIdentifier = readAMQShortString( buffer );
+ }
+
+ public DtxStartBodyImpl(
+ AMQShortString dtxIdentifier
+ )
+ {
+ _dtxIdentifier = dtxIdentifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getDtxIdentifier()
+ {
+ return _dtxIdentifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _dtxIdentifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _dtxIdentifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchDtxStart(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxStartBodyImpl: ");
+ buf.append( "dtxIdentifier=" );
+ buf.append( getDtxIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartOkBodyImpl.java
new file mode 100644
index 0000000000..fbe9b86e56
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/DtxStartOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxStartOkBodyImpl extends AMQMethodBody_0_9 implements DtxStartOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxStartOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxStartOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxStartOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchDtxStartOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxStartOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundBodyImpl.java
new file mode 100644
index 0000000000..92ba4edc03
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundBodyImpl.java
@@ -0,0 +1,138 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundBodyImpl extends AMQMethodBody_0_9 implements ExchangeBoundBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 22;
+
+ // Fields declared in specification
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _queue; // [queue]
+
+ // Constructor
+ public ExchangeBoundBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _queue = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundBodyImpl(
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString queue
+ )
+ {
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _queue = queue;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _queue );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeBound(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundBodyImpl: ");
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundOkBodyImpl.java
new file mode 100644
index 0000000000..4f594b9a70
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeBoundOkBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundOkBodyImpl extends AMQMethodBody_0_9 implements ExchangeBoundOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 23;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+
+ // Constructor
+ public ExchangeBoundOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundOkBodyImpl(
+ int replyCode,
+ AMQShortString replyText
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeBoundOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundOkBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareBodyImpl.java
new file mode 100644
index 0000000000..50b6889735
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareBodyImpl.java
@@ -0,0 +1,220 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareBodyImpl extends AMQMethodBody_0_9 implements ExchangeDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _type; // [type]
+ private final byte _bitfield0; // [passive, durable, autoDelete, internal, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public ExchangeDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _type = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public ExchangeDeclareBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString type,
+ boolean passive,
+ boolean durable,
+ boolean autoDelete,
+ boolean internal,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _type = type;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( internal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getType()
+ {
+ return _type;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getInternal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _type );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _type );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "type=" );
+ buf.append( getType() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "internal=" );
+ buf.append( getInternal() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..adaff55cc8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeclareOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareOkBodyImpl extends AMQMethodBody_0_9 implements ExchangeDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeclareOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteBodyImpl.java
new file mode 100644
index 0000000000..60da6c8330
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteBodyImpl.java
@@ -0,0 +1,154 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteBodyImpl extends AMQMethodBody_0_9 implements ExchangeDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final byte _bitfield0; // [ifUnused, nowait]
+
+ // Constructor
+ public ExchangeDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ExchangeDeleteBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ boolean ifUnused,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..89eab25c74
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ExchangeDeleteOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteOkBodyImpl extends AMQMethodBody_0_9 implements ExchangeDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeleteOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchExchangeDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileAckBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileAckBodyImpl.java
new file mode 100644
index 0000000000..b2e0727fc3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileAckBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileAckBodyImpl extends AMQMethodBody_0_9 implements FileAckBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileAckBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [multiple]
+
+ // Constructor
+ public FileAckBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileAckBodyImpl(
+ long deliveryTag,
+ boolean multiple
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( multiple )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getMultiple()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileAck(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileAckBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "multiple=" );
+ buf.append( getMultiple() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelBodyImpl.java
new file mode 100644
index 0000000000..a1cddb1bc1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileCancelBodyImpl extends AMQMethodBody_0_9 implements FileCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public FileCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelOkBodyImpl.java
new file mode 100644
index 0000000000..258b55f6d8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileCancelOkBodyImpl extends AMQMethodBody_0_9 implements FileCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public FileCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public FileCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeBodyImpl.java
new file mode 100644
index 0000000000..d841fab69d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileConsumeBodyImpl extends AMQMethodBody_0_9 implements FileConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive, nowait]
+ private final FieldTable _filter; // [filter]
+
+ // Constructor
+ public FileConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _filter = readFieldTable( buffer );
+ }
+
+ public FileConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ boolean nowait,
+ FieldTable filter
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ _bitfield0 = bitfield0;
+ _filter = filter;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final FieldTable getFilter()
+ {
+ return _filter;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _filter );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _filter );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "filter=" );
+ buf.append( getFilter() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..139ab0cbce
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileConsumeOkBodyImpl extends AMQMethodBody_0_9 implements FileConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public FileConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public FileConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileDeliverBodyImpl.java
new file mode 100644
index 0000000000..5e4b15ef74
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileDeliverBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileDeliverBodyImpl extends AMQMethodBody_0_9 implements FileDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public FileDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public FileDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString identifier
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenBodyImpl.java
new file mode 100644
index 0000000000..7c2352eee3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileOpenBodyImpl extends AMQMethodBody_0_9 implements FileOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final AMQShortString _identifier; // [identifier]
+ private final long _contentSize; // [contentSize]
+
+ // Constructor
+ public FileOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _identifier = readAMQShortString( buffer );
+ _contentSize = readLong( buffer );
+ }
+
+ public FileOpenBodyImpl(
+ AMQShortString identifier,
+ long contentSize
+ )
+ {
+ _identifier = identifier;
+ _contentSize = contentSize;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+ public final long getContentSize()
+ {
+ return _contentSize;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _identifier );
+ writeLong( buffer, _contentSize );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileOpenBodyImpl: ");
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append( ", " );
+ buf.append( "contentSize=" );
+ buf.append( getContentSize() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenOkBodyImpl.java
new file mode 100644
index 0000000000..05a132cce2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileOpenOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileOpenOkBodyImpl extends AMQMethodBody_0_9 implements FileOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _stagedSize; // [stagedSize]
+
+ // Constructor
+ public FileOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _stagedSize = readLong( buffer );
+ }
+
+ public FileOpenOkBodyImpl(
+ long stagedSize
+ )
+ {
+ _stagedSize = stagedSize;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getStagedSize()
+ {
+ return _stagedSize;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _stagedSize );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileOpenOkBodyImpl: ");
+ buf.append( "stagedSize=" );
+ buf.append( getStagedSize() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FilePublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FilePublishBodyImpl.java
new file mode 100644
index 0000000000..f04a869bcc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FilePublishBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FilePublishBodyImpl extends AMQMethodBody_0_9 implements FilePublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FilePublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public FilePublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public FilePublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate,
+ AMQShortString identifier
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ _bitfield0 = bitfield0;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFilePublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FilePublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosBodyImpl.java
new file mode 100644
index 0000000000..0d6fe98029
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileQosBodyImpl extends AMQMethodBody_0_9 implements FileQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public FileQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosOkBodyImpl.java
new file mode 100644
index 0000000000..b7703c633a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileQosOkBodyImpl extends AMQMethodBody_0_9 implements FileQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public FileQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public FileQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileRejectBodyImpl.java
new file mode 100644
index 0000000000..b73014ebe2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileRejectBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileRejectBodyImpl extends AMQMethodBody_0_9 implements FileRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public FileRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileRejectBodyImpl(
+ long deliveryTag,
+ boolean requeue
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileRejectBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileReturnBodyImpl.java
new file mode 100644
index 0000000000..4a0d600f13
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileReturnBodyImpl extends AMQMethodBody_0_9 implements FileReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public FileReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public FileReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileStageBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileStageBodyImpl.java
new file mode 100644
index 0000000000..dfb76279e8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/FileStageBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileStageBodyImpl extends AMQMethodBody_0_9 implements FileStageBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileStageBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+
+ // Constructor
+ public FileStageBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public FileStageBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchFileStage(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileStageBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageAppendBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageAppendBodyImpl.java
new file mode 100644
index 0000000000..4964c77ab6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageAppendBodyImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageAppendBodyImpl extends AMQMethodBody_0_9 implements MessageAppendBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageAppendBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final byte[] _reference; // [reference]
+ private final byte[] _bytes; // [bytes]
+
+ // Constructor
+ public MessageAppendBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _reference = readBytes( buffer );
+ _bytes = readBytes( buffer );
+ }
+
+ public MessageAppendBodyImpl(
+ byte[] reference,
+ byte[] bytes
+ )
+ {
+ _reference = reference;
+ _bytes = bytes;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getReference()
+ {
+ return _reference;
+ }
+ public final byte[] getBytes()
+ {
+ return _bytes;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _reference );
+ size += getSizeOf( _bytes );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _reference );
+ writeBytes( buffer, _bytes );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageAppend(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageAppendBodyImpl: ");
+ buf.append( "reference=" );
+ buf.append( getReference() == null ? "null" : java.util.Arrays.toString( getReference() ) );
+ buf.append( ", " );
+ buf.append( "bytes=" );
+ buf.append( getBytes() == null ? "null" : java.util.Arrays.toString( getBytes() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCancelBodyImpl.java
new file mode 100644
index 0000000000..661b6cd9a3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCancelBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageCancelBodyImpl extends AMQMethodBody_0_9 implements MessageCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _destination; // [destination]
+
+ // Constructor
+ public MessageCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _destination = readAMQShortString( buffer );
+ }
+
+ public MessageCancelBodyImpl(
+ AMQShortString destination
+ )
+ {
+ _destination = destination;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getDestination()
+ {
+ return _destination;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _destination );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _destination );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageCancelBodyImpl: ");
+ buf.append( "destination=" );
+ buf.append( getDestination() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCheckpointBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCheckpointBodyImpl.java
new file mode 100644
index 0000000000..921348ac71
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCheckpointBodyImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageCheckpointBodyImpl extends AMQMethodBody_0_9 implements MessageCheckpointBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageCheckpointBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final byte[] _reference; // [reference]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public MessageCheckpointBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _reference = readBytes( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public MessageCheckpointBodyImpl(
+ byte[] reference,
+ AMQShortString identifier
+ )
+ {
+ _reference = reference;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getReference()
+ {
+ return _reference;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _reference );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _reference );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageCheckpoint(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageCheckpointBodyImpl: ");
+ buf.append( "reference=" );
+ buf.append( getReference() == null ? "null" : java.util.Arrays.toString( getReference() ) );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCloseBodyImpl.java
new file mode 100644
index 0000000000..78185ec507
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageCloseBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageCloseBodyImpl extends AMQMethodBody_0_9 implements MessageCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final byte[] _reference; // [reference]
+
+ // Constructor
+ public MessageCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _reference = readBytes( buffer );
+ }
+
+ public MessageCloseBodyImpl(
+ byte[] reference
+ )
+ {
+ _reference = reference;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getReference()
+ {
+ return _reference;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _reference );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _reference );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageCloseBodyImpl: ");
+ buf.append( "reference=" );
+ buf.append( getReference() == null ? "null" : java.util.Arrays.toString( getReference() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageConsumeBodyImpl.java
new file mode 100644
index 0000000000..fe72503c17
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageConsumeBodyImpl.java
@@ -0,0 +1,194 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageConsumeBodyImpl extends AMQMethodBody_0_9 implements MessageConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _destination; // [destination]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive]
+ private final FieldTable _filter; // [filter]
+
+ // Constructor
+ public MessageConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _destination = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _filter = readFieldTable( buffer );
+ }
+
+ public MessageConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString destination,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ FieldTable filter
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _destination = destination;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ _bitfield0 = bitfield0;
+ _filter = filter;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getDestination()
+ {
+ return _destination;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final FieldTable getFilter()
+ {
+ return _filter;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _destination );
+ size += getSizeOf( _filter );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _destination );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _filter );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "destination=" );
+ buf.append( getDestination() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "filter=" );
+ buf.append( getFilter() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageEmptyBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageEmptyBodyImpl.java
new file mode 100644
index 0000000000..1383836f8e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageEmptyBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageEmptyBodyImpl extends AMQMethodBody_0_9 implements MessageEmptyBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageEmptyBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 510;
+
+ // Fields declared in specification
+
+ // Constructor
+ public MessageEmptyBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public MessageEmptyBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageEmpty(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageEmptyBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageGetBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageGetBodyImpl.java
new file mode 100644
index 0000000000..b812309ac0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageGetBodyImpl.java
@@ -0,0 +1,154 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageGetBodyImpl extends AMQMethodBody_0_9 implements MessageGetBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageGetBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _destination; // [destination]
+ private final byte _bitfield0; // [noAck]
+
+ // Constructor
+ public MessageGetBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _destination = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public MessageGetBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString destination,
+ boolean noAck
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _destination = destination;
+ byte bitfield0 = (byte)0;
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getDestination()
+ {
+ return _destination;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _destination );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _destination );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageGet(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageGetBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "destination=" );
+ buf.append( getDestination() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOffsetBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOffsetBodyImpl.java
new file mode 100644
index 0000000000..52d907df2b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOffsetBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageOffsetBodyImpl extends AMQMethodBody_0_9 implements MessageOffsetBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageOffsetBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 530;
+
+ // Fields declared in specification
+ private final long _value; // [value]
+
+ // Constructor
+ public MessageOffsetBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _value = readLong( buffer );
+ }
+
+ public MessageOffsetBodyImpl(
+ long value
+ )
+ {
+ _value = value;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getValue()
+ {
+ return _value;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _value );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageOffset(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageOffsetBodyImpl: ");
+ buf.append( "value=" );
+ buf.append( getValue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOkBodyImpl.java
new file mode 100644
index 0000000000..c0477e2c13
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageOkBodyImpl extends AMQMethodBody_0_9 implements MessageOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 500;
+
+ // Fields declared in specification
+
+ // Constructor
+ public MessageOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public MessageOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOpenBodyImpl.java
new file mode 100644
index 0000000000..d500317bfe
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageOpenBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageOpenBodyImpl extends AMQMethodBody_0_9 implements MessageOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final byte[] _reference; // [reference]
+
+ // Constructor
+ public MessageOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _reference = readBytes( buffer );
+ }
+
+ public MessageOpenBodyImpl(
+ byte[] reference
+ )
+ {
+ _reference = reference;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getReference()
+ {
+ return _reference;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _reference );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _reference );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageOpenBodyImpl: ");
+ buf.append( "reference=" );
+ buf.append( getReference() == null ? "null" : java.util.Arrays.toString( getReference() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageQosBodyImpl.java
new file mode 100644
index 0000000000..ce4b655131
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageQosBodyImpl extends AMQMethodBody_0_9 implements MessageQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 110;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public MessageQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public MessageQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRecoverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRecoverBodyImpl.java
new file mode 100644
index 0000000000..7fac0d9a46
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRecoverBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageRecoverBodyImpl extends AMQMethodBody_0_9 implements MessageRecoverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageRecoverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public MessageRecoverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public MessageRecoverBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageRecover(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageRecoverBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRejectBodyImpl.java
new file mode 100644
index 0000000000..eb15a960c5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageRejectBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageRejectBodyImpl extends AMQMethodBody_0_9 implements MessageRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 520;
+
+ // Fields declared in specification
+ private final int _code; // [code]
+ private final AMQShortString _text; // [text]
+
+ // Constructor
+ public MessageRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _code = readUnsignedShort( buffer );
+ _text = readAMQShortString( buffer );
+ }
+
+ public MessageRejectBodyImpl(
+ int code,
+ AMQShortString text
+ )
+ {
+ _code = code;
+ _text = text;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getCode()
+ {
+ return _code;
+ }
+ public final AMQShortString getText()
+ {
+ return _text;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _text );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _code );
+ writeAMQShortString( buffer, _text );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageRejectBodyImpl: ");
+ buf.append( "code=" );
+ buf.append( getCode() );
+ buf.append( ", " );
+ buf.append( "text=" );
+ buf.append( getText() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageResumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageResumeBodyImpl.java
new file mode 100644
index 0000000000..b8bcb2f309
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageResumeBodyImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageResumeBodyImpl extends AMQMethodBody_0_9 implements MessageResumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageResumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final byte[] _reference; // [reference]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public MessageResumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _reference = readBytes( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public MessageResumeBodyImpl(
+ byte[] reference,
+ AMQShortString identifier
+ )
+ {
+ _reference = reference;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getReference()
+ {
+ return _reference;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _reference );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _reference );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageResume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageResumeBodyImpl: ");
+ buf.append( "reference=" );
+ buf.append( getReference() == null ? "null" : java.util.Arrays.toString( getReference() ) );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageTransferBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageTransferBodyImpl.java
new file mode 100644
index 0000000000..947334812c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MessageTransferBodyImpl.java
@@ -0,0 +1,384 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class MessageTransferBodyImpl extends AMQMethodBody_0_9 implements MessageTransferBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new MessageTransferBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _destination; // [destination]
+ private final byte _bitfield0; // [redelivered, immediate]
+ private final long _ttl; // [ttl]
+ private final short _priority; // [priority]
+ private final long _timestamp; // [timestamp]
+ private final short _deliveryMode; // [deliveryMode]
+ private final long _expiration; // [expiration]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _messageId; // [messageId]
+ private final AMQShortString _correlationId; // [correlationId]
+ private final AMQShortString _replyTo; // [replyTo]
+ private final AMQShortString _contentType; // [contentType]
+ private final AMQShortString _contentEncoding; // [contentEncoding]
+ private final AMQShortString _userId; // [userId]
+ private final AMQShortString _appId; // [appId]
+ private final AMQShortString _transactionId; // [transactionId]
+ private final byte[] _securityToken; // [securityToken]
+ private final FieldTable _applicationHeaders; // [applicationHeaders]
+ private final Content _body; // [body]
+
+ // Constructor
+ public MessageTransferBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _destination = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _ttl = readLong( buffer );
+ _priority = readUnsignedByte( buffer );
+ _timestamp = readTimestamp( buffer );
+ _deliveryMode = readUnsignedByte( buffer );
+ _expiration = readTimestamp( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _messageId = readAMQShortString( buffer );
+ _correlationId = readAMQShortString( buffer );
+ _replyTo = readAMQShortString( buffer );
+ _contentType = readAMQShortString( buffer );
+ _contentEncoding = readAMQShortString( buffer );
+ _userId = readAMQShortString( buffer );
+ _appId = readAMQShortString( buffer );
+ _transactionId = readAMQShortString( buffer );
+ _securityToken = readBytes( buffer );
+ _applicationHeaders = readFieldTable( buffer );
+ _body = readContent( buffer );
+ }
+
+ public MessageTransferBodyImpl(
+ int ticket,
+ AMQShortString destination,
+ boolean redelivered,
+ boolean immediate,
+ long ttl,
+ short priority,
+ long timestamp,
+ short deliveryMode,
+ long expiration,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString messageId,
+ AMQShortString correlationId,
+ AMQShortString replyTo,
+ AMQShortString contentType,
+ AMQShortString contentEncoding,
+ AMQShortString userId,
+ AMQShortString appId,
+ AMQShortString transactionId,
+ byte[] securityToken,
+ FieldTable applicationHeaders,
+ Content body
+ )
+ {
+ _ticket = ticket;
+ _destination = destination;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ _bitfield0 = bitfield0;
+ _ttl = ttl;
+ _priority = priority;
+ _timestamp = timestamp;
+ _deliveryMode = deliveryMode;
+ _expiration = expiration;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _messageId = messageId;
+ _correlationId = correlationId;
+ _replyTo = replyTo;
+ _contentType = contentType;
+ _contentEncoding = contentEncoding;
+ _userId = userId;
+ _appId = appId;
+ _transactionId = transactionId;
+ _securityToken = securityToken;
+ _applicationHeaders = applicationHeaders;
+ _body = body;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getDestination()
+ {
+ return _destination;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final long getTtl()
+ {
+ return _ttl;
+ }
+ public final short getPriority()
+ {
+ return _priority;
+ }
+ public final long getTimestamp()
+ {
+ return _timestamp;
+ }
+ public final short getDeliveryMode()
+ {
+ return _deliveryMode;
+ }
+ public final long getExpiration()
+ {
+ return _expiration;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getMessageId()
+ {
+ return _messageId;
+ }
+ public final AMQShortString getCorrelationId()
+ {
+ return _correlationId;
+ }
+ public final AMQShortString getReplyTo()
+ {
+ return _replyTo;
+ }
+ public final AMQShortString getContentType()
+ {
+ return _contentType;
+ }
+ public final AMQShortString getContentEncoding()
+ {
+ return _contentEncoding;
+ }
+ public final AMQShortString getUserId()
+ {
+ return _userId;
+ }
+ public final AMQShortString getAppId()
+ {
+ return _appId;
+ }
+ public final AMQShortString getTransactionId()
+ {
+ return _transactionId;
+ }
+ public final byte[] getSecurityToken()
+ {
+ return _securityToken;
+ }
+ public final FieldTable getApplicationHeaders()
+ {
+ return _applicationHeaders;
+ }
+ public final Content getBody()
+ {
+ return _body;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 29;
+ size += getSizeOf( _destination );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _messageId );
+ size += getSizeOf( _correlationId );
+ size += getSizeOf( _replyTo );
+ size += getSizeOf( _contentType );
+ size += getSizeOf( _contentEncoding );
+ size += getSizeOf( _userId );
+ size += getSizeOf( _appId );
+ size += getSizeOf( _transactionId );
+ size += getSizeOf( _securityToken );
+ size += getSizeOf( _applicationHeaders );
+ size += getSizeOf( _body );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _destination );
+ writeBitfield( buffer, _bitfield0 );
+ writeLong( buffer, _ttl );
+ writeUnsignedByte( buffer, _priority );
+ writeTimestamp( buffer, _timestamp );
+ writeUnsignedByte( buffer, _deliveryMode );
+ writeTimestamp( buffer, _expiration );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _messageId );
+ writeAMQShortString( buffer, _correlationId );
+ writeAMQShortString( buffer, _replyTo );
+ writeAMQShortString( buffer, _contentType );
+ writeAMQShortString( buffer, _contentEncoding );
+ writeAMQShortString( buffer, _userId );
+ writeAMQShortString( buffer, _appId );
+ writeAMQShortString( buffer, _transactionId );
+ writeBytes( buffer, _securityToken );
+ writeFieldTable( buffer, _applicationHeaders );
+ writeContent( buffer, _body );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchMessageTransfer(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[MessageTransferBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "destination=" );
+ buf.append( getDestination() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append( ", " );
+ buf.append( "ttl=" );
+ buf.append( getTtl() );
+ buf.append( ", " );
+ buf.append( "priority=" );
+ buf.append( getPriority() );
+ buf.append( ", " );
+ buf.append( "timestamp=" );
+ buf.append( getTimestamp() );
+ buf.append( ", " );
+ buf.append( "deliveryMode=" );
+ buf.append( getDeliveryMode() );
+ buf.append( ", " );
+ buf.append( "expiration=" );
+ buf.append( getExpiration() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "messageId=" );
+ buf.append( getMessageId() );
+ buf.append( ", " );
+ buf.append( "correlationId=" );
+ buf.append( getCorrelationId() );
+ buf.append( ", " );
+ buf.append( "replyTo=" );
+ buf.append( getReplyTo() );
+ buf.append( ", " );
+ buf.append( "contentType=" );
+ buf.append( getContentType() );
+ buf.append( ", " );
+ buf.append( "contentEncoding=" );
+ buf.append( getContentEncoding() );
+ buf.append( ", " );
+ buf.append( "userId=" );
+ buf.append( getUserId() );
+ buf.append( ", " );
+ buf.append( "appId=" );
+ buf.append( getAppId() );
+ buf.append( ", " );
+ buf.append( "transactionId=" );
+ buf.append( getTransactionId() );
+ buf.append( ", " );
+ buf.append( "securityToken=" );
+ buf.append( getSecurityToken() == null ? "null" : java.util.Arrays.toString( getSecurityToken() ) );
+ buf.append( ", " );
+ buf.append( "applicationHeaders=" );
+ buf.append( getApplicationHeaders() );
+ buf.append( ", " );
+ buf.append( "body=" );
+ buf.append( getBody() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodDispatcher_0_9.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodDispatcher_0_9.java
new file mode 100644
index 0000000000..00c81e1180
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodDispatcher_0_9.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.framing.*;
+
+public interface MethodDispatcher_0_9
+ extends MethodDispatcher,
+ ServerMethodDispatcher_0_9,
+ ClientMethodDispatcher_0_9
+{
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java
new file mode 100644
index 0000000000..f0e317fc1e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java
@@ -0,0 +1,1591 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.protocol.AMQConstant;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.codec.MarkableDataInput;
+
+
+public class MethodRegistry_0_9 extends MethodRegistry
+{
+
+ private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
+
+ private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_0_9();
+
+ private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[121][];
+
+ public MethodRegistry_0_9()
+ {
+ this(new ProtocolVersion((byte)0,(byte)9));
+ }
+
+ public MethodRegistry_0_9(ProtocolVersion pv)
+ {
+ super(pv);
+
+
+
+ // Register method body instance factories for the Connection class.
+
+ _factories[10] = new AMQMethodBodyInstanceFactory[52];
+
+ _factories[10][10] = ConnectionStartBodyImpl.getFactory();
+ _factories[10][11] = ConnectionStartOkBodyImpl.getFactory();
+ _factories[10][20] = ConnectionSecureBodyImpl.getFactory();
+ _factories[10][21] = ConnectionSecureOkBodyImpl.getFactory();
+ _factories[10][30] = ConnectionTuneBodyImpl.getFactory();
+ _factories[10][31] = ConnectionTuneOkBodyImpl.getFactory();
+ _factories[10][40] = ConnectionOpenBodyImpl.getFactory();
+ _factories[10][41] = ConnectionOpenOkBodyImpl.getFactory();
+ _factories[10][42] = ConnectionRedirectBodyImpl.getFactory();
+ _factories[10][50] = ConnectionCloseBodyImpl.getFactory();
+ _factories[10][51] = ConnectionCloseOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Channel class.
+
+ _factories[20] = new AMQMethodBodyInstanceFactory[81];
+
+ _factories[20][10] = ChannelOpenBodyImpl.getFactory();
+ _factories[20][11] = ChannelOpenOkBodyImpl.getFactory();
+ _factories[20][20] = ChannelFlowBodyImpl.getFactory();
+ _factories[20][21] = ChannelFlowOkBodyImpl.getFactory();
+ _factories[20][40] = ChannelCloseBodyImpl.getFactory();
+ _factories[20][41] = ChannelCloseOkBodyImpl.getFactory();
+ _factories[20][50] = ChannelResumeBodyImpl.getFactory();
+ _factories[20][60] = ChannelPingBodyImpl.getFactory();
+ _factories[20][70] = ChannelPongBodyImpl.getFactory();
+ _factories[20][80] = ChannelOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Access class.
+
+ _factories[30] = new AMQMethodBodyInstanceFactory[12];
+
+ _factories[30][10] = AccessRequestBodyImpl.getFactory();
+ _factories[30][11] = AccessRequestOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Exchange class.
+
+ _factories[40] = new AMQMethodBodyInstanceFactory[24];
+
+ _factories[40][10] = ExchangeDeclareBodyImpl.getFactory();
+ _factories[40][11] = ExchangeDeclareOkBodyImpl.getFactory();
+ _factories[40][20] = ExchangeDeleteBodyImpl.getFactory();
+ _factories[40][21] = ExchangeDeleteOkBodyImpl.getFactory();
+ _factories[40][22] = ExchangeBoundBodyImpl.getFactory();
+ _factories[40][23] = ExchangeBoundOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Queue class.
+
+ _factories[50] = new AMQMethodBodyInstanceFactory[52];
+
+ _factories[50][10] = QueueDeclareBodyImpl.getFactory();
+ _factories[50][11] = QueueDeclareOkBodyImpl.getFactory();
+ _factories[50][20] = QueueBindBodyImpl.getFactory();
+ _factories[50][21] = QueueBindOkBodyImpl.getFactory();
+ _factories[50][30] = QueuePurgeBodyImpl.getFactory();
+ _factories[50][31] = QueuePurgeOkBodyImpl.getFactory();
+ _factories[50][40] = QueueDeleteBodyImpl.getFactory();
+ _factories[50][41] = QueueDeleteOkBodyImpl.getFactory();
+ _factories[50][50] = QueueUnbindBodyImpl.getFactory();
+ _factories[50][51] = QueueUnbindOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Basic class.
+
+ _factories[60] = new AMQMethodBodyInstanceFactory[103];
+
+ _factories[60][10] = BasicQosBodyImpl.getFactory();
+ _factories[60][11] = BasicQosOkBodyImpl.getFactory();
+ _factories[60][20] = BasicConsumeBodyImpl.getFactory();
+ _factories[60][21] = BasicConsumeOkBodyImpl.getFactory();
+ _factories[60][30] = BasicCancelBodyImpl.getFactory();
+ _factories[60][31] = BasicCancelOkBodyImpl.getFactory();
+ _factories[60][40] = BasicPublishBodyImpl.getFactory();
+ _factories[60][50] = BasicReturnBodyImpl.getFactory();
+ _factories[60][60] = BasicDeliverBodyImpl.getFactory();
+ _factories[60][70] = BasicGetBodyImpl.getFactory();
+ _factories[60][71] = BasicGetOkBodyImpl.getFactory();
+ _factories[60][72] = BasicGetEmptyBodyImpl.getFactory();
+ _factories[60][80] = BasicAckBodyImpl.getFactory();
+ _factories[60][90] = BasicRejectBodyImpl.getFactory();
+ _factories[60][100] = BasicRecoverBodyImpl.getFactory();
+ _factories[60][101] = BasicRecoverSyncOkBodyImpl.getFactory();
+ _factories[60][102] = BasicRecoverSyncBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the File class.
+
+ _factories[70] = new AMQMethodBodyInstanceFactory[101];
+
+ _factories[70][10] = FileQosBodyImpl.getFactory();
+ _factories[70][11] = FileQosOkBodyImpl.getFactory();
+ _factories[70][20] = FileConsumeBodyImpl.getFactory();
+ _factories[70][21] = FileConsumeOkBodyImpl.getFactory();
+ _factories[70][30] = FileCancelBodyImpl.getFactory();
+ _factories[70][31] = FileCancelOkBodyImpl.getFactory();
+ _factories[70][40] = FileOpenBodyImpl.getFactory();
+ _factories[70][41] = FileOpenOkBodyImpl.getFactory();
+ _factories[70][50] = FileStageBodyImpl.getFactory();
+ _factories[70][60] = FilePublishBodyImpl.getFactory();
+ _factories[70][70] = FileReturnBodyImpl.getFactory();
+ _factories[70][80] = FileDeliverBodyImpl.getFactory();
+ _factories[70][90] = FileAckBodyImpl.getFactory();
+ _factories[70][100] = FileRejectBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Stream class.
+
+ _factories[80] = new AMQMethodBodyInstanceFactory[61];
+
+ _factories[80][10] = StreamQosBodyImpl.getFactory();
+ _factories[80][11] = StreamQosOkBodyImpl.getFactory();
+ _factories[80][20] = StreamConsumeBodyImpl.getFactory();
+ _factories[80][21] = StreamConsumeOkBodyImpl.getFactory();
+ _factories[80][30] = StreamCancelBodyImpl.getFactory();
+ _factories[80][31] = StreamCancelOkBodyImpl.getFactory();
+ _factories[80][40] = StreamPublishBodyImpl.getFactory();
+ _factories[80][50] = StreamReturnBodyImpl.getFactory();
+ _factories[80][60] = StreamDeliverBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Tx class.
+
+ _factories[90] = new AMQMethodBodyInstanceFactory[32];
+
+ _factories[90][10] = TxSelectBodyImpl.getFactory();
+ _factories[90][11] = TxSelectOkBodyImpl.getFactory();
+ _factories[90][20] = TxCommitBodyImpl.getFactory();
+ _factories[90][21] = TxCommitOkBodyImpl.getFactory();
+ _factories[90][30] = TxRollbackBodyImpl.getFactory();
+ _factories[90][31] = TxRollbackOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Dtx class.
+
+ _factories[100] = new AMQMethodBodyInstanceFactory[22];
+
+ _factories[100][10] = DtxSelectBodyImpl.getFactory();
+ _factories[100][11] = DtxSelectOkBodyImpl.getFactory();
+ _factories[100][20] = DtxStartBodyImpl.getFactory();
+ _factories[100][21] = DtxStartOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Tunnel class.
+
+ _factories[110] = new AMQMethodBodyInstanceFactory[11];
+
+ _factories[110][10] = TunnelRequestBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Message class.
+
+ _factories[120] = new AMQMethodBodyInstanceFactory[531];
+
+ _factories[120][10] = MessageTransferBodyImpl.getFactory();
+ _factories[120][20] = MessageConsumeBodyImpl.getFactory();
+ _factories[120][30] = MessageCancelBodyImpl.getFactory();
+ _factories[120][40] = MessageGetBodyImpl.getFactory();
+ _factories[120][50] = MessageRecoverBodyImpl.getFactory();
+ _factories[120][60] = MessageOpenBodyImpl.getFactory();
+ _factories[120][70] = MessageCloseBodyImpl.getFactory();
+ _factories[120][80] = MessageAppendBodyImpl.getFactory();
+ _factories[120][90] = MessageCheckpointBodyImpl.getFactory();
+ _factories[120][100] = MessageResumeBodyImpl.getFactory();
+ _factories[120][110] = MessageQosBodyImpl.getFactory();
+ _factories[120][500] = MessageOkBodyImpl.getFactory();
+ _factories[120][510] = MessageEmptyBodyImpl.getFactory();
+ _factories[120][520] = MessageRejectBodyImpl.getFactory();
+ _factories[120][530] = MessageOffsetBodyImpl.getFactory();
+ }
+
+ public AMQMethodBody convertToBody(MarkableDataInput in, long size)
+ throws AMQFrameDecodingException, IOException
+ {
+ int classId = in.readUnsignedShort();
+ int methodId = in.readUnsignedShort();
+
+ AMQMethodBodyInstanceFactory bodyFactory;
+ try
+ {
+ bodyFactory = _factories[classId][methodId];
+ }
+ catch(NullPointerException e)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 0-9"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+ catch(IndexOutOfBoundsException e)
+ {
+ if(classId >= _factories.length)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 0-9"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ else
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 0-9"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ }
+
+ if (bodyFactory == null)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 0-9"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+
+ return bodyFactory.newInstance(in, size);
+ }
+
+ public int getMaxClassId()
+ {
+ return 120;
+ }
+
+ public int getMaxMethodId(int classId)
+ {
+ return _factories[classId].length - 1;
+ }
+
+
+
+ public ConnectionStartBody createConnectionStartBody(
+ final short versionMajor,
+ final short versionMinor,
+ final FieldTable serverProperties,
+ final byte[] mechanisms,
+ final byte[] locales
+ )
+ {
+ return new ConnectionStartBodyImpl(
+ versionMajor,
+ versionMinor,
+ serverProperties,
+ mechanisms,
+ locales
+ );
+ }
+
+ public ConnectionStartOkBody createConnectionStartOkBody(
+ final FieldTable clientProperties,
+ final AMQShortString mechanism,
+ final byte[] response,
+ final AMQShortString locale
+ )
+ {
+ return new ConnectionStartOkBodyImpl(
+ clientProperties,
+ mechanism,
+ response,
+ locale
+ );
+ }
+
+ public ConnectionSecureBody createConnectionSecureBody(
+ final byte[] challenge
+ )
+ {
+ return new ConnectionSecureBodyImpl(
+ challenge
+ );
+ }
+
+ public ConnectionSecureOkBody createConnectionSecureOkBody(
+ final byte[] response
+ )
+ {
+ return new ConnectionSecureOkBodyImpl(
+ response
+ );
+ }
+
+ public ConnectionTuneBody createConnectionTuneBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionTuneOkBody createConnectionTuneOkBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneOkBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionOpenBody createConnectionOpenBody(
+ final AMQShortString virtualHost,
+ final AMQShortString capabilities,
+ final boolean insist
+ )
+ {
+ return new ConnectionOpenBodyImpl(
+ virtualHost,
+ capabilities,
+ insist
+ );
+ }
+
+ public ConnectionOpenOkBody createConnectionOpenOkBody(
+ final AMQShortString knownHosts
+ )
+ {
+ return new ConnectionOpenOkBodyImpl(
+ knownHosts
+ );
+ }
+
+ public ConnectionRedirectBody createConnectionRedirectBody(
+ final AMQShortString host,
+ final AMQShortString knownHosts
+ )
+ {
+ return new ConnectionRedirectBodyImpl(
+ host,
+ knownHosts
+ );
+ }
+
+ public ConnectionCloseBody createConnectionCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ConnectionCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ConnectionCloseOkBody createConnectionCloseOkBody(
+ )
+ {
+ return new ConnectionCloseOkBodyImpl(
+ );
+ }
+
+
+
+
+ public ChannelOpenBody createChannelOpenBody(
+ final AMQShortString outOfBand
+ )
+ {
+ return new ChannelOpenBodyImpl(
+ outOfBand
+ );
+ }
+
+ public ChannelOpenOkBody createChannelOpenOkBody(
+ final byte[] channelId
+ )
+ {
+ return new ChannelOpenOkBodyImpl(
+ channelId
+ );
+ }
+
+ public ChannelFlowBody createChannelFlowBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowBodyImpl(
+ active
+ );
+ }
+
+ public ChannelFlowOkBody createChannelFlowOkBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowOkBodyImpl(
+ active
+ );
+ }
+
+ public ChannelCloseBody createChannelCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ChannelCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ChannelCloseOkBody createChannelCloseOkBody(
+ )
+ {
+ return new ChannelCloseOkBodyImpl(
+ );
+ }
+
+ public ChannelResumeBody createChannelResumeBody(
+ final byte[] channelId
+ )
+ {
+ return new ChannelResumeBodyImpl(
+ channelId
+ );
+ }
+
+ public ChannelPingBody createChannelPingBody(
+ )
+ {
+ return new ChannelPingBodyImpl(
+ );
+ }
+
+ public ChannelPongBody createChannelPongBody(
+ )
+ {
+ return new ChannelPongBodyImpl(
+ );
+ }
+
+ public ChannelOkBody createChannelOkBody(
+ )
+ {
+ return new ChannelOkBodyImpl(
+ );
+ }
+
+
+
+
+ public AccessRequestBody createAccessRequestBody(
+ final AMQShortString realm,
+ final boolean exclusive,
+ final boolean passive,
+ final boolean active,
+ final boolean write,
+ final boolean read
+ )
+ {
+ return new AccessRequestBodyImpl(
+ realm,
+ exclusive,
+ passive,
+ active,
+ write,
+ read
+ );
+ }
+
+ public AccessRequestOkBody createAccessRequestOkBody(
+ final int ticket
+ )
+ {
+ return new AccessRequestOkBodyImpl(
+ ticket
+ );
+ }
+
+
+
+
+ public ExchangeDeclareBody createExchangeDeclareBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString type,
+ final boolean passive,
+ final boolean durable,
+ final boolean autoDelete,
+ final boolean internal,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new ExchangeDeclareBodyImpl(
+ ticket,
+ exchange,
+ type,
+ passive,
+ durable,
+ autoDelete,
+ internal,
+ nowait,
+ arguments
+ );
+ }
+
+ public ExchangeDeclareOkBody createExchangeDeclareOkBody(
+ )
+ {
+ return new ExchangeDeclareOkBodyImpl(
+ );
+ }
+
+ public ExchangeDeleteBody createExchangeDeleteBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final boolean ifUnused,
+ final boolean nowait
+ )
+ {
+ return new ExchangeDeleteBodyImpl(
+ ticket,
+ exchange,
+ ifUnused,
+ nowait
+ );
+ }
+
+ public ExchangeDeleteOkBody createExchangeDeleteOkBody(
+ )
+ {
+ return new ExchangeDeleteOkBodyImpl(
+ );
+ }
+
+ public ExchangeBoundBody createExchangeBoundBody(
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString queue
+ )
+ {
+ return new ExchangeBoundBodyImpl(
+ exchange,
+ routingKey,
+ queue
+ );
+ }
+
+ public ExchangeBoundOkBody createExchangeBoundOkBody(
+ final int replyCode,
+ final AMQShortString replyText
+ )
+ {
+ return new ExchangeBoundOkBodyImpl(
+ replyCode,
+ replyText
+ );
+ }
+
+
+
+
+ public QueueDeclareBody createQueueDeclareBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean passive,
+ final boolean durable,
+ final boolean exclusive,
+ final boolean autoDelete,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueDeclareBodyImpl(
+ ticket,
+ queue,
+ passive,
+ durable,
+ exclusive,
+ autoDelete,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueDeclareOkBody createQueueDeclareOkBody(
+ final AMQShortString queue,
+ final long messageCount,
+ final long consumerCount
+ )
+ {
+ return new QueueDeclareOkBodyImpl(
+ queue,
+ messageCount,
+ consumerCount
+ );
+ }
+
+ public QueueBindBody createQueueBindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueBindBodyImpl(
+ ticket,
+ queue,
+ exchange,
+ routingKey,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueBindOkBody createQueueBindOkBody(
+ )
+ {
+ return new QueueBindOkBodyImpl(
+ );
+ }
+
+ public QueuePurgeBody createQueuePurgeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean nowait
+ )
+ {
+ return new QueuePurgeBodyImpl(
+ ticket,
+ queue,
+ nowait
+ );
+ }
+
+ public QueuePurgeOkBody createQueuePurgeOkBody(
+ final long messageCount
+ )
+ {
+ return new QueuePurgeOkBodyImpl(
+ messageCount
+ );
+ }
+
+ public QueueDeleteBody createQueueDeleteBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean ifUnused,
+ final boolean ifEmpty,
+ final boolean nowait
+ )
+ {
+ return new QueueDeleteBodyImpl(
+ ticket,
+ queue,
+ ifUnused,
+ ifEmpty,
+ nowait
+ );
+ }
+
+ public QueueDeleteOkBody createQueueDeleteOkBody(
+ final long messageCount
+ )
+ {
+ return new QueueDeleteOkBodyImpl(
+ messageCount
+ );
+ }
+
+ public QueueUnbindBody createQueueUnbindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final FieldTable arguments
+ )
+ {
+ return new QueueUnbindBodyImpl(
+ ticket,
+ queue,
+ exchange,
+ routingKey,
+ arguments
+ );
+ }
+
+ public QueueUnbindOkBody createQueueUnbindOkBody(
+ )
+ {
+ return new QueueUnbindOkBodyImpl(
+ );
+ }
+
+
+
+
+ public BasicQosBody createBasicQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new BasicQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public BasicQosOkBody createBasicQosOkBody(
+ )
+ {
+ return new BasicQosOkBodyImpl(
+ );
+ }
+
+ public BasicConsumeBody createBasicConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new BasicConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ noAck,
+ exclusive,
+ nowait,
+ arguments
+ );
+ }
+
+ public BasicConsumeOkBody createBasicConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicCancelBody createBasicCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new BasicCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public BasicCancelOkBody createBasicCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicPublishBody createBasicPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ )
+ {
+ return new BasicPublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate
+ );
+ }
+
+ public BasicReturnBody createBasicReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicDeliverBody createBasicDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicGetBody createBasicGetBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean noAck
+ )
+ {
+ return new BasicGetBodyImpl(
+ ticket,
+ queue,
+ noAck
+ );
+ }
+
+ public BasicGetOkBody createBasicGetOkBody(
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final long messageCount
+ )
+ {
+ return new BasicGetOkBodyImpl(
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey,
+ messageCount
+ );
+ }
+
+ public BasicGetEmptyBody createBasicGetEmptyBody(
+ final AMQShortString clusterId
+ )
+ {
+ return new BasicGetEmptyBodyImpl(
+ clusterId
+ );
+ }
+
+ public BasicAckBody createBasicAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ )
+ {
+ return new BasicAckBodyImpl(
+ deliveryTag,
+ multiple
+ );
+ }
+
+ public BasicRejectBody createBasicRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ )
+ {
+ return new BasicRejectBodyImpl(
+ deliveryTag,
+ requeue
+ );
+ }
+
+ public BasicRecoverBody createBasicRecoverBody(
+ final boolean requeue
+ )
+ {
+ return new BasicRecoverBodyImpl(
+ requeue
+ );
+ }
+
+ public BasicRecoverSyncOkBody createBasicRecoverSyncOkBody(
+ )
+ {
+ return new BasicRecoverSyncOkBodyImpl(
+ );
+ }
+
+ public BasicRecoverSyncBody createBasicRecoverSyncBody(
+ final boolean requeue
+ )
+ {
+ return new BasicRecoverSyncBodyImpl(
+ requeue
+ );
+ }
+
+
+
+
+ public FileQosBody createFileQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new FileQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public FileQosOkBody createFileQosOkBody(
+ )
+ {
+ return new FileQosOkBodyImpl(
+ );
+ }
+
+ public FileConsumeBody createFileConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable filter
+ )
+ {
+ return new FileConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ noAck,
+ exclusive,
+ nowait,
+ filter
+ );
+ }
+
+ public FileConsumeOkBody createFileConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new FileConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public FileCancelBody createFileCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new FileCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public FileCancelOkBody createFileCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new FileCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public FileOpenBody createFileOpenBody(
+ final AMQShortString identifier,
+ final long contentSize
+ )
+ {
+ return new FileOpenBodyImpl(
+ identifier,
+ contentSize
+ );
+ }
+
+ public FileOpenOkBody createFileOpenOkBody(
+ final long stagedSize
+ )
+ {
+ return new FileOpenOkBodyImpl(
+ stagedSize
+ );
+ }
+
+ public FileStageBody createFileStageBody(
+ )
+ {
+ return new FileStageBodyImpl(
+ );
+ }
+
+ public FilePublishBody createFilePublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate,
+ final AMQShortString identifier
+ )
+ {
+ return new FilePublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate,
+ identifier
+ );
+ }
+
+ public FileReturnBody createFileReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new FileReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public FileDeliverBody createFileDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString identifier
+ )
+ {
+ return new FileDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey,
+ identifier
+ );
+ }
+
+ public FileAckBody createFileAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ )
+ {
+ return new FileAckBodyImpl(
+ deliveryTag,
+ multiple
+ );
+ }
+
+ public FileRejectBody createFileRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ )
+ {
+ return new FileRejectBodyImpl(
+ deliveryTag,
+ requeue
+ );
+ }
+
+
+
+
+ public StreamQosBody createStreamQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final long consumeRate,
+ final boolean global
+ )
+ {
+ return new StreamQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ consumeRate,
+ global
+ );
+ }
+
+ public StreamQosOkBody createStreamQosOkBody(
+ )
+ {
+ return new StreamQosOkBodyImpl(
+ );
+ }
+
+ public StreamConsumeBody createStreamConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable filter
+ )
+ {
+ return new StreamConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ exclusive,
+ nowait,
+ filter
+ );
+ }
+
+ public StreamConsumeOkBody createStreamConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new StreamConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public StreamCancelBody createStreamCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new StreamCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public StreamCancelOkBody createStreamCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new StreamCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public StreamPublishBody createStreamPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ )
+ {
+ return new StreamPublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate
+ );
+ }
+
+ public StreamReturnBody createStreamReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new StreamReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public StreamDeliverBody createStreamDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final AMQShortString exchange,
+ final AMQShortString queue
+ )
+ {
+ return new StreamDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ exchange,
+ queue
+ );
+ }
+
+
+
+
+ public TxSelectBody createTxSelectBody(
+ )
+ {
+ return new TxSelectBodyImpl(
+ );
+ }
+
+ public TxSelectOkBody createTxSelectOkBody(
+ )
+ {
+ return new TxSelectOkBodyImpl(
+ );
+ }
+
+ public TxCommitBody createTxCommitBody(
+ )
+ {
+ return new TxCommitBodyImpl(
+ );
+ }
+
+ public TxCommitOkBody createTxCommitOkBody(
+ )
+ {
+ return new TxCommitOkBodyImpl(
+ );
+ }
+
+ public TxRollbackBody createTxRollbackBody(
+ )
+ {
+ return new TxRollbackBodyImpl(
+ );
+ }
+
+ public TxRollbackOkBody createTxRollbackOkBody(
+ )
+ {
+ return new TxRollbackOkBodyImpl(
+ );
+ }
+
+
+
+
+ public DtxSelectBody createDtxSelectBody(
+ )
+ {
+ return new DtxSelectBodyImpl(
+ );
+ }
+
+ public DtxSelectOkBody createDtxSelectOkBody(
+ )
+ {
+ return new DtxSelectOkBodyImpl(
+ );
+ }
+
+ public DtxStartBody createDtxStartBody(
+ final AMQShortString dtxIdentifier
+ )
+ {
+ return new DtxStartBodyImpl(
+ dtxIdentifier
+ );
+ }
+
+ public DtxStartOkBody createDtxStartOkBody(
+ )
+ {
+ return new DtxStartOkBodyImpl(
+ );
+ }
+
+
+
+
+ public TunnelRequestBody createTunnelRequestBody(
+ final FieldTable metaData
+ )
+ {
+ return new TunnelRequestBodyImpl(
+ metaData
+ );
+ }
+
+
+
+
+ public MessageTransferBody createMessageTransferBody(
+ final int ticket,
+ final AMQShortString destination,
+ final boolean redelivered,
+ final boolean immediate,
+ final long ttl,
+ final short priority,
+ final long timestamp,
+ final short deliveryMode,
+ final long expiration,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString messageId,
+ final AMQShortString correlationId,
+ final AMQShortString replyTo,
+ final AMQShortString contentType,
+ final AMQShortString contentEncoding,
+ final AMQShortString userId,
+ final AMQShortString appId,
+ final AMQShortString transactionId,
+ final byte[] securityToken,
+ final FieldTable applicationHeaders,
+ final Content body
+ )
+ {
+ return new MessageTransferBodyImpl(
+ ticket,
+ destination,
+ redelivered,
+ immediate,
+ ttl,
+ priority,
+ timestamp,
+ deliveryMode,
+ expiration,
+ exchange,
+ routingKey,
+ messageId,
+ correlationId,
+ replyTo,
+ contentType,
+ contentEncoding,
+ userId,
+ appId,
+ transactionId,
+ securityToken,
+ applicationHeaders,
+ body
+ );
+ }
+
+ public MessageConsumeBody createMessageConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString destination,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final FieldTable filter
+ )
+ {
+ return new MessageConsumeBodyImpl(
+ ticket,
+ queue,
+ destination,
+ noLocal,
+ noAck,
+ exclusive,
+ filter
+ );
+ }
+
+ public MessageCancelBody createMessageCancelBody(
+ final AMQShortString destination
+ )
+ {
+ return new MessageCancelBodyImpl(
+ destination
+ );
+ }
+
+ public MessageGetBody createMessageGetBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString destination,
+ final boolean noAck
+ )
+ {
+ return new MessageGetBodyImpl(
+ ticket,
+ queue,
+ destination,
+ noAck
+ );
+ }
+
+ public MessageRecoverBody createMessageRecoverBody(
+ final boolean requeue
+ )
+ {
+ return new MessageRecoverBodyImpl(
+ requeue
+ );
+ }
+
+ public MessageOpenBody createMessageOpenBody(
+ final byte[] reference
+ )
+ {
+ return new MessageOpenBodyImpl(
+ reference
+ );
+ }
+
+ public MessageCloseBody createMessageCloseBody(
+ final byte[] reference
+ )
+ {
+ return new MessageCloseBodyImpl(
+ reference
+ );
+ }
+
+ public MessageAppendBody createMessageAppendBody(
+ final byte[] reference,
+ final byte[] bytes
+ )
+ {
+ return new MessageAppendBodyImpl(
+ reference,
+ bytes
+ );
+ }
+
+ public MessageCheckpointBody createMessageCheckpointBody(
+ final byte[] reference,
+ final AMQShortString identifier
+ )
+ {
+ return new MessageCheckpointBodyImpl(
+ reference,
+ identifier
+ );
+ }
+
+ public MessageResumeBody createMessageResumeBody(
+ final byte[] reference,
+ final AMQShortString identifier
+ )
+ {
+ return new MessageResumeBodyImpl(
+ reference,
+ identifier
+ );
+ }
+
+ public MessageQosBody createMessageQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new MessageQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public MessageOkBody createMessageOkBody(
+ )
+ {
+ return new MessageOkBodyImpl(
+ );
+ }
+
+ public MessageEmptyBody createMessageEmptyBody(
+ )
+ {
+ return new MessageEmptyBodyImpl(
+ );
+ }
+
+ public MessageRejectBody createMessageRejectBody(
+ final int code,
+ final AMQShortString text
+ )
+ {
+ return new MessageRejectBodyImpl(
+ code,
+ text
+ );
+ }
+
+ public MessageOffsetBody createMessageOffsetBody(
+ final long value
+ )
+ {
+ return new MessageOffsetBodyImpl(
+ value
+ );
+ }
+
+
+
+ public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
+ {
+ return _protocolVersionConverter;
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindBodyImpl.java
new file mode 100644
index 0000000000..989a6d4877
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindBodyImpl extends AMQMethodBody_0_9 implements QueueBindBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueBindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueBindBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueBind(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindOkBodyImpl.java
new file mode 100644
index 0000000000..1469912b2b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueBindOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindOkBodyImpl extends AMQMethodBody_0_9 implements QueueBindOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public QueueBindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public QueueBindOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueBindOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareBodyImpl.java
new file mode 100644
index 0000000000..7b2926f32f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareBodyImpl extends AMQMethodBody_0_9 implements QueueDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [passive, durable, exclusive, autoDelete, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueDeclareBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean passive,
+ boolean durable,
+ boolean exclusive,
+ boolean autoDelete,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..1c76725d2b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeclareOkBodyImpl.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareOkBodyImpl extends AMQMethodBody_0_9 implements QueueDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final AMQShortString _queue; // [queue]
+ private final long _messageCount; // [messageCount]
+ private final long _consumerCount; // [consumerCount]
+
+ // Constructor
+ public QueueDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _queue = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ _consumerCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeclareOkBodyImpl(
+ AMQShortString queue,
+ long messageCount,
+ long consumerCount
+ )
+ {
+ _queue = queue;
+ _messageCount = messageCount;
+ _consumerCount = consumerCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+ public final long getConsumerCount()
+ {
+ return _consumerCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _queue );
+ writeUnsignedInteger( buffer, _messageCount );
+ writeUnsignedInteger( buffer, _consumerCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareOkBodyImpl: ");
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append( ", " );
+ buf.append( "consumerCount=" );
+ buf.append( getConsumerCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteBodyImpl.java
new file mode 100644
index 0000000000..ea48a1d24a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteBodyImpl extends AMQMethodBody_0_9 implements QueueDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [ifUnused, ifEmpty, nowait]
+
+ // Constructor
+ public QueueDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueueDeleteBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean ifUnused,
+ boolean ifEmpty,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( ifEmpty )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getIfEmpty()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "ifEmpty=" );
+ buf.append( getIfEmpty() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..acc7a59887
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueDeleteOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteOkBodyImpl extends AMQMethodBody_0_9 implements QueueDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueueDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeleteOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeBodyImpl.java
new file mode 100644
index 0000000000..8a1a4e206c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeBodyImpl extends AMQMethodBody_0_9 implements QueuePurgeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public QueuePurgeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueuePurgeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueuePurge(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeOkBodyImpl.java
new file mode 100644
index 0000000000..db50a822f6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueuePurgeOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeOkBodyImpl extends AMQMethodBody_0_9 implements QueuePurgeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueuePurgeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueuePurgeOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueuePurgeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java
new file mode 100644
index 0000000000..fd5bb7b953
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueUnbindBodyImpl extends AMQMethodBody_0_9 implements QueueUnbindBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueUnbindBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueUnbindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueUnbindBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueUnbind(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueUnbindBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java
new file mode 100644
index 0000000000..03544b17d6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueUnbindOkBodyImpl extends AMQMethodBody_0_9 implements QueueUnbindOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueUnbindOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 51;
+
+ // Fields declared in specification
+
+ // Constructor
+ public QueueUnbindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public QueueUnbindOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchQueueUnbindOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueUnbindOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ServerMethodDispatcher_0_9.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ServerMethodDispatcher_0_9.java
new file mode 100644
index 0000000000..4100e7a031
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ServerMethodDispatcher_0_9.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface ServerMethodDispatcher_0_9 extends ServerMethodDispatcher
+{
+
+ public boolean dispatchAccessRequest(AccessRequestBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecoverSync(BasicRecoverSyncBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOk(ChannelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelPing(ChannelPingBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelPong(ChannelPongBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelResume(ChannelResumeBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxSelect(DtxSelectBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxStart(DtxStartBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchFileAck(FileAckBody body, int channelId) throws AMQException;
+ public boolean dispatchFileCancel(FileCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchFileConsume(FileConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFilePublish(FilePublishBody body, int channelId) throws AMQException;
+ public boolean dispatchFileQos(FileQosBody body, int channelId) throws AMQException;
+ public boolean dispatchFileReject(FileRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageAppend(MessageAppendBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageCancel(MessageCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageCheckpoint(MessageCheckpointBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageClose(MessageCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageConsume(MessageConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageEmpty(MessageEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageGet(MessageGetBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOffset(MessageOffsetBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOk(MessageOkBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageOpen(MessageOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageQos(MessageQosBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageRecover(MessageRecoverBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageReject(MessageRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageResume(MessageResumeBody body, int channelId) throws AMQException;
+ public boolean dispatchMessageTransfer(MessageTransferBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueUnbind(QueueUnbindBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamCancel(StreamCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamConsume(StreamConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamPublish(StreamPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamQos(StreamQosBody body, int channelId) throws AMQException;
+ public boolean dispatchTunnelRequest(TunnelRequestBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelBodyImpl.java
new file mode 100644
index 0000000000..81ec1102f5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamCancelBodyImpl extends AMQMethodBody_0_9 implements StreamCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public StreamCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelOkBodyImpl.java
new file mode 100644
index 0000000000..ec9676d782
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamCancelOkBodyImpl extends AMQMethodBody_0_9 implements StreamCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public StreamCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public StreamCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeBodyImpl.java
new file mode 100644
index 0000000000..ff4712d091
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeBodyImpl.java
@@ -0,0 +1,194 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamConsumeBodyImpl extends AMQMethodBody_0_9 implements StreamConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, exclusive, nowait]
+ private final FieldTable _filter; // [filter]
+
+ // Constructor
+ public StreamConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _filter = readFieldTable( buffer );
+ }
+
+ public StreamConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean exclusive,
+ boolean nowait,
+ FieldTable filter
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ _bitfield0 = bitfield0;
+ _filter = filter;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final FieldTable getFilter()
+ {
+ return _filter;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _filter );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _filter );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "filter=" );
+ buf.append( getFilter() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..cca83758e4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamConsumeOkBodyImpl extends AMQMethodBody_0_9 implements StreamConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public StreamConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public StreamConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamDeliverBodyImpl.java
new file mode 100644
index 0000000000..87e341ee5c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamDeliverBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamDeliverBodyImpl extends AMQMethodBody_0_9 implements StreamDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _queue; // [queue]
+
+ // Constructor
+ public StreamDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _exchange = readAMQShortString( buffer );
+ _queue = readAMQShortString( buffer );
+ }
+
+ public StreamDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ AMQShortString exchange,
+ AMQShortString queue
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ _exchange = exchange;
+ _queue = queue;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _queue );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamPublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamPublishBodyImpl.java
new file mode 100644
index 0000000000..59161fe291
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamPublishBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamPublishBodyImpl extends AMQMethodBody_0_9 implements StreamPublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamPublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+
+ // Constructor
+ public StreamPublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamPublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamPublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamPublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosBodyImpl.java
new file mode 100644
index 0000000000..b9413d3ef2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosBodyImpl.java
@@ -0,0 +1,152 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamQosBodyImpl extends AMQMethodBody_0_9 implements StreamQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final long _consumeRate; // [consumeRate]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public StreamQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _consumeRate = readUnsignedInteger( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ long consumeRate,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ _consumeRate = consumeRate;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final long getConsumeRate()
+ {
+ return _consumeRate;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 11;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeUnsignedInteger( buffer, _consumeRate );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "consumeRate=" );
+ buf.append( getConsumeRate() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosOkBodyImpl.java
new file mode 100644
index 0000000000..a5119c7f6d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamQosOkBodyImpl extends AMQMethodBody_0_9 implements StreamQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public StreamQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public StreamQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamReturnBodyImpl.java
new file mode 100644
index 0000000000..bb60ea982e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/StreamReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamReturnBodyImpl extends AMQMethodBody_0_9 implements StreamReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public StreamReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public StreamReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchStreamReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TunnelRequestBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TunnelRequestBodyImpl.java
new file mode 100644
index 0000000000..fae6e1c3b9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TunnelRequestBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TunnelRequestBodyImpl extends AMQMethodBody_0_9 implements TunnelRequestBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TunnelRequestBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 110;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final FieldTable _metaData; // [metaData]
+
+ // Constructor
+ public TunnelRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _metaData = readFieldTable( buffer );
+ }
+
+ public TunnelRequestBodyImpl(
+ FieldTable metaData
+ )
+ {
+ _metaData = metaData;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getMetaData()
+ {
+ return _metaData;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _metaData );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _metaData );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTunnelRequest(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TunnelRequestBodyImpl: ");
+ buf.append( "metaData=" );
+ buf.append( getMetaData() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitBodyImpl.java
new file mode 100644
index 0000000000..9663cc86f5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitBodyImpl extends AMQMethodBody_0_9 implements TxCommitBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxCommit(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitOkBodyImpl.java
new file mode 100644
index 0000000000..fa009903b9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxCommitOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitOkBodyImpl extends AMQMethodBody_0_9 implements TxCommitOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxCommitOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackBodyImpl.java
new file mode 100644
index 0000000000..c143c34081
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackBodyImpl extends AMQMethodBody_0_9 implements TxRollbackBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxRollback(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackOkBodyImpl.java
new file mode 100644
index 0000000000..a5238b8804
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxRollbackOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackOkBodyImpl extends AMQMethodBody_0_9 implements TxRollbackOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxRollbackOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectBodyImpl.java
new file mode 100644
index 0000000000..9a43987fa2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectBodyImpl extends AMQMethodBody_0_9 implements TxSelectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxSelect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectOkBodyImpl.java
new file mode 100644
index 0000000000..c06bf4c501
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/TxSelectOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-9
+ */
+
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectOkBodyImpl extends AMQMethodBody_0_9 implements TxSelectOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_9)dispatcher).dispatchTxSelectOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicAckBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicAckBodyImpl.java
new file mode 100644
index 0000000000..059ae8fab8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicAckBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicAckBodyImpl extends AMQMethodBody_0_91 implements BasicAckBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicAckBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [multiple]
+
+ // Constructor
+ public BasicAckBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicAckBodyImpl(
+ long deliveryTag,
+ boolean multiple
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( multiple )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getMultiple()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicAck(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicAckBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "multiple=" );
+ buf.append( getMultiple() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelBodyImpl.java
new file mode 100644
index 0000000000..08a07960ac
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelBodyImpl extends AMQMethodBody_0_91 implements BasicCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public BasicCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelOkBodyImpl.java
new file mode 100644
index 0000000000..380fa70a18
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelOkBodyImpl extends AMQMethodBody_0_91 implements BasicCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeBodyImpl.java
new file mode 100644
index 0000000000..b299c5c0d4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeBodyImpl extends AMQMethodBody_0_91 implements BasicConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public BasicConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public BasicConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..2241370c75
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeOkBodyImpl extends AMQMethodBody_0_91 implements BasicConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicDeliverBodyImpl.java
new file mode 100644
index 0000000000..a1a9bf6113
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicDeliverBodyImpl.java
@@ -0,0 +1,168 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicDeliverBodyImpl extends AMQMethodBody_0_91 implements BasicDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetBodyImpl.java
new file mode 100644
index 0000000000..2f9ca99673
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetBodyImpl extends AMQMethodBody_0_91 implements BasicGetBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [noAck]
+
+ // Constructor
+ public BasicGetBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicGetBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean noAck
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicGet(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetEmptyBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetEmptyBodyImpl.java
new file mode 100644
index 0000000000..2f40867d71
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetEmptyBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetEmptyBodyImpl extends AMQMethodBody_0_91 implements BasicGetEmptyBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetEmptyBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 72;
+
+ // Fields declared in specification
+ private final AMQShortString _clusterId; // [clusterId]
+
+ // Constructor
+ public BasicGetEmptyBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clusterId = readAMQShortString( buffer );
+ }
+
+ public BasicGetEmptyBodyImpl(
+ AMQShortString clusterId
+ )
+ {
+ _clusterId = clusterId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getClusterId()
+ {
+ return _clusterId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clusterId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _clusterId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicGetEmpty(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetEmptyBodyImpl: ");
+ buf.append( "clusterId=" );
+ buf.append( getClusterId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetOkBodyImpl.java
new file mode 100644
index 0000000000..9666f447f1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicGetOkBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetOkBodyImpl extends AMQMethodBody_0_91 implements BasicGetOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 71;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public BasicGetOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public BasicGetOkBodyImpl(
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ long messageCount
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 13;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicGetOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetOkBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicPublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicPublishBodyImpl.java
new file mode 100644
index 0000000000..b347420128
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicPublishBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicPublishBodyImpl extends AMQMethodBody_0_91 implements BasicPublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicPublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+
+ // Constructor
+ public BasicPublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicPublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicPublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicPublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosBodyImpl.java
new file mode 100644
index 0000000000..00372b9c49
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosBodyImpl extends AMQMethodBody_0_91 implements BasicQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public BasicQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosOkBodyImpl.java
new file mode 100644
index 0000000000..a36b2e6d66
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosOkBodyImpl extends AMQMethodBody_0_91 implements BasicQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverBodyImpl.java
new file mode 100644
index 0000000000..e21c382a24
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverBodyImpl extends AMQMethodBody_0_91 implements BasicRecoverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRecoverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRecoverBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecover(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java
new file mode 100644
index 0000000000..c0679cf939
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverSyncBodyImpl extends AMQMethodBody_0_91 implements BasicRecoverSyncBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverSyncBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 110;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRecoverSyncBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRecoverSyncBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecoverSync(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverSyncBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java
new file mode 100644
index 0000000000..a75d344831
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverSyncOkBodyImpl extends AMQMethodBody_0_91 implements BasicRecoverSyncOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverSyncOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 111;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicRecoverSyncOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicRecoverSyncOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecoverSyncOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverSyncOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRejectBodyImpl.java
new file mode 100644
index 0000000000..b5b549d4a9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRejectBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRejectBodyImpl extends AMQMethodBody_0_91 implements BasicRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRejectBodyImpl(
+ long deliveryTag,
+ boolean requeue
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRejectBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicReturnBodyImpl.java
new file mode 100644
index 0000000000..26ba2f8b95
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicReturnBodyImpl extends AMQMethodBody_0_91 implements BasicReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchBasicReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseBodyImpl.java
new file mode 100644
index 0000000000..77f0dc2c9a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseBodyImpl extends AMQMethodBody_0_91 implements ChannelCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ChannelCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ChannelCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseOkBodyImpl.java
new file mode 100644
index 0000000000..91dd7b998a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseOkBodyImpl extends AMQMethodBody_0_91 implements ChannelCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowBodyImpl.java
new file mode 100644
index 0000000000..ce22049d31
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowBodyImpl extends AMQMethodBody_0_91 implements ChannelFlowBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelFlow(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowOkBodyImpl.java
new file mode 100644
index 0000000000..427acd045c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelFlowOkBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowOkBodyImpl extends AMQMethodBody_0_91 implements ChannelFlowOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowOkBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelFlowOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowOkBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenBodyImpl.java
new file mode 100644
index 0000000000..e204006fb3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenBodyImpl extends AMQMethodBody_0_91 implements ChannelOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final AMQShortString _outOfBand; // [outOfBand]
+
+ // Constructor
+ public ChannelOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _outOfBand = readAMQShortString( buffer );
+ }
+
+ public ChannelOpenBodyImpl(
+ AMQShortString outOfBand
+ )
+ {
+ _outOfBand = outOfBand;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getOutOfBand()
+ {
+ return _outOfBand;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _outOfBand );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _outOfBand );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenBodyImpl: ");
+ buf.append( "outOfBand=" );
+ buf.append( getOutOfBand() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java
new file mode 100644
index 0000000000..d891cb3374
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenOkBodyImpl extends AMQMethodBody_0_91 implements ChannelOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final byte[] _channelId; // [channelId]
+
+ // Constructor
+ public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelId = readBytes( buffer );
+ }
+
+ public ChannelOpenOkBodyImpl(
+ byte[] channelId
+ )
+ {
+ _channelId = channelId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChannelId()
+ {
+ return _channelId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _channelId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _channelId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchChannelOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: ");
+ buf.append( "channelId=" );
+ buf.append( getChannelId() == null ? "null" : java.util.Arrays.toString( getChannelId() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ClientMethodDispatcher_0_91.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ClientMethodDispatcher_0_91.java
new file mode 100644
index 0000000000..e60a4b6d0c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ClientMethodDispatcher_0_91.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+public interface ClientMethodDispatcher_0_91 extends ClientMethodDispatcher
+{
+
+ public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecoverSyncOk(BasicRecoverSyncOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueUnbindOk(QueueUnbindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java
new file mode 100644
index 0000000000..92c78ac484
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseBodyImpl extends AMQMethodBody_0_91 implements ConnectionCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ConnectionCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java
new file mode 100644
index 0000000000..8bf23cb8fb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseOkBodyImpl extends AMQMethodBody_0_91 implements ConnectionCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 51;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ConnectionCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenBodyImpl.java
new file mode 100644
index 0000000000..20284f6462
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenBodyImpl.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenBodyImpl extends AMQMethodBody_0_91 implements ConnectionOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final AMQShortString _virtualHost; // [virtualHost]
+ private final AMQShortString _capabilities; // [capabilities]
+ private final byte _bitfield0; // [insist]
+
+ // Constructor
+ public ConnectionOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _virtualHost = readAMQShortString( buffer );
+ _capabilities = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ConnectionOpenBodyImpl(
+ AMQShortString virtualHost,
+ AMQShortString capabilities,
+ boolean insist
+ )
+ {
+ _virtualHost = virtualHost;
+ _capabilities = capabilities;
+ byte bitfield0 = (byte)0;
+ if( insist )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getVirtualHost()
+ {
+ return _virtualHost;
+ }
+ public final AMQShortString getCapabilities()
+ {
+ return _capabilities;
+ }
+ public final boolean getInsist()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _virtualHost );
+ size += getSizeOf( _capabilities );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _virtualHost );
+ writeAMQShortString( buffer, _capabilities );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenBodyImpl: ");
+ buf.append( "virtualHost=" );
+ buf.append( getVirtualHost() );
+ buf.append( ", " );
+ buf.append( "capabilities=" );
+ buf.append( getCapabilities() );
+ buf.append( ", " );
+ buf.append( "insist=" );
+ buf.append( getInsist() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenOkBodyImpl.java
new file mode 100644
index 0000000000..346b26f039
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionOpenOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenOkBodyImpl extends AMQMethodBody_0_91 implements ConnectionOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final AMQShortString _knownHosts; // [knownHosts]
+
+ // Constructor
+ public ConnectionOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _knownHosts = readAMQShortString( buffer );
+ }
+
+ public ConnectionOpenOkBodyImpl(
+ AMQShortString knownHosts
+ )
+ {
+ _knownHosts = knownHosts;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getKnownHosts()
+ {
+ return _knownHosts;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _knownHosts );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _knownHosts );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenOkBodyImpl: ");
+ buf.append( "knownHosts=" );
+ buf.append( getKnownHosts() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureBodyImpl.java
new file mode 100644
index 0000000000..1573403c41
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureBodyImpl extends AMQMethodBody_0_91 implements ConnectionSecureBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte[] _challenge; // [challenge]
+
+ // Constructor
+ public ConnectionSecureBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _challenge = readBytes( buffer );
+ }
+
+ public ConnectionSecureBodyImpl(
+ byte[] challenge
+ )
+ {
+ _challenge = challenge;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChallenge()
+ {
+ return _challenge;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _challenge );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _challenge );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionSecure(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureBodyImpl: ");
+ buf.append( "challenge=" );
+ buf.append( getChallenge() == null ? "null" : java.util.Arrays.toString( getChallenge() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureOkBodyImpl.java
new file mode 100644
index 0000000000..bf44d51a00
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionSecureOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureOkBodyImpl extends AMQMethodBody_0_91 implements ConnectionSecureOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte[] _response; // [response]
+
+ // Constructor
+ public ConnectionSecureOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _response = readBytes( buffer );
+ }
+
+ public ConnectionSecureOkBodyImpl(
+ byte[] response
+ )
+ {
+ _response = response;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _response );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _response );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionSecureOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureOkBodyImpl: ");
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartBodyImpl.java
new file mode 100644
index 0000000000..b849c4fcfb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartBodyImpl.java
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartBodyImpl extends AMQMethodBody_0_91 implements ConnectionStartBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final short _versionMajor; // [versionMajor]
+ private final short _versionMinor; // [versionMinor]
+ private final FieldTable _serverProperties; // [serverProperties]
+ private final byte[] _mechanisms; // [mechanisms]
+ private final byte[] _locales; // [locales]
+
+ // Constructor
+ public ConnectionStartBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _versionMajor = readUnsignedByte( buffer );
+ _versionMinor = readUnsignedByte( buffer );
+ _serverProperties = readFieldTable( buffer );
+ _mechanisms = readBytes( buffer );
+ _locales = readBytes( buffer );
+ }
+
+ public ConnectionStartBodyImpl(
+ short versionMajor,
+ short versionMinor,
+ FieldTable serverProperties,
+ byte[] mechanisms,
+ byte[] locales
+ )
+ {
+ _versionMajor = versionMajor;
+ _versionMinor = versionMinor;
+ _serverProperties = serverProperties;
+ _mechanisms = mechanisms;
+ _locales = locales;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final short getVersionMajor()
+ {
+ return _versionMajor;
+ }
+ public final short getVersionMinor()
+ {
+ return _versionMinor;
+ }
+ public final FieldTable getServerProperties()
+ {
+ return _serverProperties;
+ }
+ public final byte[] getMechanisms()
+ {
+ return _mechanisms;
+ }
+ public final byte[] getLocales()
+ {
+ return _locales;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _serverProperties );
+ size += getSizeOf( _mechanisms );
+ size += getSizeOf( _locales );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedByte( buffer, _versionMajor );
+ writeUnsignedByte( buffer, _versionMinor );
+ writeFieldTable( buffer, _serverProperties );
+ writeBytes( buffer, _mechanisms );
+ writeBytes( buffer, _locales );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionStart(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartBodyImpl: ");
+ buf.append( "versionMajor=" );
+ buf.append( getVersionMajor() );
+ buf.append( ", " );
+ buf.append( "versionMinor=" );
+ buf.append( getVersionMinor() );
+ buf.append( ", " );
+ buf.append( "serverProperties=" );
+ buf.append( getServerProperties() );
+ buf.append( ", " );
+ buf.append( "mechanisms=" );
+ buf.append( getMechanisms() == null ? "null" : java.util.Arrays.toString( getMechanisms() ) );
+ buf.append( ", " );
+ buf.append( "locales=" );
+ buf.append( getLocales() == null ? "null" : java.util.Arrays.toString( getLocales() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartOkBodyImpl.java
new file mode 100644
index 0000000000..59bbf147e3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionStartOkBodyImpl.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartOkBodyImpl extends AMQMethodBody_0_91 implements ConnectionStartOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final FieldTable _clientProperties; // [clientProperties]
+ private final AMQShortString _mechanism; // [mechanism]
+ private final byte[] _response; // [response]
+ private final AMQShortString _locale; // [locale]
+
+ // Constructor
+ public ConnectionStartOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clientProperties = readFieldTable( buffer );
+ _mechanism = readAMQShortString( buffer );
+ _response = readBytes( buffer );
+ _locale = readAMQShortString( buffer );
+ }
+
+ public ConnectionStartOkBodyImpl(
+ FieldTable clientProperties,
+ AMQShortString mechanism,
+ byte[] response,
+ AMQShortString locale
+ )
+ {
+ _clientProperties = clientProperties;
+ _mechanism = mechanism;
+ _response = response;
+ _locale = locale;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getClientProperties()
+ {
+ return _clientProperties;
+ }
+ public final AMQShortString getMechanism()
+ {
+ return _mechanism;
+ }
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+ public final AMQShortString getLocale()
+ {
+ return _locale;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clientProperties );
+ size += getSizeOf( _mechanism );
+ size += getSizeOf( _response );
+ size += getSizeOf( _locale );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _clientProperties );
+ writeAMQShortString( buffer, _mechanism );
+ writeBytes( buffer, _response );
+ writeAMQShortString( buffer, _locale );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionStartOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartOkBodyImpl: ");
+ buf.append( "clientProperties=" );
+ buf.append( getClientProperties() );
+ buf.append( ", " );
+ buf.append( "mechanism=" );
+ buf.append( getMechanism() );
+ buf.append( ", " );
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append( ", " );
+ buf.append( "locale=" );
+ buf.append( getLocale() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneBodyImpl.java
new file mode 100644
index 0000000000..2c98b56858
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneBodyImpl extends AMQMethodBody_0_91 implements ConnectionTuneBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionTune(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneOkBodyImpl.java
new file mode 100644
index 0000000000..8a6a6aac3a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionTuneOkBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneOkBodyImpl extends AMQMethodBody_0_91 implements ConnectionTuneOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneOkBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionTuneOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneOkBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundBodyImpl.java
new file mode 100644
index 0000000000..69e70d7477
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundBodyImpl.java
@@ -0,0 +1,138 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundBodyImpl extends AMQMethodBody_0_91 implements ExchangeBoundBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 22;
+
+ // Fields declared in specification
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _queue; // [queue]
+
+ // Constructor
+ public ExchangeBoundBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _queue = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundBodyImpl(
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString queue
+ )
+ {
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _queue = queue;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _queue );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeBound(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundBodyImpl: ");
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundOkBodyImpl.java
new file mode 100644
index 0000000000..c21838081f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeBoundOkBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundOkBodyImpl extends AMQMethodBody_0_91 implements ExchangeBoundOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 23;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+
+ // Constructor
+ public ExchangeBoundOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundOkBodyImpl(
+ int replyCode,
+ AMQShortString replyText
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeBoundOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundOkBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareBodyImpl.java
new file mode 100644
index 0000000000..68b9ce084d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareBodyImpl.java
@@ -0,0 +1,220 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareBodyImpl extends AMQMethodBody_0_91 implements ExchangeDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _type; // [type]
+ private final byte _bitfield0; // [passive, durable, autoDelete, internal, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public ExchangeDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _type = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public ExchangeDeclareBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString type,
+ boolean passive,
+ boolean durable,
+ boolean autoDelete,
+ boolean internal,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _type = type;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( internal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getType()
+ {
+ return _type;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getInternal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _type );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _type );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "type=" );
+ buf.append( getType() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "internal=" );
+ buf.append( getInternal() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..2861d1e954
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeclareOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareOkBodyImpl extends AMQMethodBody_0_91 implements ExchangeDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeclareOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteBodyImpl.java
new file mode 100644
index 0000000000..f259d6433d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteBodyImpl.java
@@ -0,0 +1,154 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteBodyImpl extends AMQMethodBody_0_91 implements ExchangeDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final byte _bitfield0; // [ifUnused, nowait]
+
+ // Constructor
+ public ExchangeDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ExchangeDeleteBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ boolean ifUnused,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..fc4ef99a5b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ExchangeDeleteOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteOkBodyImpl extends AMQMethodBody_0_91 implements ExchangeDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeleteOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchExchangeDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodDispatcher_0_91.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodDispatcher_0_91.java
new file mode 100644
index 0000000000..9846ce4b48
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodDispatcher_0_91.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.framing.*;
+
+public interface MethodDispatcher_0_91
+ extends MethodDispatcher,
+ ServerMethodDispatcher_0_91,
+ ClientMethodDispatcher_0_91
+{
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java
new file mode 100644
index 0000000000..40970f2266
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java
@@ -0,0 +1,877 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.protocol.AMQConstant;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.codec.MarkableDataInput;
+
+
+public class MethodRegistry_0_91 extends MethodRegistry
+{
+
+ private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
+
+ private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_0_91();
+
+ private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[91][];
+
+ public MethodRegistry_0_91()
+ {
+ this(new ProtocolVersion((byte)0,(byte)91));
+ }
+
+ public MethodRegistry_0_91(ProtocolVersion pv)
+ {
+ super(pv);
+
+
+
+ // Register method body instance factories for the Connection class.
+
+ _factories[10] = new AMQMethodBodyInstanceFactory[52];
+
+ _factories[10][10] = ConnectionStartBodyImpl.getFactory();
+ _factories[10][11] = ConnectionStartOkBodyImpl.getFactory();
+ _factories[10][20] = ConnectionSecureBodyImpl.getFactory();
+ _factories[10][21] = ConnectionSecureOkBodyImpl.getFactory();
+ _factories[10][30] = ConnectionTuneBodyImpl.getFactory();
+ _factories[10][31] = ConnectionTuneOkBodyImpl.getFactory();
+ _factories[10][40] = ConnectionOpenBodyImpl.getFactory();
+ _factories[10][41] = ConnectionOpenOkBodyImpl.getFactory();
+ _factories[10][50] = ConnectionCloseBodyImpl.getFactory();
+ _factories[10][51] = ConnectionCloseOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Channel class.
+
+ _factories[20] = new AMQMethodBodyInstanceFactory[42];
+
+ _factories[20][10] = ChannelOpenBodyImpl.getFactory();
+ _factories[20][11] = ChannelOpenOkBodyImpl.getFactory();
+ _factories[20][20] = ChannelFlowBodyImpl.getFactory();
+ _factories[20][21] = ChannelFlowOkBodyImpl.getFactory();
+ _factories[20][40] = ChannelCloseBodyImpl.getFactory();
+ _factories[20][41] = ChannelCloseOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Exchange class.
+
+ _factories[40] = new AMQMethodBodyInstanceFactory[24];
+
+ _factories[40][10] = ExchangeDeclareBodyImpl.getFactory();
+ _factories[40][11] = ExchangeDeclareOkBodyImpl.getFactory();
+ _factories[40][20] = ExchangeDeleteBodyImpl.getFactory();
+ _factories[40][21] = ExchangeDeleteOkBodyImpl.getFactory();
+ _factories[40][22] = ExchangeBoundBodyImpl.getFactory();
+ _factories[40][23] = ExchangeBoundOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Queue class.
+
+ _factories[50] = new AMQMethodBodyInstanceFactory[52];
+
+ _factories[50][10] = QueueDeclareBodyImpl.getFactory();
+ _factories[50][11] = QueueDeclareOkBodyImpl.getFactory();
+ _factories[50][20] = QueueBindBodyImpl.getFactory();
+ _factories[50][21] = QueueBindOkBodyImpl.getFactory();
+ _factories[50][30] = QueuePurgeBodyImpl.getFactory();
+ _factories[50][31] = QueuePurgeOkBodyImpl.getFactory();
+ _factories[50][40] = QueueDeleteBodyImpl.getFactory();
+ _factories[50][41] = QueueDeleteOkBodyImpl.getFactory();
+ _factories[50][50] = QueueUnbindBodyImpl.getFactory();
+ _factories[50][51] = QueueUnbindOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Basic class.
+
+ _factories[60] = new AMQMethodBodyInstanceFactory[112];
+
+ _factories[60][10] = BasicQosBodyImpl.getFactory();
+ _factories[60][11] = BasicQosOkBodyImpl.getFactory();
+ _factories[60][20] = BasicConsumeBodyImpl.getFactory();
+ _factories[60][21] = BasicConsumeOkBodyImpl.getFactory();
+ _factories[60][30] = BasicCancelBodyImpl.getFactory();
+ _factories[60][31] = BasicCancelOkBodyImpl.getFactory();
+ _factories[60][40] = BasicPublishBodyImpl.getFactory();
+ _factories[60][50] = BasicReturnBodyImpl.getFactory();
+ _factories[60][60] = BasicDeliverBodyImpl.getFactory();
+ _factories[60][70] = BasicGetBodyImpl.getFactory();
+ _factories[60][71] = BasicGetOkBodyImpl.getFactory();
+ _factories[60][72] = BasicGetEmptyBodyImpl.getFactory();
+ _factories[60][80] = BasicAckBodyImpl.getFactory();
+ _factories[60][90] = BasicRejectBodyImpl.getFactory();
+ _factories[60][100] = BasicRecoverBodyImpl.getFactory();
+ _factories[60][110] = BasicRecoverSyncBodyImpl.getFactory();
+ _factories[60][111] = BasicRecoverSyncOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Tx class.
+
+ _factories[90] = new AMQMethodBodyInstanceFactory[32];
+
+ _factories[90][10] = TxSelectBodyImpl.getFactory();
+ _factories[90][11] = TxSelectOkBodyImpl.getFactory();
+ _factories[90][20] = TxCommitBodyImpl.getFactory();
+ _factories[90][21] = TxCommitOkBodyImpl.getFactory();
+ _factories[90][30] = TxRollbackBodyImpl.getFactory();
+ _factories[90][31] = TxRollbackOkBodyImpl.getFactory();
+ }
+
+ public AMQMethodBody convertToBody(MarkableDataInput in, long size)
+ throws AMQFrameDecodingException, IOException
+ {
+ int classId = in.readUnsignedShort();
+ int methodId = in.readUnsignedShort();
+
+ AMQMethodBodyInstanceFactory bodyFactory;
+ try
+ {
+ bodyFactory = _factories[classId][methodId];
+ }
+ catch(NullPointerException e)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 0-91"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+ catch(IndexOutOfBoundsException e)
+ {
+ if(classId >= _factories.length)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 0-91"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ else
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 0-91"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ }
+
+ if (bodyFactory == null)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 0-91"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+
+ return bodyFactory.newInstance(in, size);
+ }
+
+ public int getMaxClassId()
+ {
+ return 90;
+ }
+
+ public int getMaxMethodId(int classId)
+ {
+ return _factories[classId].length - 1;
+ }
+
+
+
+ public ConnectionStartBody createConnectionStartBody(
+ final short versionMajor,
+ final short versionMinor,
+ final FieldTable serverProperties,
+ final byte[] mechanisms,
+ final byte[] locales
+ )
+ {
+ return new ConnectionStartBodyImpl(
+ versionMajor,
+ versionMinor,
+ serverProperties,
+ mechanisms,
+ locales
+ );
+ }
+
+ public ConnectionStartOkBody createConnectionStartOkBody(
+ final FieldTable clientProperties,
+ final AMQShortString mechanism,
+ final byte[] response,
+ final AMQShortString locale
+ )
+ {
+ return new ConnectionStartOkBodyImpl(
+ clientProperties,
+ mechanism,
+ response,
+ locale
+ );
+ }
+
+ public ConnectionSecureBody createConnectionSecureBody(
+ final byte[] challenge
+ )
+ {
+ return new ConnectionSecureBodyImpl(
+ challenge
+ );
+ }
+
+ public ConnectionSecureOkBody createConnectionSecureOkBody(
+ final byte[] response
+ )
+ {
+ return new ConnectionSecureOkBodyImpl(
+ response
+ );
+ }
+
+ public ConnectionTuneBody createConnectionTuneBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionTuneOkBody createConnectionTuneOkBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneOkBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionOpenBody createConnectionOpenBody(
+ final AMQShortString virtualHost,
+ final AMQShortString capabilities,
+ final boolean insist
+ )
+ {
+ return new ConnectionOpenBodyImpl(
+ virtualHost,
+ capabilities,
+ insist
+ );
+ }
+
+ public ConnectionOpenOkBody createConnectionOpenOkBody(
+ final AMQShortString knownHosts
+ )
+ {
+ return new ConnectionOpenOkBodyImpl(
+ knownHosts
+ );
+ }
+
+ public ConnectionCloseBody createConnectionCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ConnectionCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ConnectionCloseOkBody createConnectionCloseOkBody(
+ )
+ {
+ return new ConnectionCloseOkBodyImpl(
+ );
+ }
+
+
+
+
+ public ChannelOpenBody createChannelOpenBody(
+ final AMQShortString outOfBand
+ )
+ {
+ return new ChannelOpenBodyImpl(
+ outOfBand
+ );
+ }
+
+ public ChannelOpenOkBody createChannelOpenOkBody(
+ final byte[] channelId
+ )
+ {
+ return new ChannelOpenOkBodyImpl(
+ channelId
+ );
+ }
+
+ public ChannelFlowBody createChannelFlowBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowBodyImpl(
+ active
+ );
+ }
+
+ public ChannelFlowOkBody createChannelFlowOkBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowOkBodyImpl(
+ active
+ );
+ }
+
+ public ChannelCloseBody createChannelCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ChannelCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ChannelCloseOkBody createChannelCloseOkBody(
+ )
+ {
+ return new ChannelCloseOkBodyImpl(
+ );
+ }
+
+
+
+
+ public ExchangeDeclareBody createExchangeDeclareBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString type,
+ final boolean passive,
+ final boolean durable,
+ final boolean autoDelete,
+ final boolean internal,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new ExchangeDeclareBodyImpl(
+ ticket,
+ exchange,
+ type,
+ passive,
+ durable,
+ autoDelete,
+ internal,
+ nowait,
+ arguments
+ );
+ }
+
+ public ExchangeDeclareOkBody createExchangeDeclareOkBody(
+ )
+ {
+ return new ExchangeDeclareOkBodyImpl(
+ );
+ }
+
+ public ExchangeDeleteBody createExchangeDeleteBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final boolean ifUnused,
+ final boolean nowait
+ )
+ {
+ return new ExchangeDeleteBodyImpl(
+ ticket,
+ exchange,
+ ifUnused,
+ nowait
+ );
+ }
+
+ public ExchangeDeleteOkBody createExchangeDeleteOkBody(
+ )
+ {
+ return new ExchangeDeleteOkBodyImpl(
+ );
+ }
+
+ public ExchangeBoundBody createExchangeBoundBody(
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString queue
+ )
+ {
+ return new ExchangeBoundBodyImpl(
+ exchange,
+ routingKey,
+ queue
+ );
+ }
+
+ public ExchangeBoundOkBody createExchangeBoundOkBody(
+ final int replyCode,
+ final AMQShortString replyText
+ )
+ {
+ return new ExchangeBoundOkBodyImpl(
+ replyCode,
+ replyText
+ );
+ }
+
+
+
+
+ public QueueDeclareBody createQueueDeclareBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean passive,
+ final boolean durable,
+ final boolean exclusive,
+ final boolean autoDelete,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueDeclareBodyImpl(
+ ticket,
+ queue,
+ passive,
+ durable,
+ exclusive,
+ autoDelete,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueDeclareOkBody createQueueDeclareOkBody(
+ final AMQShortString queue,
+ final long messageCount,
+ final long consumerCount
+ )
+ {
+ return new QueueDeclareOkBodyImpl(
+ queue,
+ messageCount,
+ consumerCount
+ );
+ }
+
+ public QueueBindBody createQueueBindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueBindBodyImpl(
+ ticket,
+ queue,
+ exchange,
+ routingKey,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueBindOkBody createQueueBindOkBody(
+ )
+ {
+ return new QueueBindOkBodyImpl(
+ );
+ }
+
+ public QueuePurgeBody createQueuePurgeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean nowait
+ )
+ {
+ return new QueuePurgeBodyImpl(
+ ticket,
+ queue,
+ nowait
+ );
+ }
+
+ public QueuePurgeOkBody createQueuePurgeOkBody(
+ final long messageCount
+ )
+ {
+ return new QueuePurgeOkBodyImpl(
+ messageCount
+ );
+ }
+
+ public QueueDeleteBody createQueueDeleteBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean ifUnused,
+ final boolean ifEmpty,
+ final boolean nowait
+ )
+ {
+ return new QueueDeleteBodyImpl(
+ ticket,
+ queue,
+ ifUnused,
+ ifEmpty,
+ nowait
+ );
+ }
+
+ public QueueDeleteOkBody createQueueDeleteOkBody(
+ final long messageCount
+ )
+ {
+ return new QueueDeleteOkBodyImpl(
+ messageCount
+ );
+ }
+
+ public QueueUnbindBody createQueueUnbindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final FieldTable arguments
+ )
+ {
+ return new QueueUnbindBodyImpl(
+ ticket,
+ queue,
+ exchange,
+ routingKey,
+ arguments
+ );
+ }
+
+ public QueueUnbindOkBody createQueueUnbindOkBody(
+ )
+ {
+ return new QueueUnbindOkBodyImpl(
+ );
+ }
+
+
+
+
+ public BasicQosBody createBasicQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new BasicQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public BasicQosOkBody createBasicQosOkBody(
+ )
+ {
+ return new BasicQosOkBodyImpl(
+ );
+ }
+
+ public BasicConsumeBody createBasicConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new BasicConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ noAck,
+ exclusive,
+ nowait,
+ arguments
+ );
+ }
+
+ public BasicConsumeOkBody createBasicConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicCancelBody createBasicCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new BasicCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public BasicCancelOkBody createBasicCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicPublishBody createBasicPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ )
+ {
+ return new BasicPublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate
+ );
+ }
+
+ public BasicReturnBody createBasicReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicDeliverBody createBasicDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicGetBody createBasicGetBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean noAck
+ )
+ {
+ return new BasicGetBodyImpl(
+ ticket,
+ queue,
+ noAck
+ );
+ }
+
+ public BasicGetOkBody createBasicGetOkBody(
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final long messageCount
+ )
+ {
+ return new BasicGetOkBodyImpl(
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey,
+ messageCount
+ );
+ }
+
+ public BasicGetEmptyBody createBasicGetEmptyBody(
+ final AMQShortString clusterId
+ )
+ {
+ return new BasicGetEmptyBodyImpl(
+ clusterId
+ );
+ }
+
+ public BasicAckBody createBasicAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ )
+ {
+ return new BasicAckBodyImpl(
+ deliveryTag,
+ multiple
+ );
+ }
+
+ public BasicRejectBody createBasicRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ )
+ {
+ return new BasicRejectBodyImpl(
+ deliveryTag,
+ requeue
+ );
+ }
+
+ public BasicRecoverBody createBasicRecoverBody(
+ final boolean requeue
+ )
+ {
+ return new BasicRecoverBodyImpl(
+ requeue
+ );
+ }
+
+ public BasicRecoverSyncBody createBasicRecoverSyncBody(
+ final boolean requeue
+ )
+ {
+ return new BasicRecoverSyncBodyImpl(
+ requeue
+ );
+ }
+
+ public BasicRecoverSyncOkBody createBasicRecoverSyncOkBody(
+ )
+ {
+ return new BasicRecoverSyncOkBodyImpl(
+ );
+ }
+
+
+
+
+ public TxSelectBody createTxSelectBody(
+ )
+ {
+ return new TxSelectBodyImpl(
+ );
+ }
+
+ public TxSelectOkBody createTxSelectOkBody(
+ )
+ {
+ return new TxSelectOkBodyImpl(
+ );
+ }
+
+ public TxCommitBody createTxCommitBody(
+ )
+ {
+ return new TxCommitBodyImpl(
+ );
+ }
+
+ public TxCommitOkBody createTxCommitOkBody(
+ )
+ {
+ return new TxCommitOkBodyImpl(
+ );
+ }
+
+ public TxRollbackBody createTxRollbackBody(
+ )
+ {
+ return new TxRollbackBodyImpl(
+ );
+ }
+
+ public TxRollbackOkBody createTxRollbackOkBody(
+ )
+ {
+ return new TxRollbackOkBodyImpl(
+ );
+ }
+
+
+
+ public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
+ {
+ return _protocolVersionConverter;
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindBodyImpl.java
new file mode 100644
index 0000000000..3c79181d1d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindBodyImpl extends AMQMethodBody_0_91 implements QueueBindBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueBindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueBindBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueBind(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindOkBodyImpl.java
new file mode 100644
index 0000000000..b73ed8840d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueBindOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindOkBodyImpl extends AMQMethodBody_0_91 implements QueueBindOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public QueueBindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public QueueBindOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueBindOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareBodyImpl.java
new file mode 100644
index 0000000000..3f315cd239
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareBodyImpl extends AMQMethodBody_0_91 implements QueueDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [passive, durable, exclusive, autoDelete, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueDeclareBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean passive,
+ boolean durable,
+ boolean exclusive,
+ boolean autoDelete,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..6f4452199d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeclareOkBodyImpl.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareOkBodyImpl extends AMQMethodBody_0_91 implements QueueDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final AMQShortString _queue; // [queue]
+ private final long _messageCount; // [messageCount]
+ private final long _consumerCount; // [consumerCount]
+
+ // Constructor
+ public QueueDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _queue = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ _consumerCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeclareOkBodyImpl(
+ AMQShortString queue,
+ long messageCount,
+ long consumerCount
+ )
+ {
+ _queue = queue;
+ _messageCount = messageCount;
+ _consumerCount = consumerCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+ public final long getConsumerCount()
+ {
+ return _consumerCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _queue );
+ writeUnsignedInteger( buffer, _messageCount );
+ writeUnsignedInteger( buffer, _consumerCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareOkBodyImpl: ");
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append( ", " );
+ buf.append( "consumerCount=" );
+ buf.append( getConsumerCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteBodyImpl.java
new file mode 100644
index 0000000000..1d021d9c18
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteBodyImpl extends AMQMethodBody_0_91 implements QueueDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [ifUnused, ifEmpty, nowait]
+
+ // Constructor
+ public QueueDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueueDeleteBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean ifUnused,
+ boolean ifEmpty,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( ifEmpty )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getIfEmpty()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "ifEmpty=" );
+ buf.append( getIfEmpty() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..30e54e15a2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueDeleteOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteOkBodyImpl extends AMQMethodBody_0_91 implements QueueDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueueDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeleteOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeBodyImpl.java
new file mode 100644
index 0000000000..b217a8b3f2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeBodyImpl extends AMQMethodBody_0_91 implements QueuePurgeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public QueuePurgeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueuePurgeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueuePurge(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeOkBodyImpl.java
new file mode 100644
index 0000000000..268ebcff54
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueuePurgeOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeOkBodyImpl extends AMQMethodBody_0_91 implements QueuePurgeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueuePurgeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueuePurgeOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueuePurgeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java
new file mode 100644
index 0000000000..d29db36ffa
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueUnbindBodyImpl extends AMQMethodBody_0_91 implements QueueUnbindBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueUnbindBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueUnbindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueUnbindBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueUnbind(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueUnbindBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java
new file mode 100644
index 0000000000..01747fa536
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueUnbindOkBodyImpl extends AMQMethodBody_0_91 implements QueueUnbindOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueUnbindOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 51;
+
+ // Fields declared in specification
+
+ // Constructor
+ public QueueUnbindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public QueueUnbindOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchQueueUnbindOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueUnbindOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ServerMethodDispatcher_0_91.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ServerMethodDispatcher_0_91.java
new file mode 100644
index 0000000000..b24b8253d2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ServerMethodDispatcher_0_91.java
@@ -0,0 +1,69 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface ServerMethodDispatcher_0_91 extends ServerMethodDispatcher
+{
+
+ public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecoverSync(BasicRecoverSyncBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueUnbind(QueueUnbindBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitBodyImpl.java
new file mode 100644
index 0000000000..8e2427efc4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitBodyImpl extends AMQMethodBody_0_91 implements TxCommitBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxCommit(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitOkBodyImpl.java
new file mode 100644
index 0000000000..df7af95c0f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxCommitOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitOkBodyImpl extends AMQMethodBody_0_91 implements TxCommitOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxCommitOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackBodyImpl.java
new file mode 100644
index 0000000000..3b3e1d5366
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackBodyImpl extends AMQMethodBody_0_91 implements TxRollbackBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxRollback(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackOkBodyImpl.java
new file mode 100644
index 0000000000..0d820a4b82
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxRollbackOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackOkBodyImpl extends AMQMethodBody_0_91 implements TxRollbackOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxRollbackOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectBodyImpl.java
new file mode 100644
index 0000000000..ad0fe78e9a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectBodyImpl extends AMQMethodBody_0_91 implements TxSelectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxSelect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectOkBodyImpl.java
new file mode 100644
index 0000000000..bfc6296b24
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/TxSelectOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 0-91
+ */
+
+package org.apache.qpid.framing.amqp_0_91;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectOkBodyImpl extends AMQMethodBody_0_91 implements TxSelectOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_0_91)dispatcher).dispatchTxSelectOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java
new file mode 100644
index 0000000000..a29363f293
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class AccessRequestBodyImpl extends AMQMethodBody_8_0 implements AccessRequestBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new AccessRequestBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 30;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final AMQShortString _realm; // [realm]
+ private final byte _bitfield0; // [exclusive, passive, active, write, read]
+
+ // Constructor
+ public AccessRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _realm = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public AccessRequestBodyImpl(
+ AMQShortString realm,
+ boolean exclusive,
+ boolean passive,
+ boolean active,
+ boolean write,
+ boolean read
+ )
+ {
+ _realm = realm;
+ byte bitfield0 = (byte)0;
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( write )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( read )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getRealm()
+ {
+ return _realm;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getWrite()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getRead()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _realm );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _realm );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchAccessRequest(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[AccessRequestBodyImpl: ");
+ buf.append( "realm=" );
+ buf.append( getRealm() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append( ", " );
+ buf.append( "write=" );
+ buf.append( getWrite() );
+ buf.append( ", " );
+ buf.append( "read=" );
+ buf.append( getRead() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java
new file mode 100644
index 0000000000..5c207b59d4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class AccessRequestOkBodyImpl extends AMQMethodBody_8_0 implements AccessRequestOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new AccessRequestOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 30;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+
+ // Constructor
+ public AccessRequestOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ }
+
+ public AccessRequestOkBodyImpl(
+ int ticket
+ )
+ {
+ _ticket = ticket;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchAccessRequestOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[AccessRequestOkBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicAckBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicAckBodyImpl.java
new file mode 100644
index 0000000000..81f84ecf7f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicAckBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicAckBodyImpl extends AMQMethodBody_8_0 implements BasicAckBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicAckBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [multiple]
+
+ // Constructor
+ public BasicAckBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicAckBodyImpl(
+ long deliveryTag,
+ boolean multiple
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( multiple )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getMultiple()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicAck(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicAckBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "multiple=" );
+ buf.append( getMultiple() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelBodyImpl.java
new file mode 100644
index 0000000000..196268654b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelBodyImpl extends AMQMethodBody_8_0 implements BasicCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public BasicCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelOkBodyImpl.java
new file mode 100644
index 0000000000..082348616d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicCancelOkBodyImpl extends AMQMethodBody_8_0 implements BasicCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeBodyImpl.java
new file mode 100644
index 0000000000..d11f18986f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeBodyImpl extends AMQMethodBody_8_0 implements BasicConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public BasicConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public BasicConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..7327b2da3f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicConsumeOkBodyImpl extends AMQMethodBody_8_0 implements BasicConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public BasicConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public BasicConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicDeliverBodyImpl.java
new file mode 100644
index 0000000000..58cf16fe55
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicDeliverBodyImpl.java
@@ -0,0 +1,168 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicDeliverBodyImpl extends AMQMethodBody_8_0 implements BasicDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetBodyImpl.java
new file mode 100644
index 0000000000..d348101cee
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetBodyImpl extends AMQMethodBody_8_0 implements BasicGetBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [noAck]
+
+ // Constructor
+ public BasicGetBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicGetBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean noAck
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicGet(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetEmptyBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetEmptyBodyImpl.java
new file mode 100644
index 0000000000..3e49be1eb1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetEmptyBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetEmptyBodyImpl extends AMQMethodBody_8_0 implements BasicGetEmptyBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetEmptyBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 72;
+
+ // Fields declared in specification
+ private final AMQShortString _clusterId; // [clusterId]
+
+ // Constructor
+ public BasicGetEmptyBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clusterId = readAMQShortString( buffer );
+ }
+
+ public BasicGetEmptyBodyImpl(
+ AMQShortString clusterId
+ )
+ {
+ _clusterId = clusterId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getClusterId()
+ {
+ return _clusterId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clusterId );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _clusterId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicGetEmpty(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetEmptyBodyImpl: ");
+ buf.append( "clusterId=" );
+ buf.append( getClusterId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetOkBodyImpl.java
new file mode 100644
index 0000000000..bcfefe2e34
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicGetOkBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicGetOkBodyImpl extends AMQMethodBody_8_0 implements BasicGetOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicGetOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 71;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public BasicGetOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public BasicGetOkBodyImpl(
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ long messageCount
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 13;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicGetOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicGetOkBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicPublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicPublishBodyImpl.java
new file mode 100644
index 0000000000..dc5d82a5b4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicPublishBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicPublishBodyImpl extends AMQMethodBody_8_0 implements BasicPublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicPublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+
+ // Constructor
+ public BasicPublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicPublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicPublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicPublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosBodyImpl.java
new file mode 100644
index 0000000000..76fdfac3cd
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosBodyImpl extends AMQMethodBody_8_0 implements BasicQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public BasicQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosOkBodyImpl.java
new file mode 100644
index 0000000000..a9d7ca998c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicQosOkBodyImpl extends AMQMethodBody_8_0 implements BasicQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverBodyImpl.java
new file mode 100644
index 0000000000..2ad62004bc
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverBodyImpl extends AMQMethodBody_8_0 implements BasicRecoverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRecoverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRecoverBodyImpl(
+ boolean requeue
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicRecover(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverBodyImpl: ");
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java
new file mode 100644
index 0000000000..4d247b7edd
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRecoverOkBodyImpl extends AMQMethodBody_8_0 implements BasicRecoverOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRecoverOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 101;
+
+ // Fields declared in specification
+
+ // Constructor
+ public BasicRecoverOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public BasicRecoverOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicRecoverOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRecoverOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRejectBodyImpl.java
new file mode 100644
index 0000000000..b1ae381f12
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRejectBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicRejectBodyImpl extends AMQMethodBody_8_0 implements BasicRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public BasicRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public BasicRejectBodyImpl(
+ long deliveryTag,
+ boolean requeue
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicRejectBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicReturnBodyImpl.java
new file mode 100644
index 0000000000..9675aec1a1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class BasicReturnBodyImpl extends AMQMethodBody_8_0 implements BasicReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new BasicReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 60;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public BasicReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public BasicReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchBasicReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[BasicReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java
new file mode 100644
index 0000000000..eecd44b026
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelAlertBodyImpl extends AMQMethodBody_8_0 implements ChannelAlertBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelAlertBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final FieldTable _details; // [details]
+
+ // Constructor
+ public ChannelAlertBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _details = readFieldTable( buffer );
+ }
+
+ public ChannelAlertBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ FieldTable details
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _details = details;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final FieldTable getDetails()
+ {
+ return _details;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _details );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeFieldTable( buffer, _details );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelAlert(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelAlertBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "details=" );
+ buf.append( getDetails() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseBodyImpl.java
new file mode 100644
index 0000000000..dccb691dc8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseBodyImpl extends AMQMethodBody_8_0 implements ChannelCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ChannelCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ChannelCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseOkBodyImpl.java
new file mode 100644
index 0000000000..ed3eab5da9
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelCloseOkBodyImpl extends AMQMethodBody_8_0 implements ChannelCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowBodyImpl.java
new file mode 100644
index 0000000000..12886543cf
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowBodyImpl extends AMQMethodBody_8_0 implements ChannelFlowBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelFlow(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowOkBodyImpl.java
new file mode 100644
index 0000000000..8b6ae9c444
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelFlowOkBodyImpl.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelFlowOkBodyImpl extends AMQMethodBody_8_0 implements ChannelFlowOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelFlowOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte _bitfield0; // [active]
+
+ // Constructor
+ public ChannelFlowOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ChannelFlowOkBodyImpl(
+ boolean active
+ )
+ {
+ byte bitfield0 = (byte)0;
+ if( active )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final boolean getActive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelFlowOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelFlowOkBodyImpl: ");
+ buf.append( "active=" );
+ buf.append( getActive() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenBodyImpl.java
new file mode 100644
index 0000000000..c4dab6343d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenBodyImpl extends AMQMethodBody_8_0 implements ChannelOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final AMQShortString _outOfBand; // [outOfBand]
+
+ // Constructor
+ public ChannelOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _outOfBand = readAMQShortString( buffer );
+ }
+
+ public ChannelOpenBodyImpl(
+ AMQShortString outOfBand
+ )
+ {
+ _outOfBand = outOfBand;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getOutOfBand()
+ {
+ return _outOfBand;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _outOfBand );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _outOfBand );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenBodyImpl: ");
+ buf.append( "outOfBand=" );
+ buf.append( getOutOfBand() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java
new file mode 100644
index 0000000000..f84a0c314d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ChannelOpenOkBodyImpl extends AMQMethodBody_8_0 implements ChannelOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ChannelOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 20;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ChannelOpenOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchChannelOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java
new file mode 100644
index 0000000000..52e44a8e4d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+public interface ClientMethodDispatcher_8_0 extends ClientMethodDispatcher
+{
+
+ public boolean dispatchAccessRequestOk(AccessRequestOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionRedirect(ConnectionRedirectBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxSelectOk(DtxSelectOkBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxStartOk(DtxStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileCancelOk(FileCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileConsumeOk(FileConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileDeliver(FileDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileQosOk(FileQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFileReturn(FileReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamCancelOk(StreamCancelOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamConsumeOk(StreamConsumeOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamDeliver(StreamDeliverBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamQosOk(StreamQosOkBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamReturn(StreamReturnBody body, int channelId) throws AMQException;
+ public boolean dispatchTestContent(TestContentBody body, int channelId) throws AMQException;
+ public boolean dispatchTestContentOk(TestContentOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestInteger(TestIntegerBody body, int channelId) throws AMQException;
+ public boolean dispatchTestIntegerOk(TestIntegerOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestString(TestStringBody body, int channelId) throws AMQException;
+ public boolean dispatchTestStringOk(TestStringOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestTable(TestTableBody body, int channelId) throws AMQException;
+ public boolean dispatchTestTableOk(TestTableOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java
new file mode 100644
index 0000000000..eab4ef05ee
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseBodyImpl extends AMQMethodBody_8_0 implements ConnectionCloseBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final int _classId; // [classId]
+ private final int _methodId; // [methodId]
+
+ // Constructor
+ public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _classId = readUnsignedShort( buffer );
+ _methodId = readUnsignedShort( buffer );
+ }
+
+ public ConnectionCloseBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ int classId,
+ int methodId
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _classId = classId;
+ _methodId = methodId;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final int getClassId()
+ {
+ return _classId;
+ }
+ public final int getMethodId()
+ {
+ return _methodId;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 6;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeUnsignedShort( buffer, _classId );
+ writeUnsignedShort( buffer, _methodId );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionClose(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "classId=" );
+ buf.append( getClassId() );
+ buf.append( ", " );
+ buf.append( "methodId=" );
+ buf.append( getMethodId() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java
new file mode 100644
index 0000000000..876715a37b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionCloseOkBodyImpl extends AMQMethodBody_8_0 implements ConnectionCloseOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionCloseOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 61;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ConnectionCloseOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionCloseOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenBodyImpl.java
new file mode 100644
index 0000000000..7745a8de0a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenBodyImpl.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenBodyImpl extends AMQMethodBody_8_0 implements ConnectionOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final AMQShortString _virtualHost; // [virtualHost]
+ private final AMQShortString _capabilities; // [capabilities]
+ private final byte _bitfield0; // [insist]
+
+ // Constructor
+ public ConnectionOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _virtualHost = readAMQShortString( buffer );
+ _capabilities = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ConnectionOpenBodyImpl(
+ AMQShortString virtualHost,
+ AMQShortString capabilities,
+ boolean insist
+ )
+ {
+ _virtualHost = virtualHost;
+ _capabilities = capabilities;
+ byte bitfield0 = (byte)0;
+ if( insist )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getVirtualHost()
+ {
+ return _virtualHost;
+ }
+ public final AMQShortString getCapabilities()
+ {
+ return _capabilities;
+ }
+ public final boolean getInsist()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _virtualHost );
+ size += getSizeOf( _capabilities );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _virtualHost );
+ writeAMQShortString( buffer, _capabilities );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenBodyImpl: ");
+ buf.append( "virtualHost=" );
+ buf.append( getVirtualHost() );
+ buf.append( ", " );
+ buf.append( "capabilities=" );
+ buf.append( getCapabilities() );
+ buf.append( ", " );
+ buf.append( "insist=" );
+ buf.append( getInsist() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenOkBodyImpl.java
new file mode 100644
index 0000000000..b74a2857cd
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionOpenOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionOpenOkBodyImpl extends AMQMethodBody_8_0 implements ConnectionOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final AMQShortString _knownHosts; // [knownHosts]
+
+ // Constructor
+ public ConnectionOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _knownHosts = readAMQShortString( buffer );
+ }
+
+ public ConnectionOpenOkBodyImpl(
+ AMQShortString knownHosts
+ )
+ {
+ _knownHosts = knownHosts;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getKnownHosts()
+ {
+ return _knownHosts;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _knownHosts );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _knownHosts );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionOpenOkBodyImpl: ");
+ buf.append( "knownHosts=" );
+ buf.append( getKnownHosts() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java
new file mode 100644
index 0000000000..59eadf1be3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionRedirectBodyImpl extends AMQMethodBody_8_0 implements ConnectionRedirectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionRedirectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final AMQShortString _host; // [host]
+ private final AMQShortString _knownHosts; // [knownHosts]
+
+ // Constructor
+ public ConnectionRedirectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _host = readAMQShortString( buffer );
+ _knownHosts = readAMQShortString( buffer );
+ }
+
+ public ConnectionRedirectBodyImpl(
+ AMQShortString host,
+ AMQShortString knownHosts
+ )
+ {
+ _host = host;
+ _knownHosts = knownHosts;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getHost()
+ {
+ return _host;
+ }
+ public final AMQShortString getKnownHosts()
+ {
+ return _knownHosts;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _host );
+ size += getSizeOf( _knownHosts );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _host );
+ writeAMQShortString( buffer, _knownHosts );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionRedirect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionRedirectBodyImpl: ");
+ buf.append( "host=" );
+ buf.append( getHost() );
+ buf.append( ", " );
+ buf.append( "knownHosts=" );
+ buf.append( getKnownHosts() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureBodyImpl.java
new file mode 100644
index 0000000000..29b341463e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureBodyImpl extends AMQMethodBody_8_0 implements ConnectionSecureBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final byte[] _challenge; // [challenge]
+
+ // Constructor
+ public ConnectionSecureBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _challenge = readBytes( buffer );
+ }
+
+ public ConnectionSecureBodyImpl(
+ byte[] challenge
+ )
+ {
+ _challenge = challenge;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getChallenge()
+ {
+ return _challenge;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _challenge );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _challenge );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionSecure(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureBodyImpl: ");
+ buf.append( "challenge=" );
+ buf.append( getChallenge() == null ? "null" : java.util.Arrays.toString( getChallenge() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureOkBodyImpl.java
new file mode 100644
index 0000000000..046abf439c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionSecureOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionSecureOkBodyImpl extends AMQMethodBody_8_0 implements ConnectionSecureOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionSecureOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte[] _response; // [response]
+
+ // Constructor
+ public ConnectionSecureOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _response = readBytes( buffer );
+ }
+
+ public ConnectionSecureOkBodyImpl(
+ byte[] response
+ )
+ {
+ _response = response;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _response );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _response );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionSecureOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionSecureOkBodyImpl: ");
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartBodyImpl.java
new file mode 100644
index 0000000000..1f23a9da6e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartBodyImpl.java
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartBodyImpl extends AMQMethodBody_8_0 implements ConnectionStartBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final short _versionMajor; // [versionMajor]
+ private final short _versionMinor; // [versionMinor]
+ private final FieldTable _serverProperties; // [serverProperties]
+ private final byte[] _mechanisms; // [mechanisms]
+ private final byte[] _locales; // [locales]
+
+ // Constructor
+ public ConnectionStartBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _versionMajor = readUnsignedByte( buffer );
+ _versionMinor = readUnsignedByte( buffer );
+ _serverProperties = readFieldTable( buffer );
+ _mechanisms = readBytes( buffer );
+ _locales = readBytes( buffer );
+ }
+
+ public ConnectionStartBodyImpl(
+ short versionMajor,
+ short versionMinor,
+ FieldTable serverProperties,
+ byte[] mechanisms,
+ byte[] locales
+ )
+ {
+ _versionMajor = versionMajor;
+ _versionMinor = versionMinor;
+ _serverProperties = serverProperties;
+ _mechanisms = mechanisms;
+ _locales = locales;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final short getVersionMajor()
+ {
+ return _versionMajor;
+ }
+ public final short getVersionMinor()
+ {
+ return _versionMinor;
+ }
+ public final FieldTable getServerProperties()
+ {
+ return _serverProperties;
+ }
+ public final byte[] getMechanisms()
+ {
+ return _mechanisms;
+ }
+ public final byte[] getLocales()
+ {
+ return _locales;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _serverProperties );
+ size += getSizeOf( _mechanisms );
+ size += getSizeOf( _locales );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedByte( buffer, _versionMajor );
+ writeUnsignedByte( buffer, _versionMinor );
+ writeFieldTable( buffer, _serverProperties );
+ writeBytes( buffer, _mechanisms );
+ writeBytes( buffer, _locales );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionStart(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartBodyImpl: ");
+ buf.append( "versionMajor=" );
+ buf.append( getVersionMajor() );
+ buf.append( ", " );
+ buf.append( "versionMinor=" );
+ buf.append( getVersionMinor() );
+ buf.append( ", " );
+ buf.append( "serverProperties=" );
+ buf.append( getServerProperties() );
+ buf.append( ", " );
+ buf.append( "mechanisms=" );
+ buf.append( getMechanisms() == null ? "null" : java.util.Arrays.toString( getMechanisms() ) );
+ buf.append( ", " );
+ buf.append( "locales=" );
+ buf.append( getLocales() == null ? "null" : java.util.Arrays.toString( getLocales() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartOkBodyImpl.java
new file mode 100644
index 0000000000..24ecf380ac
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionStartOkBodyImpl.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionStartOkBodyImpl extends AMQMethodBody_8_0 implements ConnectionStartOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionStartOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final FieldTable _clientProperties; // [clientProperties]
+ private final AMQShortString _mechanism; // [mechanism]
+ private final byte[] _response; // [response]
+ private final AMQShortString _locale; // [locale]
+
+ // Constructor
+ public ConnectionStartOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _clientProperties = readFieldTable( buffer );
+ _mechanism = readAMQShortString( buffer );
+ _response = readBytes( buffer );
+ _locale = readAMQShortString( buffer );
+ }
+
+ public ConnectionStartOkBodyImpl(
+ FieldTable clientProperties,
+ AMQShortString mechanism,
+ byte[] response,
+ AMQShortString locale
+ )
+ {
+ _clientProperties = clientProperties;
+ _mechanism = mechanism;
+ _response = response;
+ _locale = locale;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getClientProperties()
+ {
+ return _clientProperties;
+ }
+ public final AMQShortString getMechanism()
+ {
+ return _mechanism;
+ }
+ public final byte[] getResponse()
+ {
+ return _response;
+ }
+ public final AMQShortString getLocale()
+ {
+ return _locale;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _clientProperties );
+ size += getSizeOf( _mechanism );
+ size += getSizeOf( _response );
+ size += getSizeOf( _locale );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _clientProperties );
+ writeAMQShortString( buffer, _mechanism );
+ writeBytes( buffer, _response );
+ writeAMQShortString( buffer, _locale );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionStartOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionStartOkBodyImpl: ");
+ buf.append( "clientProperties=" );
+ buf.append( getClientProperties() );
+ buf.append( ", " );
+ buf.append( "mechanism=" );
+ buf.append( getMechanism() );
+ buf.append( ", " );
+ buf.append( "response=" );
+ buf.append( getResponse() == null ? "null" : java.util.Arrays.toString( getResponse() ) );
+ buf.append( ", " );
+ buf.append( "locale=" );
+ buf.append( getLocale() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneBodyImpl.java
new file mode 100644
index 0000000000..83aff93055
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneBodyImpl extends AMQMethodBody_8_0 implements ConnectionTuneBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionTune(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneOkBodyImpl.java
new file mode 100644
index 0000000000..a6221b9815
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionTuneOkBodyImpl.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ConnectionTuneOkBodyImpl extends AMQMethodBody_8_0 implements ConnectionTuneOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ConnectionTuneOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 10;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneOkBodyImpl(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionTuneOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneOkBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectBodyImpl.java
new file mode 100644
index 0000000000..ac2ff8b225
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxSelectBodyImpl extends AMQMethodBody_8_0 implements DtxSelectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxSelectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxSelectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxSelectBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchDtxSelect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxSelectBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectOkBodyImpl.java
new file mode 100644
index 0000000000..2281853e00
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxSelectOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxSelectOkBodyImpl extends AMQMethodBody_8_0 implements DtxSelectOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxSelectOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxSelectOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxSelectOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchDtxSelectOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxSelectOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartBodyImpl.java
new file mode 100644
index 0000000000..b5a1faa760
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxStartBodyImpl extends AMQMethodBody_8_0 implements DtxStartBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxStartBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final AMQShortString _dtxIdentifier; // [dtxIdentifier]
+
+ // Constructor
+ public DtxStartBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _dtxIdentifier = readAMQShortString( buffer );
+ }
+
+ public DtxStartBodyImpl(
+ AMQShortString dtxIdentifier
+ )
+ {
+ _dtxIdentifier = dtxIdentifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getDtxIdentifier()
+ {
+ return _dtxIdentifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _dtxIdentifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _dtxIdentifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchDtxStart(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxStartBodyImpl: ");
+ buf.append( "dtxIdentifier=" );
+ buf.append( getDtxIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartOkBodyImpl.java
new file mode 100644
index 0000000000..73fd13e7d3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/DtxStartOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class DtxStartOkBodyImpl extends AMQMethodBody_8_0 implements DtxStartOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new DtxStartOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 100;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public DtxStartOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public DtxStartOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchDtxStartOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[DtxStartOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundBodyImpl.java
new file mode 100644
index 0000000000..c391f1b7ee
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundBodyImpl.java
@@ -0,0 +1,138 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundBodyImpl extends AMQMethodBody_8_0 implements ExchangeBoundBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 22;
+
+ // Fields declared in specification
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _queue; // [queue]
+
+ // Constructor
+ public ExchangeBoundBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _queue = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundBodyImpl(
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString queue
+ )
+ {
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _queue = queue;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _queue );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeBound(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundBodyImpl: ");
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundOkBodyImpl.java
new file mode 100644
index 0000000000..cfbe77d70e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeBoundOkBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeBoundOkBodyImpl extends AMQMethodBody_8_0 implements ExchangeBoundOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeBoundOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 23;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+
+ // Constructor
+ public ExchangeBoundOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ }
+
+ public ExchangeBoundOkBodyImpl(
+ int replyCode,
+ AMQShortString replyText
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeBoundOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeBoundOkBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareBodyImpl.java
new file mode 100644
index 0000000000..de47e0b867
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareBodyImpl.java
@@ -0,0 +1,220 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareBodyImpl extends AMQMethodBody_8_0 implements ExchangeDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _type; // [type]
+ private final byte _bitfield0; // [passive, durable, autoDelete, internal, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public ExchangeDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _type = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public ExchangeDeclareBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString type,
+ boolean passive,
+ boolean durable,
+ boolean autoDelete,
+ boolean internal,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _type = type;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( internal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getType()
+ {
+ return _type;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getInternal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _type );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _type );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "type=" );
+ buf.append( getType() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "internal=" );
+ buf.append( getInternal() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..8d8ca793b8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeclareOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeclareOkBodyImpl extends AMQMethodBody_8_0 implements ExchangeDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeclareOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeclareOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteBodyImpl.java
new file mode 100644
index 0000000000..2bfc0f13f4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteBodyImpl.java
@@ -0,0 +1,154 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteBodyImpl extends AMQMethodBody_8_0 implements ExchangeDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final byte _bitfield0; // [ifUnused, nowait]
+
+ // Constructor
+ public ExchangeDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public ExchangeDeleteBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ boolean ifUnused,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..996072088c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ExchangeDeleteOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ExchangeDeleteOkBodyImpl extends AMQMethodBody_8_0 implements ExchangeDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new ExchangeDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 40;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public ExchangeDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public ExchangeDeleteOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchExchangeDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ExchangeDeleteOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileAckBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileAckBodyImpl.java
new file mode 100644
index 0000000000..1efad0825a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileAckBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileAckBodyImpl extends AMQMethodBody_8_0 implements FileAckBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileAckBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 90;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [multiple]
+
+ // Constructor
+ public FileAckBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileAckBodyImpl(
+ long deliveryTag,
+ boolean multiple
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( multiple )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getMultiple()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileAck(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileAckBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "multiple=" );
+ buf.append( getMultiple() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelBodyImpl.java
new file mode 100644
index 0000000000..422f6d8f16
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileCancelBodyImpl extends AMQMethodBody_8_0 implements FileCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public FileCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelOkBodyImpl.java
new file mode 100644
index 0000000000..b100ce9f1b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileCancelOkBodyImpl extends AMQMethodBody_8_0 implements FileCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public FileCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public FileCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeBodyImpl.java
new file mode 100644
index 0000000000..0a6aa06da4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeBodyImpl.java
@@ -0,0 +1,193 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileConsumeBodyImpl extends AMQMethodBody_8_0 implements FileConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, noAck, exclusive, nowait]
+
+ // Constructor
+ public FileConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean noAck,
+ boolean exclusive,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( noAck )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getNoAck()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "noAck=" );
+ buf.append( getNoAck() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..cde5176f42
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileConsumeOkBodyImpl extends AMQMethodBody_8_0 implements FileConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public FileConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public FileConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileDeliverBodyImpl.java
new file mode 100644
index 0000000000..3cfd508dd7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileDeliverBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileDeliverBodyImpl extends AMQMethodBody_8_0 implements FileDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 80;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [redelivered]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public FileDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public FileDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ boolean redelivered,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ AMQShortString identifier
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( redelivered )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRedelivered()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "redelivered=" );
+ buf.append( getRedelivered() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenBodyImpl.java
new file mode 100644
index 0000000000..aa79d22961
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileOpenBodyImpl extends AMQMethodBody_8_0 implements FileOpenBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileOpenBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final AMQShortString _identifier; // [identifier]
+ private final long _contentSize; // [contentSize]
+
+ // Constructor
+ public FileOpenBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _identifier = readAMQShortString( buffer );
+ _contentSize = readLong( buffer );
+ }
+
+ public FileOpenBodyImpl(
+ AMQShortString identifier,
+ long contentSize
+ )
+ {
+ _identifier = identifier;
+ _contentSize = contentSize;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+ public final long getContentSize()
+ {
+ return _contentSize;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _identifier );
+ writeLong( buffer, _contentSize );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileOpen(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileOpenBodyImpl: ");
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append( ", " );
+ buf.append( "contentSize=" );
+ buf.append( getContentSize() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenOkBodyImpl.java
new file mode 100644
index 0000000000..48845f7074
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileOpenOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileOpenOkBodyImpl extends AMQMethodBody_8_0 implements FileOpenOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileOpenOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _stagedSize; // [stagedSize]
+
+ // Constructor
+ public FileOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _stagedSize = readLong( buffer );
+ }
+
+ public FileOpenOkBodyImpl(
+ long stagedSize
+ )
+ {
+ _stagedSize = stagedSize;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getStagedSize()
+ {
+ return _stagedSize;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _stagedSize );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileOpenOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileOpenOkBodyImpl: ");
+ buf.append( "stagedSize=" );
+ buf.append( getStagedSize() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FilePublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FilePublishBodyImpl.java
new file mode 100644
index 0000000000..c3e01ec686
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FilePublishBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FilePublishBodyImpl extends AMQMethodBody_8_0 implements FilePublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FilePublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+ private final AMQShortString _identifier; // [identifier]
+
+ // Constructor
+ public FilePublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _identifier = readAMQShortString( buffer );
+ }
+
+ public FilePublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate,
+ AMQShortString identifier
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ _bitfield0 = bitfield0;
+ _identifier = identifier;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final AMQShortString getIdentifier()
+ {
+ return _identifier;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _identifier );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ writeAMQShortString( buffer, _identifier );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFilePublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FilePublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append( ", " );
+ buf.append( "identifier=" );
+ buf.append( getIdentifier() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosBodyImpl.java
new file mode 100644
index 0000000000..f78156d8df
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosBodyImpl.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileQosBodyImpl extends AMQMethodBody_8_0 implements FileQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public FileQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 7;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosOkBodyImpl.java
new file mode 100644
index 0000000000..17076f49b3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileQosOkBodyImpl extends AMQMethodBody_8_0 implements FileQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public FileQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public FileQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileRejectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileRejectBodyImpl.java
new file mode 100644
index 0000000000..a4e7a57540
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileRejectBodyImpl.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileRejectBodyImpl extends AMQMethodBody_8_0 implements FileRejectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileRejectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 100;
+
+ // Fields declared in specification
+ private final long _deliveryTag; // [deliveryTag]
+ private final byte _bitfield0; // [requeue]
+
+ // Constructor
+ public FileRejectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _deliveryTag = readLong( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public FileRejectBodyImpl(
+ long deliveryTag,
+ boolean requeue
+ )
+ {
+ _deliveryTag = deliveryTag;
+ byte bitfield0 = (byte)0;
+ if( requeue )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final boolean getRequeue()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 9;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _deliveryTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileReject(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileRejectBodyImpl: ");
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "requeue=" );
+ buf.append( getRequeue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileReturnBodyImpl.java
new file mode 100644
index 0000000000..bf696ca668
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileReturnBodyImpl extends AMQMethodBody_8_0 implements FileReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 70;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public FileReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public FileReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileStageBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileStageBodyImpl.java
new file mode 100644
index 0000000000..8e2185801b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/FileStageBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class FileStageBodyImpl extends AMQMethodBody_8_0 implements FileStageBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new FileStageBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 70;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+
+ // Constructor
+ public FileStageBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public FileStageBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchFileStage(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[FileStageBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodDispatcher_8_0.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodDispatcher_8_0.java
new file mode 100644
index 0000000000..dc4f33ab6d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodDispatcher_8_0.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.*;
+
+public interface MethodDispatcher_8_0
+ extends MethodDispatcher,
+ ServerMethodDispatcher_8_0,
+ ClientMethodDispatcher_8_0
+{
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java
new file mode 100644
index 0000000000..f3c1888e2a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java
@@ -0,0 +1,1407 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.protocol.AMQConstant;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.codec.MarkableDataInput;
+
+
+public class MethodRegistry_8_0 extends MethodRegistry
+{
+
+ private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
+
+ private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_8_0();
+
+ private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[121][];
+
+ public MethodRegistry_8_0()
+ {
+ this(new ProtocolVersion((byte)8,(byte)0));
+ }
+
+ public MethodRegistry_8_0(ProtocolVersion pv)
+ {
+ super(pv);
+
+
+
+ // Register method body instance factories for the Connection class.
+
+ _factories[10] = new AMQMethodBodyInstanceFactory[62];
+
+ _factories[10][10] = ConnectionStartBodyImpl.getFactory();
+ _factories[10][11] = ConnectionStartOkBodyImpl.getFactory();
+ _factories[10][20] = ConnectionSecureBodyImpl.getFactory();
+ _factories[10][21] = ConnectionSecureOkBodyImpl.getFactory();
+ _factories[10][30] = ConnectionTuneBodyImpl.getFactory();
+ _factories[10][31] = ConnectionTuneOkBodyImpl.getFactory();
+ _factories[10][40] = ConnectionOpenBodyImpl.getFactory();
+ _factories[10][41] = ConnectionOpenOkBodyImpl.getFactory();
+ _factories[10][50] = ConnectionRedirectBodyImpl.getFactory();
+ _factories[10][60] = ConnectionCloseBodyImpl.getFactory();
+ _factories[10][61] = ConnectionCloseOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Channel class.
+
+ _factories[20] = new AMQMethodBodyInstanceFactory[42];
+
+ _factories[20][10] = ChannelOpenBodyImpl.getFactory();
+ _factories[20][11] = ChannelOpenOkBodyImpl.getFactory();
+ _factories[20][20] = ChannelFlowBodyImpl.getFactory();
+ _factories[20][21] = ChannelFlowOkBodyImpl.getFactory();
+ _factories[20][30] = ChannelAlertBodyImpl.getFactory();
+ _factories[20][40] = ChannelCloseBodyImpl.getFactory();
+ _factories[20][41] = ChannelCloseOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Access class.
+
+ _factories[30] = new AMQMethodBodyInstanceFactory[12];
+
+ _factories[30][10] = AccessRequestBodyImpl.getFactory();
+ _factories[30][11] = AccessRequestOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Exchange class.
+
+ _factories[40] = new AMQMethodBodyInstanceFactory[24];
+
+ _factories[40][10] = ExchangeDeclareBodyImpl.getFactory();
+ _factories[40][11] = ExchangeDeclareOkBodyImpl.getFactory();
+ _factories[40][20] = ExchangeDeleteBodyImpl.getFactory();
+ _factories[40][21] = ExchangeDeleteOkBodyImpl.getFactory();
+ _factories[40][22] = ExchangeBoundBodyImpl.getFactory();
+ _factories[40][23] = ExchangeBoundOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Queue class.
+
+ _factories[50] = new AMQMethodBodyInstanceFactory[42];
+
+ _factories[50][10] = QueueDeclareBodyImpl.getFactory();
+ _factories[50][11] = QueueDeclareOkBodyImpl.getFactory();
+ _factories[50][20] = QueueBindBodyImpl.getFactory();
+ _factories[50][21] = QueueBindOkBodyImpl.getFactory();
+ _factories[50][30] = QueuePurgeBodyImpl.getFactory();
+ _factories[50][31] = QueuePurgeOkBodyImpl.getFactory();
+ _factories[50][40] = QueueDeleteBodyImpl.getFactory();
+ _factories[50][41] = QueueDeleteOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Basic class.
+
+ _factories[60] = new AMQMethodBodyInstanceFactory[102];
+
+ _factories[60][10] = BasicQosBodyImpl.getFactory();
+ _factories[60][11] = BasicQosOkBodyImpl.getFactory();
+ _factories[60][20] = BasicConsumeBodyImpl.getFactory();
+ _factories[60][21] = BasicConsumeOkBodyImpl.getFactory();
+ _factories[60][30] = BasicCancelBodyImpl.getFactory();
+ _factories[60][31] = BasicCancelOkBodyImpl.getFactory();
+ _factories[60][40] = BasicPublishBodyImpl.getFactory();
+ _factories[60][50] = BasicReturnBodyImpl.getFactory();
+ _factories[60][60] = BasicDeliverBodyImpl.getFactory();
+ _factories[60][70] = BasicGetBodyImpl.getFactory();
+ _factories[60][71] = BasicGetOkBodyImpl.getFactory();
+ _factories[60][72] = BasicGetEmptyBodyImpl.getFactory();
+ _factories[60][80] = BasicAckBodyImpl.getFactory();
+ _factories[60][90] = BasicRejectBodyImpl.getFactory();
+ _factories[60][100] = BasicRecoverBodyImpl.getFactory();
+ _factories[60][101] = BasicRecoverOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the File class.
+
+ _factories[70] = new AMQMethodBodyInstanceFactory[101];
+
+ _factories[70][10] = FileQosBodyImpl.getFactory();
+ _factories[70][11] = FileQosOkBodyImpl.getFactory();
+ _factories[70][20] = FileConsumeBodyImpl.getFactory();
+ _factories[70][21] = FileConsumeOkBodyImpl.getFactory();
+ _factories[70][30] = FileCancelBodyImpl.getFactory();
+ _factories[70][31] = FileCancelOkBodyImpl.getFactory();
+ _factories[70][40] = FileOpenBodyImpl.getFactory();
+ _factories[70][41] = FileOpenOkBodyImpl.getFactory();
+ _factories[70][50] = FileStageBodyImpl.getFactory();
+ _factories[70][60] = FilePublishBodyImpl.getFactory();
+ _factories[70][70] = FileReturnBodyImpl.getFactory();
+ _factories[70][80] = FileDeliverBodyImpl.getFactory();
+ _factories[70][90] = FileAckBodyImpl.getFactory();
+ _factories[70][100] = FileRejectBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Stream class.
+
+ _factories[80] = new AMQMethodBodyInstanceFactory[61];
+
+ _factories[80][10] = StreamQosBodyImpl.getFactory();
+ _factories[80][11] = StreamQosOkBodyImpl.getFactory();
+ _factories[80][20] = StreamConsumeBodyImpl.getFactory();
+ _factories[80][21] = StreamConsumeOkBodyImpl.getFactory();
+ _factories[80][30] = StreamCancelBodyImpl.getFactory();
+ _factories[80][31] = StreamCancelOkBodyImpl.getFactory();
+ _factories[80][40] = StreamPublishBodyImpl.getFactory();
+ _factories[80][50] = StreamReturnBodyImpl.getFactory();
+ _factories[80][60] = StreamDeliverBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Tx class.
+
+ _factories[90] = new AMQMethodBodyInstanceFactory[32];
+
+ _factories[90][10] = TxSelectBodyImpl.getFactory();
+ _factories[90][11] = TxSelectOkBodyImpl.getFactory();
+ _factories[90][20] = TxCommitBodyImpl.getFactory();
+ _factories[90][21] = TxCommitOkBodyImpl.getFactory();
+ _factories[90][30] = TxRollbackBodyImpl.getFactory();
+ _factories[90][31] = TxRollbackOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Dtx class.
+
+ _factories[100] = new AMQMethodBodyInstanceFactory[22];
+
+ _factories[100][10] = DtxSelectBodyImpl.getFactory();
+ _factories[100][11] = DtxSelectOkBodyImpl.getFactory();
+ _factories[100][20] = DtxStartBodyImpl.getFactory();
+ _factories[100][21] = DtxStartOkBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Tunnel class.
+
+ _factories[110] = new AMQMethodBodyInstanceFactory[11];
+
+ _factories[110][10] = TunnelRequestBodyImpl.getFactory();
+
+
+
+ // Register method body instance factories for the Test class.
+
+ _factories[120] = new AMQMethodBodyInstanceFactory[42];
+
+ _factories[120][10] = TestIntegerBodyImpl.getFactory();
+ _factories[120][11] = TestIntegerOkBodyImpl.getFactory();
+ _factories[120][20] = TestStringBodyImpl.getFactory();
+ _factories[120][21] = TestStringOkBodyImpl.getFactory();
+ _factories[120][30] = TestTableBodyImpl.getFactory();
+ _factories[120][31] = TestTableOkBodyImpl.getFactory();
+ _factories[120][40] = TestContentBodyImpl.getFactory();
+ _factories[120][41] = TestContentOkBodyImpl.getFactory();
+ }
+
+ public AMQMethodBody convertToBody(MarkableDataInput in, long size)
+ throws AMQFrameDecodingException, IOException
+ {
+ int classId = in.readUnsignedShort();
+ int methodId = in.readUnsignedShort();
+
+ AMQMethodBodyInstanceFactory bodyFactory;
+ try
+ {
+ bodyFactory = _factories[classId][methodId];
+ }
+ catch(NullPointerException e)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 8-0"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+ catch(IndexOutOfBoundsException e)
+ {
+ if(classId >= _factories.length)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version 8-0"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ else
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 8-0"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ }
+
+ if (bodyFactory == null)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version 8-0"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+
+ return bodyFactory.newInstance(in, size);
+ }
+
+ public int getMaxClassId()
+ {
+ return 120;
+ }
+
+ public int getMaxMethodId(int classId)
+ {
+ return _factories[classId].length - 1;
+ }
+
+
+
+ public ConnectionStartBody createConnectionStartBody(
+ final short versionMajor,
+ final short versionMinor,
+ final FieldTable serverProperties,
+ final byte[] mechanisms,
+ final byte[] locales
+ )
+ {
+ return new ConnectionStartBodyImpl(
+ versionMajor,
+ versionMinor,
+ serverProperties,
+ mechanisms,
+ locales
+ );
+ }
+
+ public ConnectionStartOkBody createConnectionStartOkBody(
+ final FieldTable clientProperties,
+ final AMQShortString mechanism,
+ final byte[] response,
+ final AMQShortString locale
+ )
+ {
+ return new ConnectionStartOkBodyImpl(
+ clientProperties,
+ mechanism,
+ response,
+ locale
+ );
+ }
+
+ public ConnectionSecureBody createConnectionSecureBody(
+ final byte[] challenge
+ )
+ {
+ return new ConnectionSecureBodyImpl(
+ challenge
+ );
+ }
+
+ public ConnectionSecureOkBody createConnectionSecureOkBody(
+ final byte[] response
+ )
+ {
+ return new ConnectionSecureOkBodyImpl(
+ response
+ );
+ }
+
+ public ConnectionTuneBody createConnectionTuneBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionTuneOkBody createConnectionTuneOkBody(
+ final int channelMax,
+ final long frameMax,
+ final int heartbeat
+ )
+ {
+ return new ConnectionTuneOkBodyImpl(
+ channelMax,
+ frameMax,
+ heartbeat
+ );
+ }
+
+ public ConnectionOpenBody createConnectionOpenBody(
+ final AMQShortString virtualHost,
+ final AMQShortString capabilities,
+ final boolean insist
+ )
+ {
+ return new ConnectionOpenBodyImpl(
+ virtualHost,
+ capabilities,
+ insist
+ );
+ }
+
+ public ConnectionOpenOkBody createConnectionOpenOkBody(
+ final AMQShortString knownHosts
+ )
+ {
+ return new ConnectionOpenOkBodyImpl(
+ knownHosts
+ );
+ }
+
+ public ConnectionRedirectBody createConnectionRedirectBody(
+ final AMQShortString host,
+ final AMQShortString knownHosts
+ )
+ {
+ return new ConnectionRedirectBodyImpl(
+ host,
+ knownHosts
+ );
+ }
+
+ public ConnectionCloseBody createConnectionCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ConnectionCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ConnectionCloseOkBody createConnectionCloseOkBody(
+ )
+ {
+ return new ConnectionCloseOkBodyImpl(
+ );
+ }
+
+
+
+
+ public ChannelOpenBody createChannelOpenBody(
+ final AMQShortString outOfBand
+ )
+ {
+ return new ChannelOpenBodyImpl(
+ outOfBand
+ );
+ }
+
+ public ChannelOpenOkBody createChannelOpenOkBody(
+ )
+ {
+ return new ChannelOpenOkBodyImpl(
+ );
+ }
+
+ public ChannelFlowBody createChannelFlowBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowBodyImpl(
+ active
+ );
+ }
+
+ public ChannelFlowOkBody createChannelFlowOkBody(
+ final boolean active
+ )
+ {
+ return new ChannelFlowOkBodyImpl(
+ active
+ );
+ }
+
+ public ChannelAlertBody createChannelAlertBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final FieldTable details
+ )
+ {
+ return new ChannelAlertBodyImpl(
+ replyCode,
+ replyText,
+ details
+ );
+ }
+
+ public ChannelCloseBody createChannelCloseBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final int classId,
+ final int methodId
+ )
+ {
+ return new ChannelCloseBodyImpl(
+ replyCode,
+ replyText,
+ classId,
+ methodId
+ );
+ }
+
+ public ChannelCloseOkBody createChannelCloseOkBody(
+ )
+ {
+ return new ChannelCloseOkBodyImpl(
+ );
+ }
+
+
+
+
+ public AccessRequestBody createAccessRequestBody(
+ final AMQShortString realm,
+ final boolean exclusive,
+ final boolean passive,
+ final boolean active,
+ final boolean write,
+ final boolean read
+ )
+ {
+ return new AccessRequestBodyImpl(
+ realm,
+ exclusive,
+ passive,
+ active,
+ write,
+ read
+ );
+ }
+
+ public AccessRequestOkBody createAccessRequestOkBody(
+ final int ticket
+ )
+ {
+ return new AccessRequestOkBodyImpl(
+ ticket
+ );
+ }
+
+
+
+
+ public ExchangeDeclareBody createExchangeDeclareBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString type,
+ final boolean passive,
+ final boolean durable,
+ final boolean autoDelete,
+ final boolean internal,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new ExchangeDeclareBodyImpl(
+ ticket,
+ exchange,
+ type,
+ passive,
+ durable,
+ autoDelete,
+ internal,
+ nowait,
+ arguments
+ );
+ }
+
+ public ExchangeDeclareOkBody createExchangeDeclareOkBody(
+ )
+ {
+ return new ExchangeDeclareOkBodyImpl(
+ );
+ }
+
+ public ExchangeDeleteBody createExchangeDeleteBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final boolean ifUnused,
+ final boolean nowait
+ )
+ {
+ return new ExchangeDeleteBodyImpl(
+ ticket,
+ exchange,
+ ifUnused,
+ nowait
+ );
+ }
+
+ public ExchangeDeleteOkBody createExchangeDeleteOkBody(
+ )
+ {
+ return new ExchangeDeleteOkBodyImpl(
+ );
+ }
+
+ public ExchangeBoundBody createExchangeBoundBody(
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString queue
+ )
+ {
+ return new ExchangeBoundBodyImpl(
+ exchange,
+ routingKey,
+ queue
+ );
+ }
+
+ public ExchangeBoundOkBody createExchangeBoundOkBody(
+ final int replyCode,
+ final AMQShortString replyText
+ )
+ {
+ return new ExchangeBoundOkBodyImpl(
+ replyCode,
+ replyText
+ );
+ }
+
+
+
+
+ public QueueDeclareBody createQueueDeclareBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean passive,
+ final boolean durable,
+ final boolean exclusive,
+ final boolean autoDelete,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueDeclareBodyImpl(
+ ticket,
+ queue,
+ passive,
+ durable,
+ exclusive,
+ autoDelete,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueDeclareOkBody createQueueDeclareOkBody(
+ final AMQShortString queue,
+ final long messageCount,
+ final long consumerCount
+ )
+ {
+ return new QueueDeclareOkBodyImpl(
+ queue,
+ messageCount,
+ consumerCount
+ );
+ }
+
+ public QueueBindBody createQueueBindBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new QueueBindBodyImpl(
+ ticket,
+ queue,
+ exchange,
+ routingKey,
+ nowait,
+ arguments
+ );
+ }
+
+ public QueueBindOkBody createQueueBindOkBody(
+ )
+ {
+ return new QueueBindOkBodyImpl(
+ );
+ }
+
+ public QueuePurgeBody createQueuePurgeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean nowait
+ )
+ {
+ return new QueuePurgeBodyImpl(
+ ticket,
+ queue,
+ nowait
+ );
+ }
+
+ public QueuePurgeOkBody createQueuePurgeOkBody(
+ final long messageCount
+ )
+ {
+ return new QueuePurgeOkBodyImpl(
+ messageCount
+ );
+ }
+
+ public QueueDeleteBody createQueueDeleteBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean ifUnused,
+ final boolean ifEmpty,
+ final boolean nowait
+ )
+ {
+ return new QueueDeleteBodyImpl(
+ ticket,
+ queue,
+ ifUnused,
+ ifEmpty,
+ nowait
+ );
+ }
+
+ public QueueDeleteOkBody createQueueDeleteOkBody(
+ final long messageCount
+ )
+ {
+ return new QueueDeleteOkBodyImpl(
+ messageCount
+ );
+ }
+
+
+
+
+ public BasicQosBody createBasicQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new BasicQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public BasicQosOkBody createBasicQosOkBody(
+ )
+ {
+ return new BasicQosOkBodyImpl(
+ );
+ }
+
+ public BasicConsumeBody createBasicConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait,
+ final FieldTable arguments
+ )
+ {
+ return new BasicConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ noAck,
+ exclusive,
+ nowait,
+ arguments
+ );
+ }
+
+ public BasicConsumeOkBody createBasicConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicCancelBody createBasicCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new BasicCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public BasicCancelOkBody createBasicCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new BasicCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public BasicPublishBody createBasicPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ )
+ {
+ return new BasicPublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate
+ );
+ }
+
+ public BasicReturnBody createBasicReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicDeliverBody createBasicDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new BasicDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey
+ );
+ }
+
+ public BasicGetBody createBasicGetBody(
+ final int ticket,
+ final AMQShortString queue,
+ final boolean noAck
+ )
+ {
+ return new BasicGetBodyImpl(
+ ticket,
+ queue,
+ noAck
+ );
+ }
+
+ public BasicGetOkBody createBasicGetOkBody(
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final long messageCount
+ )
+ {
+ return new BasicGetOkBodyImpl(
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey,
+ messageCount
+ );
+ }
+
+ public BasicGetEmptyBody createBasicGetEmptyBody(
+ final AMQShortString clusterId
+ )
+ {
+ return new BasicGetEmptyBodyImpl(
+ clusterId
+ );
+ }
+
+ public BasicAckBody createBasicAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ )
+ {
+ return new BasicAckBodyImpl(
+ deliveryTag,
+ multiple
+ );
+ }
+
+ public BasicRejectBody createBasicRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ )
+ {
+ return new BasicRejectBodyImpl(
+ deliveryTag,
+ requeue
+ );
+ }
+
+ public BasicRecoverBody createBasicRecoverBody(
+ final boolean requeue
+ )
+ {
+ return new BasicRecoverBodyImpl(
+ requeue
+ );
+ }
+
+ public BasicRecoverOkBody createBasicRecoverOkBody(
+ )
+ {
+ return new BasicRecoverOkBodyImpl(
+ );
+ }
+
+
+
+
+ public FileQosBody createFileQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final boolean global
+ )
+ {
+ return new FileQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ global
+ );
+ }
+
+ public FileQosOkBody createFileQosOkBody(
+ )
+ {
+ return new FileQosOkBodyImpl(
+ );
+ }
+
+ public FileConsumeBody createFileConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean noAck,
+ final boolean exclusive,
+ final boolean nowait
+ )
+ {
+ return new FileConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ noAck,
+ exclusive,
+ nowait
+ );
+ }
+
+ public FileConsumeOkBody createFileConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new FileConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public FileCancelBody createFileCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new FileCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public FileCancelOkBody createFileCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new FileCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public FileOpenBody createFileOpenBody(
+ final AMQShortString identifier,
+ final long contentSize
+ )
+ {
+ return new FileOpenBodyImpl(
+ identifier,
+ contentSize
+ );
+ }
+
+ public FileOpenOkBody createFileOpenOkBody(
+ final long stagedSize
+ )
+ {
+ return new FileOpenOkBodyImpl(
+ stagedSize
+ );
+ }
+
+ public FileStageBody createFileStageBody(
+ )
+ {
+ return new FileStageBodyImpl(
+ );
+ }
+
+ public FilePublishBody createFilePublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate,
+ final AMQShortString identifier
+ )
+ {
+ return new FilePublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate,
+ identifier
+ );
+ }
+
+ public FileReturnBody createFileReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new FileReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public FileDeliverBody createFileDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final boolean redelivered,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final AMQShortString identifier
+ )
+ {
+ return new FileDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ redelivered,
+ exchange,
+ routingKey,
+ identifier
+ );
+ }
+
+ public FileAckBody createFileAckBody(
+ final long deliveryTag,
+ final boolean multiple
+ )
+ {
+ return new FileAckBodyImpl(
+ deliveryTag,
+ multiple
+ );
+ }
+
+ public FileRejectBody createFileRejectBody(
+ final long deliveryTag,
+ final boolean requeue
+ )
+ {
+ return new FileRejectBodyImpl(
+ deliveryTag,
+ requeue
+ );
+ }
+
+
+
+
+ public StreamQosBody createStreamQosBody(
+ final long prefetchSize,
+ final int prefetchCount,
+ final long consumeRate,
+ final boolean global
+ )
+ {
+ return new StreamQosBodyImpl(
+ prefetchSize,
+ prefetchCount,
+ consumeRate,
+ global
+ );
+ }
+
+ public StreamQosOkBody createStreamQosOkBody(
+ )
+ {
+ return new StreamQosOkBodyImpl(
+ );
+ }
+
+ public StreamConsumeBody createStreamConsumeBody(
+ final int ticket,
+ final AMQShortString queue,
+ final AMQShortString consumerTag,
+ final boolean noLocal,
+ final boolean exclusive,
+ final boolean nowait
+ )
+ {
+ return new StreamConsumeBodyImpl(
+ ticket,
+ queue,
+ consumerTag,
+ noLocal,
+ exclusive,
+ nowait
+ );
+ }
+
+ public StreamConsumeOkBody createStreamConsumeOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new StreamConsumeOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public StreamCancelBody createStreamCancelBody(
+ final AMQShortString consumerTag,
+ final boolean nowait
+ )
+ {
+ return new StreamCancelBodyImpl(
+ consumerTag,
+ nowait
+ );
+ }
+
+ public StreamCancelOkBody createStreamCancelOkBody(
+ final AMQShortString consumerTag
+ )
+ {
+ return new StreamCancelOkBodyImpl(
+ consumerTag
+ );
+ }
+
+ public StreamPublishBody createStreamPublishBody(
+ final int ticket,
+ final AMQShortString exchange,
+ final AMQShortString routingKey,
+ final boolean mandatory,
+ final boolean immediate
+ )
+ {
+ return new StreamPublishBodyImpl(
+ ticket,
+ exchange,
+ routingKey,
+ mandatory,
+ immediate
+ );
+ }
+
+ public StreamReturnBody createStreamReturnBody(
+ final int replyCode,
+ final AMQShortString replyText,
+ final AMQShortString exchange,
+ final AMQShortString routingKey
+ )
+ {
+ return new StreamReturnBodyImpl(
+ replyCode,
+ replyText,
+ exchange,
+ routingKey
+ );
+ }
+
+ public StreamDeliverBody createStreamDeliverBody(
+ final AMQShortString consumerTag,
+ final long deliveryTag,
+ final AMQShortString exchange,
+ final AMQShortString queue
+ )
+ {
+ return new StreamDeliverBodyImpl(
+ consumerTag,
+ deliveryTag,
+ exchange,
+ queue
+ );
+ }
+
+
+
+
+ public TxSelectBody createTxSelectBody(
+ )
+ {
+ return new TxSelectBodyImpl(
+ );
+ }
+
+ public TxSelectOkBody createTxSelectOkBody(
+ )
+ {
+ return new TxSelectOkBodyImpl(
+ );
+ }
+
+ public TxCommitBody createTxCommitBody(
+ )
+ {
+ return new TxCommitBodyImpl(
+ );
+ }
+
+ public TxCommitOkBody createTxCommitOkBody(
+ )
+ {
+ return new TxCommitOkBodyImpl(
+ );
+ }
+
+ public TxRollbackBody createTxRollbackBody(
+ )
+ {
+ return new TxRollbackBodyImpl(
+ );
+ }
+
+ public TxRollbackOkBody createTxRollbackOkBody(
+ )
+ {
+ return new TxRollbackOkBodyImpl(
+ );
+ }
+
+
+
+
+ public DtxSelectBody createDtxSelectBody(
+ )
+ {
+ return new DtxSelectBodyImpl(
+ );
+ }
+
+ public DtxSelectOkBody createDtxSelectOkBody(
+ )
+ {
+ return new DtxSelectOkBodyImpl(
+ );
+ }
+
+ public DtxStartBody createDtxStartBody(
+ final AMQShortString dtxIdentifier
+ )
+ {
+ return new DtxStartBodyImpl(
+ dtxIdentifier
+ );
+ }
+
+ public DtxStartOkBody createDtxStartOkBody(
+ )
+ {
+ return new DtxStartOkBodyImpl(
+ );
+ }
+
+
+
+
+ public TunnelRequestBody createTunnelRequestBody(
+ final FieldTable metaData
+ )
+ {
+ return new TunnelRequestBodyImpl(
+ metaData
+ );
+ }
+
+
+
+
+ public TestIntegerBody createTestIntegerBody(
+ final short integer1,
+ final int integer2,
+ final long integer3,
+ final long integer4,
+ final short operation
+ )
+ {
+ return new TestIntegerBodyImpl(
+ integer1,
+ integer2,
+ integer3,
+ integer4,
+ operation
+ );
+ }
+
+ public TestIntegerOkBody createTestIntegerOkBody(
+ final long result
+ )
+ {
+ return new TestIntegerOkBodyImpl(
+ result
+ );
+ }
+
+ public TestStringBody createTestStringBody(
+ final AMQShortString string1,
+ final byte[] string2,
+ final short operation
+ )
+ {
+ return new TestStringBodyImpl(
+ string1,
+ string2,
+ operation
+ );
+ }
+
+ public TestStringOkBody createTestStringOkBody(
+ final byte[] result
+ )
+ {
+ return new TestStringOkBodyImpl(
+ result
+ );
+ }
+
+ public TestTableBody createTestTableBody(
+ final FieldTable table,
+ final short integerOp,
+ final short stringOp
+ )
+ {
+ return new TestTableBodyImpl(
+ table,
+ integerOp,
+ stringOp
+ );
+ }
+
+ public TestTableOkBody createTestTableOkBody(
+ final long integerResult,
+ final byte[] stringResult
+ )
+ {
+ return new TestTableOkBodyImpl(
+ integerResult,
+ stringResult
+ );
+ }
+
+ public TestContentBody createTestContentBody(
+ )
+ {
+ return new TestContentBodyImpl(
+ );
+ }
+
+ public TestContentOkBody createTestContentOkBody(
+ final long contentChecksum
+ )
+ {
+ return new TestContentOkBodyImpl(
+ contentChecksum
+ );
+ }
+
+
+
+ public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
+ {
+ return _protocolVersionConverter;
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindBodyImpl.java
new file mode 100644
index 0000000000..b4acb6ae06
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindBodyImpl.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindBodyImpl extends AMQMethodBody_8_0 implements QueueBindBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueBindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueBindBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueBind(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindOkBodyImpl.java
new file mode 100644
index 0000000000..6a0b78db2d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueBindOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueBindOkBodyImpl extends AMQMethodBody_8_0 implements QueueBindOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueBindOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public QueueBindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public QueueBindOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueBindOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueBindOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareBodyImpl.java
new file mode 100644
index 0000000000..4e835bd12b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareBodyImpl.java
@@ -0,0 +1,207 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareBodyImpl extends AMQMethodBody_8_0 implements QueueDeclareBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [passive, durable, exclusive, autoDelete, nowait]
+ private final FieldTable _arguments; // [arguments]
+
+ // Constructor
+ public QueueDeclareBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ _arguments = readFieldTable( buffer );
+ }
+
+ public QueueDeclareBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean passive,
+ boolean durable,
+ boolean exclusive,
+ boolean autoDelete,
+ boolean nowait,
+ FieldTable arguments
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( passive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( durable )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+
+ if( autoDelete )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 3));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 4));
+ }
+
+ _bitfield0 = bitfield0;
+ _arguments = arguments;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getPassive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getDurable()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+ public final boolean getAutoDelete()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 3)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 4)) != 0;
+ }
+ public final FieldTable getArguments()
+ {
+ return _arguments;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _arguments );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ writeFieldTable( buffer, _arguments );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueDeclare(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "passive=" );
+ buf.append( getPassive() );
+ buf.append( ", " );
+ buf.append( "durable=" );
+ buf.append( getDurable() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "autoDelete=" );
+ buf.append( getAutoDelete() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append( ", " );
+ buf.append( "arguments=" );
+ buf.append( getArguments() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareOkBodyImpl.java
new file mode 100644
index 0000000000..09abf5865e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeclareOkBodyImpl.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeclareOkBodyImpl extends AMQMethodBody_8_0 implements QueueDeclareOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeclareOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final AMQShortString _queue; // [queue]
+ private final long _messageCount; // [messageCount]
+ private final long _consumerCount; // [consumerCount]
+
+ // Constructor
+ public QueueDeclareOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _queue = readAMQShortString( buffer );
+ _messageCount = readUnsignedInteger( buffer );
+ _consumerCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeclareOkBodyImpl(
+ AMQShortString queue,
+ long messageCount,
+ long consumerCount
+ )
+ {
+ _queue = queue;
+ _messageCount = messageCount;
+ _consumerCount = consumerCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+ public final long getConsumerCount()
+ {
+ return _consumerCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _queue );
+ writeUnsignedInteger( buffer, _messageCount );
+ writeUnsignedInteger( buffer, _consumerCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueDeclareOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeclareOkBodyImpl: ");
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append( ", " );
+ buf.append( "consumerCount=" );
+ buf.append( getConsumerCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteBodyImpl.java
new file mode 100644
index 0000000000..ada079c4c1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteBodyImpl extends AMQMethodBody_8_0 implements QueueDeleteBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [ifUnused, ifEmpty, nowait]
+
+ // Constructor
+ public QueueDeleteBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueueDeleteBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean ifUnused,
+ boolean ifEmpty,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( ifUnused )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( ifEmpty )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getIfUnused()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getIfEmpty()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueDelete(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "ifUnused=" );
+ buf.append( getIfUnused() );
+ buf.append( ", " );
+ buf.append( "ifEmpty=" );
+ buf.append( getIfEmpty() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteOkBodyImpl.java
new file mode 100644
index 0000000000..54eea482fa
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueueDeleteOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueueDeleteOkBodyImpl extends AMQMethodBody_8_0 implements QueueDeleteOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueueDeleteOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueueDeleteOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueueDeleteOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueueDeleteOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueueDeleteOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeBodyImpl.java
new file mode 100644
index 0000000000..ae4f9d3483
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeBodyImpl.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeBodyImpl extends AMQMethodBody_8_0 implements QueuePurgeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public QueuePurgeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public QueuePurgeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueuePurge(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeOkBodyImpl.java
new file mode 100644
index 0000000000..576e175044
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/QueuePurgeOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class QueuePurgeOkBodyImpl extends AMQMethodBody_8_0 implements QueuePurgeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new QueuePurgeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 50;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final long _messageCount; // [messageCount]
+
+ // Constructor
+ public QueuePurgeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _messageCount = readUnsignedInteger( buffer );
+ }
+
+ public QueuePurgeOkBodyImpl(
+ long messageCount
+ )
+ {
+ _messageCount = messageCount;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getMessageCount()
+ {
+ return _messageCount;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _messageCount );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchQueuePurgeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[QueuePurgeOkBodyImpl: ");
+ buf.append( "messageCount=" );
+ buf.append( getMessageCount() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ServerMethodDispatcher_8_0.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ServerMethodDispatcher_8_0.java
new file mode 100644
index 0000000000..5c8ad68cd0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ServerMethodDispatcher_8_0.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface ServerMethodDispatcher_8_0 extends ServerMethodDispatcher
+{
+
+ public boolean dispatchAccessRequest(AccessRequestBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException;
+ public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException;
+ public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException;
+ public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxSelect(DtxSelectBody body, int channelId) throws AMQException;
+ public boolean dispatchDtxStart(DtxStartBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchFileAck(FileAckBody body, int channelId) throws AMQException;
+ public boolean dispatchFileCancel(FileCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchFileConsume(FileConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException;
+ public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException;
+ public boolean dispatchFilePublish(FilePublishBody body, int channelId) throws AMQException;
+ public boolean dispatchFileQos(FileQosBody body, int channelId) throws AMQException;
+ public boolean dispatchFileReject(FileRejectBody body, int channelId) throws AMQException;
+ public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException;
+ public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException;
+ public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamCancel(StreamCancelBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamConsume(StreamConsumeBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamPublish(StreamPublishBody body, int channelId) throws AMQException;
+ public boolean dispatchStreamQos(StreamQosBody body, int channelId) throws AMQException;
+ public boolean dispatchTestContent(TestContentBody body, int channelId) throws AMQException;
+ public boolean dispatchTestContentOk(TestContentOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestInteger(TestIntegerBody body, int channelId) throws AMQException;
+ public boolean dispatchTestIntegerOk(TestIntegerOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestString(TestStringBody body, int channelId) throws AMQException;
+ public boolean dispatchTestStringOk(TestStringOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTestTable(TestTableBody body, int channelId) throws AMQException;
+ public boolean dispatchTestTableOk(TestTableOkBody body, int channelId) throws AMQException;
+ public boolean dispatchTunnelRequest(TunnelRequestBody body, int channelId) throws AMQException;
+ public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException;
+ public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException;
+ public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException;
+
+} \ No newline at end of file
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelBodyImpl.java
new file mode 100644
index 0000000000..80032c93da
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelBodyImpl.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamCancelBodyImpl extends AMQMethodBody_8_0 implements StreamCancelBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamCancelBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [nowait]
+
+ // Constructor
+ public StreamCancelBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamCancelBodyImpl(
+ AMQShortString consumerTag,
+ boolean nowait
+ )
+ {
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamCancel(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamCancelBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelOkBodyImpl.java
new file mode 100644
index 0000000000..f7d5f28269
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamCancelOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamCancelOkBodyImpl extends AMQMethodBody_8_0 implements StreamCancelOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamCancelOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public StreamCancelOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public StreamCancelOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamCancelOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamCancelOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeBodyImpl.java
new file mode 100644
index 0000000000..2e55068f1d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeBodyImpl.java
@@ -0,0 +1,180 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamConsumeBodyImpl extends AMQMethodBody_8_0 implements StreamConsumeBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamConsumeBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _queue; // [queue]
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final byte _bitfield0; // [noLocal, exclusive, nowait]
+
+ // Constructor
+ public StreamConsumeBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _queue = readAMQShortString( buffer );
+ _consumerTag = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamConsumeBodyImpl(
+ int ticket,
+ AMQShortString queue,
+ AMQShortString consumerTag,
+ boolean noLocal,
+ boolean exclusive,
+ boolean nowait
+ )
+ {
+ _ticket = ticket;
+ _queue = queue;
+ _consumerTag = consumerTag;
+ byte bitfield0 = (byte)0;
+ if( noLocal )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( exclusive )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+
+ if( nowait )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 2));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final boolean getNoLocal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getExclusive()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+ public final boolean getNowait()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 2)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _queue );
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _queue );
+ writeAMQShortString( buffer, _consumerTag );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamConsume(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamConsumeBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append( ", " );
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "noLocal=" );
+ buf.append( getNoLocal() );
+ buf.append( ", " );
+ buf.append( "exclusive=" );
+ buf.append( getExclusive() );
+ buf.append( ", " );
+ buf.append( "nowait=" );
+ buf.append( getNowait() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeOkBodyImpl.java
new file mode 100644
index 0000000000..052efc1fdd
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamConsumeOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamConsumeOkBodyImpl extends AMQMethodBody_8_0 implements StreamConsumeOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamConsumeOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+
+ // Constructor
+ public StreamConsumeOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ }
+
+ public StreamConsumeOkBodyImpl(
+ AMQShortString consumerTag
+ )
+ {
+ _consumerTag = consumerTag;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _consumerTag );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamConsumeOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamConsumeOkBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamDeliverBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamDeliverBodyImpl.java
new file mode 100644
index 0000000000..8bbde690a0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamDeliverBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamDeliverBodyImpl extends AMQMethodBody_8_0 implements StreamDeliverBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamDeliverBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 60;
+
+ // Fields declared in specification
+ private final AMQShortString _consumerTag; // [consumerTag]
+ private final long _deliveryTag; // [deliveryTag]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _queue; // [queue]
+
+ // Constructor
+ public StreamDeliverBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _consumerTag = readAMQShortString( buffer );
+ _deliveryTag = readLong( buffer );
+ _exchange = readAMQShortString( buffer );
+ _queue = readAMQShortString( buffer );
+ }
+
+ public StreamDeliverBodyImpl(
+ AMQShortString consumerTag,
+ long deliveryTag,
+ AMQShortString exchange,
+ AMQShortString queue
+ )
+ {
+ _consumerTag = consumerTag;
+ _deliveryTag = deliveryTag;
+ _exchange = exchange;
+ _queue = queue;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getConsumerTag()
+ {
+ return _consumerTag;
+ }
+ public final long getDeliveryTag()
+ {
+ return _deliveryTag;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getQueue()
+ {
+ return _queue;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _consumerTag );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _queue );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _consumerTag );
+ writeLong( buffer, _deliveryTag );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _queue );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamDeliver(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamDeliverBodyImpl: ");
+ buf.append( "consumerTag=" );
+ buf.append( getConsumerTag() );
+ buf.append( ", " );
+ buf.append( "deliveryTag=" );
+ buf.append( getDeliveryTag() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "queue=" );
+ buf.append( getQueue() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamPublishBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamPublishBodyImpl.java
new file mode 100644
index 0000000000..6977e839ff
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamPublishBodyImpl.java
@@ -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.
+ *
+ */
+
+/*
+ * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamPublishBodyImpl extends AMQMethodBody_8_0 implements StreamPublishBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamPublishBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+ private final int _ticket; // [ticket]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+ private final byte _bitfield0; // [mandatory, immediate]
+
+ // Constructor
+ public StreamPublishBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _ticket = readUnsignedShort( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamPublishBodyImpl(
+ int ticket,
+ AMQShortString exchange,
+ AMQShortString routingKey,
+ boolean mandatory,
+ boolean immediate
+ )
+ {
+ _ticket = ticket;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ byte bitfield0 = (byte)0;
+ if( mandatory )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+
+ if( immediate )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 1));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getTicket()
+ {
+ return _ticket;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ public final boolean getMandatory()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+ public final boolean getImmediate()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 1)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 3;
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _ticket );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamPublish(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamPublishBodyImpl: ");
+ buf.append( "ticket=" );
+ buf.append( getTicket() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append( ", " );
+ buf.append( "mandatory=" );
+ buf.append( getMandatory() );
+ buf.append( ", " );
+ buf.append( "immediate=" );
+ buf.append( getImmediate() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosBodyImpl.java
new file mode 100644
index 0000000000..50fe23c170
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosBodyImpl.java
@@ -0,0 +1,152 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamQosBodyImpl extends AMQMethodBody_8_0 implements StreamQosBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamQosBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final long _prefetchSize; // [prefetchSize]
+ private final int _prefetchCount; // [prefetchCount]
+ private final long _consumeRate; // [consumeRate]
+ private final byte _bitfield0; // [global]
+
+ // Constructor
+ public StreamQosBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _prefetchSize = readUnsignedInteger( buffer );
+ _prefetchCount = readUnsignedShort( buffer );
+ _consumeRate = readUnsignedInteger( buffer );
+ _bitfield0 = readBitfield( buffer );
+ }
+
+ public StreamQosBodyImpl(
+ long prefetchSize,
+ int prefetchCount,
+ long consumeRate,
+ boolean global
+ )
+ {
+ _prefetchSize = prefetchSize;
+ _prefetchCount = prefetchCount;
+ _consumeRate = consumeRate;
+ byte bitfield0 = (byte)0;
+ if( global )
+ {
+ bitfield0 = (byte) (((int) bitfield0) | (1 << 0));
+ }
+ _bitfield0 = bitfield0;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getPrefetchSize()
+ {
+ return _prefetchSize;
+ }
+ public final int getPrefetchCount()
+ {
+ return _prefetchCount;
+ }
+ public final long getConsumeRate()
+ {
+ return _consumeRate;
+ }
+ public final boolean getGlobal()
+ {
+ return (((int)(_bitfield0)) & ( 1 << 0)) != 0;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 11;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _prefetchSize );
+ writeUnsignedShort( buffer, _prefetchCount );
+ writeUnsignedInteger( buffer, _consumeRate );
+ writeBitfield( buffer, _bitfield0 );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamQos(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamQosBodyImpl: ");
+ buf.append( "prefetchSize=" );
+ buf.append( getPrefetchSize() );
+ buf.append( ", " );
+ buf.append( "prefetchCount=" );
+ buf.append( getPrefetchCount() );
+ buf.append( ", " );
+ buf.append( "consumeRate=" );
+ buf.append( getConsumeRate() );
+ buf.append( ", " );
+ buf.append( "global=" );
+ buf.append( getGlobal() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosOkBodyImpl.java
new file mode 100644
index 0000000000..6f8977e4eb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamQosOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamQosOkBodyImpl extends AMQMethodBody_8_0 implements StreamQosOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamQosOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public StreamQosOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public StreamQosOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamQosOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamQosOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamReturnBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamReturnBodyImpl.java
new file mode 100644
index 0000000000..7b79956958
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/StreamReturnBodyImpl.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class StreamReturnBodyImpl extends AMQMethodBody_8_0 implements StreamReturnBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new StreamReturnBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 80;
+ public static final int METHOD_ID = 50;
+
+ // Fields declared in specification
+ private final int _replyCode; // [replyCode]
+ private final AMQShortString _replyText; // [replyText]
+ private final AMQShortString _exchange; // [exchange]
+ private final AMQShortString _routingKey; // [routingKey]
+
+ // Constructor
+ public StreamReturnBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _replyCode = readUnsignedShort( buffer );
+ _replyText = readAMQShortString( buffer );
+ _exchange = readAMQShortString( buffer );
+ _routingKey = readAMQShortString( buffer );
+ }
+
+ public StreamReturnBodyImpl(
+ int replyCode,
+ AMQShortString replyText,
+ AMQShortString exchange,
+ AMQShortString routingKey
+ )
+ {
+ _replyCode = replyCode;
+ _replyText = replyText;
+ _exchange = exchange;
+ _routingKey = routingKey;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getReplyCode()
+ {
+ return _replyCode;
+ }
+ public final AMQShortString getReplyText()
+ {
+ return _replyText;
+ }
+ public final AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+ public final AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _replyText );
+ size += getSizeOf( _exchange );
+ size += getSizeOf( _routingKey );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _replyCode );
+ writeAMQShortString( buffer, _replyText );
+ writeAMQShortString( buffer, _exchange );
+ writeAMQShortString( buffer, _routingKey );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchStreamReturn(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[StreamReturnBodyImpl: ");
+ buf.append( "replyCode=" );
+ buf.append( getReplyCode() );
+ buf.append( ", " );
+ buf.append( "replyText=" );
+ buf.append( getReplyText() );
+ buf.append( ", " );
+ buf.append( "exchange=" );
+ buf.append( getExchange() );
+ buf.append( ", " );
+ buf.append( "routingKey=" );
+ buf.append( getRoutingKey() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentBodyImpl.java
new file mode 100644
index 0000000000..832ee12e2c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestContentBodyImpl extends AMQMethodBody_8_0 implements TestContentBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestContentBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 40;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TestContentBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TestContentBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestContent(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestContentBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentOkBodyImpl.java
new file mode 100644
index 0000000000..32c9e92c2f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestContentOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestContentOkBodyImpl extends AMQMethodBody_8_0 implements TestContentOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestContentOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 41;
+
+ // Fields declared in specification
+ private final long _contentChecksum; // [contentChecksum]
+
+ // Constructor
+ public TestContentOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _contentChecksum = readUnsignedInteger( buffer );
+ }
+
+ public TestContentOkBodyImpl(
+ long contentChecksum
+ )
+ {
+ _contentChecksum = contentChecksum;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getContentChecksum()
+ {
+ return _contentChecksum;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 4;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedInteger( buffer, _contentChecksum );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestContentOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestContentOkBodyImpl: ");
+ buf.append( "contentChecksum=" );
+ buf.append( getContentChecksum() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerBodyImpl.java
new file mode 100644
index 0000000000..8d01d2d4d8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerBodyImpl.java
@@ -0,0 +1,159 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestIntegerBodyImpl extends AMQMethodBody_8_0 implements TestIntegerBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestIntegerBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final short _integer1; // [integer1]
+ private final int _integer2; // [integer2]
+ private final long _integer3; // [integer3]
+ private final long _integer4; // [integer4]
+ private final short _operation; // [operation]
+
+ // Constructor
+ public TestIntegerBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _integer1 = readUnsignedByte( buffer );
+ _integer2 = readUnsignedShort( buffer );
+ _integer3 = readUnsignedInteger( buffer );
+ _integer4 = readLong( buffer );
+ _operation = readUnsignedByte( buffer );
+ }
+
+ public TestIntegerBodyImpl(
+ short integer1,
+ int integer2,
+ long integer3,
+ long integer4,
+ short operation
+ )
+ {
+ _integer1 = integer1;
+ _integer2 = integer2;
+ _integer3 = integer3;
+ _integer4 = integer4;
+ _operation = operation;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final short getInteger1()
+ {
+ return _integer1;
+ }
+ public final int getInteger2()
+ {
+ return _integer2;
+ }
+ public final long getInteger3()
+ {
+ return _integer3;
+ }
+ public final long getInteger4()
+ {
+ return _integer4;
+ }
+ public final short getOperation()
+ {
+ return _operation;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 16;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedByte( buffer, _integer1 );
+ writeUnsignedShort( buffer, _integer2 );
+ writeUnsignedInteger( buffer, _integer3 );
+ writeLong( buffer, _integer4 );
+ writeUnsignedByte( buffer, _operation );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestInteger(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestIntegerBodyImpl: ");
+ buf.append( "integer1=" );
+ buf.append( getInteger1() );
+ buf.append( ", " );
+ buf.append( "integer2=" );
+ buf.append( getInteger2() );
+ buf.append( ", " );
+ buf.append( "integer3=" );
+ buf.append( getInteger3() );
+ buf.append( ", " );
+ buf.append( "integer4=" );
+ buf.append( getInteger4() );
+ buf.append( ", " );
+ buf.append( "operation=" );
+ buf.append( getOperation() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerOkBodyImpl.java
new file mode 100644
index 0000000000..b46b6c74d4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestIntegerOkBodyImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestIntegerOkBodyImpl extends AMQMethodBody_8_0 implements TestIntegerOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestIntegerOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+ private final long _result; // [result]
+
+ // Constructor
+ public TestIntegerOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _result = readLong( buffer );
+ }
+
+ public TestIntegerOkBodyImpl(
+ long result
+ )
+ {
+ _result = result;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getResult()
+ {
+ return _result;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _result );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestIntegerOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestIntegerOkBodyImpl: ");
+ buf.append( "result=" );
+ buf.append( getResult() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringBodyImpl.java
new file mode 100644
index 0000000000..8bdb72d58a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringBodyImpl.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestStringBodyImpl extends AMQMethodBody_8_0 implements TestStringBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestStringBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+ private final AMQShortString _string1; // [string1]
+ private final byte[] _string2; // [string2]
+ private final short _operation; // [operation]
+
+ // Constructor
+ public TestStringBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _string1 = readAMQShortString( buffer );
+ _string2 = readBytes( buffer );
+ _operation = readUnsignedByte( buffer );
+ }
+
+ public TestStringBodyImpl(
+ AMQShortString string1,
+ byte[] string2,
+ short operation
+ )
+ {
+ _string1 = string1;
+ _string2 = string2;
+ _operation = operation;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final AMQShortString getString1()
+ {
+ return _string1;
+ }
+ public final byte[] getString2()
+ {
+ return _string2;
+ }
+ public final short getOperation()
+ {
+ return _operation;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 1;
+ size += getSizeOf( _string1 );
+ size += getSizeOf( _string2 );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeAMQShortString( buffer, _string1 );
+ writeBytes( buffer, _string2 );
+ writeUnsignedByte( buffer, _operation );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestString(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestStringBodyImpl: ");
+ buf.append( "string1=" );
+ buf.append( getString1() );
+ buf.append( ", " );
+ buf.append( "string2=" );
+ buf.append( getString2() == null ? "null" : java.util.Arrays.toString( getString2() ) );
+ buf.append( ", " );
+ buf.append( "operation=" );
+ buf.append( getOperation() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringOkBodyImpl.java
new file mode 100644
index 0000000000..be927e13ea
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestStringOkBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestStringOkBodyImpl extends AMQMethodBody_8_0 implements TestStringOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestStringOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+ private final byte[] _result; // [result]
+
+ // Constructor
+ public TestStringOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _result = readBytes( buffer );
+ }
+
+ public TestStringOkBodyImpl(
+ byte[] result
+ )
+ {
+ _result = result;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final byte[] getResult()
+ {
+ return _result;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _result );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeBytes( buffer, _result );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestStringOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestStringOkBodyImpl: ");
+ buf.append( "result=" );
+ buf.append( getResult() == null ? "null" : java.util.Arrays.toString( getResult() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableBodyImpl.java
new file mode 100644
index 0000000000..5c4b9e8d33
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableBodyImpl.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestTableBodyImpl extends AMQMethodBody_8_0 implements TestTableBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestTableBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+ private final FieldTable _table; // [table]
+ private final short _integerOp; // [integerOp]
+ private final short _stringOp; // [stringOp]
+
+ // Constructor
+ public TestTableBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _table = readFieldTable( buffer );
+ _integerOp = readUnsignedByte( buffer );
+ _stringOp = readUnsignedByte( buffer );
+ }
+
+ public TestTableBodyImpl(
+ FieldTable table,
+ short integerOp,
+ short stringOp
+ )
+ {
+ _table = table;
+ _integerOp = integerOp;
+ _stringOp = stringOp;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getTable()
+ {
+ return _table;
+ }
+ public final short getIntegerOp()
+ {
+ return _integerOp;
+ }
+ public final short getStringOp()
+ {
+ return _stringOp;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 2;
+ size += getSizeOf( _table );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _table );
+ writeUnsignedByte( buffer, _integerOp );
+ writeUnsignedByte( buffer, _stringOp );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestTable(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestTableBodyImpl: ");
+ buf.append( "table=" );
+ buf.append( getTable() );
+ buf.append( ", " );
+ buf.append( "integerOp=" );
+ buf.append( getIntegerOp() );
+ buf.append( ", " );
+ buf.append( "stringOp=" );
+ buf.append( getStringOp() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableOkBodyImpl.java
new file mode 100644
index 0000000000..ea16a3b157
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TestTableOkBodyImpl.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TestTableOkBodyImpl extends AMQMethodBody_8_0 implements TestTableOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TestTableOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 120;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+ private final long _integerResult; // [integerResult]
+ private final byte[] _stringResult; // [stringResult]
+
+ // Constructor
+ public TestTableOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _integerResult = readLong( buffer );
+ _stringResult = readBytes( buffer );
+ }
+
+ public TestTableOkBodyImpl(
+ long integerResult,
+ byte[] stringResult
+ )
+ {
+ _integerResult = integerResult;
+ _stringResult = stringResult;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final long getIntegerResult()
+ {
+ return _integerResult;
+ }
+ public final byte[] getStringResult()
+ {
+ return _stringResult;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ size += getSizeOf( _stringResult );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeLong( buffer, _integerResult );
+ writeBytes( buffer, _stringResult );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTestTableOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TestTableOkBodyImpl: ");
+ buf.append( "integerResult=" );
+ buf.append( getIntegerResult() );
+ buf.append( ", " );
+ buf.append( "stringResult=" );
+ buf.append( getStringResult() == null ? "null" : java.util.Arrays.toString( getStringResult() ) );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TunnelRequestBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TunnelRequestBodyImpl.java
new file mode 100644
index 0000000000..5bb0e64ec8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TunnelRequestBodyImpl.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TunnelRequestBodyImpl extends AMQMethodBody_8_0 implements TunnelRequestBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TunnelRequestBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 110;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+ private final FieldTable _metaData; // [metaData]
+
+ // Constructor
+ public TunnelRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _metaData = readFieldTable( buffer );
+ }
+
+ public TunnelRequestBodyImpl(
+ FieldTable metaData
+ )
+ {
+ _metaData = metaData;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final FieldTable getMetaData()
+ {
+ return _metaData;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ size += getSizeOf( _metaData );
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeFieldTable( buffer, _metaData );
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTunnelRequest(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TunnelRequestBodyImpl: ");
+ buf.append( "metaData=" );
+ buf.append( getMetaData() );
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitBodyImpl.java
new file mode 100644
index 0000000000..096c401c02
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitBodyImpl extends AMQMethodBody_8_0 implements TxCommitBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 20;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxCommit(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitOkBodyImpl.java
new file mode 100644
index 0000000000..76274be34a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxCommitOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxCommitOkBodyImpl extends AMQMethodBody_8_0 implements TxCommitOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxCommitOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 21;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxCommitOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxCommitOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxCommitOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxCommitOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackBodyImpl.java
new file mode 100644
index 0000000000..f68f881861
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackBodyImpl extends AMQMethodBody_8_0 implements TxRollbackBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 30;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxRollback(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackOkBodyImpl.java
new file mode 100644
index 0000000000..7ec3d8b83b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxRollbackOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxRollbackOkBodyImpl extends AMQMethodBody_8_0 implements TxRollbackOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxRollbackOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 31;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxRollbackOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxRollbackOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxRollbackOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxRollbackOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectBodyImpl.java
new file mode 100644
index 0000000000..69f4dd2ec5
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectBodyImpl extends AMQMethodBody_8_0 implements TxSelectBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 10;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxSelect(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectOkBodyImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectOkBodyImpl.java
new file mode 100644
index 0000000000..fc1279c908
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/TxSelectOkBodyImpl.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * Supported AMQP version:
+ * 8-0
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.codec.MarkableDataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class TxSelectOkBodyImpl extends AMQMethodBody_8_0 implements TxSelectOkBody
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException
+ {
+ return new TxSelectOkBodyImpl(in);
+ }
+ };
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static final int CLASS_ID = 90;
+ public static final int METHOD_ID = 11;
+
+ // Fields declared in specification
+
+ // Constructor
+ public TxSelectOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ }
+
+ public TxSelectOkBodyImpl(
+ )
+ {
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+ protected int getBodySize()
+ {
+ int size = 0;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return ((MethodDispatcher_8_0)dispatcher).dispatchTxSelectOk(this, channelId);
+ }
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[TxSelectOkBodyImpl: ");
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Acquired.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Acquired.java
new file mode 100644
index 0000000000..28e6e4c4e6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Acquired.java
@@ -0,0 +1,141 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class Acquired extends Struct {
+
+ public static final int TYPE = 1028;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet transfers;
+
+
+ public Acquired() {}
+
+
+ public Acquired(RangeSet transfers) {
+ if(transfers != null) {
+ setTransfers(transfers);
+ }
+
+ }
+
+
+
+
+ public final boolean hasTransfers() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final Acquired clearTransfers() {
+ packing_flags &= ~256;
+ this.transfers = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getTransfers() {
+ return transfers;
+ }
+
+ public final Acquired setTransfers(RangeSet value) {
+ this.transfers = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final Acquired transfers(RangeSet value) {
+ return setTransfers(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.transfers);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.transfers = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("transfers", getTransfers());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionClose.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionClose.java
new file mode 100644
index 0000000000..8888f354d8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionClose.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionClose extends Method {
+
+ public static final int TYPE = 267;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private ConnectionCloseCode replyCode;
+ private String replyText;
+
+
+ public ConnectionClose() {}
+
+
+ public ConnectionClose(ConnectionCloseCode replyCode, String replyText, Option ... _options) {
+ if(replyCode != null) {
+ setReplyCode(replyCode);
+ }
+ if(replyText != null) {
+ setReplyText(replyText);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionClose(context, this);
+ }
+
+
+ public final boolean hasReplyCode() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionClose clearReplyCode() {
+ packing_flags &= ~256;
+ this.replyCode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionCloseCode getReplyCode() {
+ return replyCode;
+ }
+
+ public final ConnectionClose setReplyCode(ConnectionCloseCode value) {
+ this.replyCode = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionClose replyCode(ConnectionCloseCode value) {
+ return setReplyCode(value);
+ }
+
+ public final boolean hasReplyText() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionClose clearReplyText() {
+ packing_flags &= ~512;
+ this.replyText = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getReplyText() {
+ return replyText;
+ }
+
+ public final ConnectionClose setReplyText(String value) {
+ this.replyText = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionClose replyText(String value) {
+ return setReplyText(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.replyCode.getValue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.replyText);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.replyCode = ConnectionCloseCode.get(dec.readUint16());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.replyText = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("replyCode", getReplyCode());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("replyText", getReplyText());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseCode.java
new file mode 100644
index 0000000000..18c5b257d2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseCode.java
@@ -0,0 +1,54 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum ConnectionCloseCode {
+
+ NORMAL((int) 200),
+ CONNECTION_FORCED((int) 320),
+ INVALID_PATH((int) 402),
+ FRAMING_ERROR((int) 501);
+
+ private final int value;
+
+ ConnectionCloseCode(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static ConnectionCloseCode get(int value)
+ {
+ switch (value)
+ {
+ case (int) 200: return NORMAL;
+ case (int) 320: return CONNECTION_FORCED;
+ case (int) 402: return INVALID_PATH;
+ case (int) 501: return FRAMING_ERROR;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseOk.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseOk.java
new file mode 100644
index 0000000000..b954ac2162
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionCloseOk.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionCloseOk extends Method {
+
+ public static final int TYPE = 268;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public ConnectionCloseOk(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionCloseOk(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionHeartbeat.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionHeartbeat.java
new file mode 100644
index 0000000000..190bca0eaa
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionHeartbeat.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionHeartbeat extends Method {
+
+ public static final int TYPE = 266;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public ConnectionHeartbeat(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionHeartbeat(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionInvoker.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionInvoker.java
new file mode 100644
index 0000000000..29045e17de
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionInvoker.java
@@ -0,0 +1,78 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.Map;
+
+public abstract class ConnectionInvoker {
+
+ final void connectionStart(Map<String,Object> serverProperties, java.util.List<Object> mechanisms, java.util.List<Object> locales, Option ... _options) {
+ invoke(new ConnectionStart(serverProperties, mechanisms, locales, _options));
+ }
+
+ final void connectionStartOk(Map<String,Object> clientProperties, String mechanism, byte[] response, String locale, Option ... _options) {
+ invoke(new ConnectionStartOk(clientProperties, mechanism, response, locale, _options));
+ }
+
+ final void connectionSecure(byte[] challenge, Option ... _options) {
+ invoke(new ConnectionSecure(challenge, _options));
+ }
+
+ final void connectionSecureOk(byte[] response, Option ... _options) {
+ invoke(new ConnectionSecureOk(response, _options));
+ }
+
+ final void connectionTune(int channelMax, int maxFrameSize, int heartbeatMin, int heartbeatMax, Option ... _options) {
+ invoke(new ConnectionTune(channelMax, maxFrameSize, heartbeatMin, heartbeatMax, _options));
+ }
+
+ final void connectionTuneOk(int channelMax, int maxFrameSize, int heartbeat, Option ... _options) {
+ invoke(new ConnectionTuneOk(channelMax, maxFrameSize, heartbeat, _options));
+ }
+
+ final void connectionOpen(String virtualHost, java.util.List<Object> capabilities, Option ... _options) {
+ invoke(new ConnectionOpen(virtualHost, capabilities, _options));
+ }
+
+ final void connectionOpenOk(java.util.List<Object> knownHosts, Option ... _options) {
+ invoke(new ConnectionOpenOk(knownHosts, _options));
+ }
+
+ final void connectionRedirect(String host, java.util.List<Object> knownHosts, Option ... _options) {
+ invoke(new ConnectionRedirect(host, knownHosts, _options));
+ }
+
+ final void connectionHeartbeat(Option ... _options) {
+ invoke(new ConnectionHeartbeat(_options));
+ }
+
+ final void connectionClose(ConnectionCloseCode replyCode, String replyText, Option ... _options) {
+ invoke(new ConnectionClose(replyCode, replyText, _options));
+ }
+
+ final void connectionCloseOk(Option ... _options) {
+ invoke(new ConnectionCloseOk(_options));
+ }
+
+ protected abstract void invoke(Method method);
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpen.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpen.java
new file mode 100644
index 0000000000..b17a3810f2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpen.java
@@ -0,0 +1,235 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionOpen extends Method {
+
+ public static final int TYPE = 263;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private String virtualHost;
+ private java.util.List<Object> capabilities;
+
+
+ public ConnectionOpen() {}
+
+
+ public ConnectionOpen(String virtualHost, java.util.List<Object> capabilities, Option ... _options) {
+ if(virtualHost != null) {
+ setVirtualHost(virtualHost);
+ }
+ if(capabilities != null) {
+ setCapabilities(capabilities);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case INSIST: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionOpen(context, this);
+ }
+
+
+ public final boolean hasVirtualHost() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionOpen clearVirtualHost() {
+ packing_flags &= ~256;
+ this.virtualHost = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getVirtualHost() {
+ return virtualHost;
+ }
+
+ public final ConnectionOpen setVirtualHost(String value) {
+ this.virtualHost = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionOpen virtualHost(String value) {
+ return setVirtualHost(value);
+ }
+
+ public final boolean hasCapabilities() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionOpen clearCapabilities() {
+ packing_flags &= ~512;
+ this.capabilities = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getCapabilities() {
+ return capabilities;
+ }
+
+ public final ConnectionOpen setCapabilities(java.util.List<Object> value) {
+ this.capabilities = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionOpen capabilities(java.util.List<Object> value) {
+ return setCapabilities(value);
+ }
+
+ public final boolean hasInsist() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionOpen clearInsist() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getInsist() {
+ return hasInsist();
+ }
+
+ public final ConnectionOpen setInsist(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionOpen insist(boolean value) {
+ return setInsist(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.virtualHost);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.capabilities);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.virtualHost = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.capabilities = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("virtualHost", getVirtualHost());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("capabilities", getCapabilities());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("insist", getInsist());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpenOk.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpenOk.java
new file mode 100644
index 0000000000..0cbbba51bb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionOpenOk.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionOpenOk extends Method {
+
+ public static final int TYPE = 264;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private java.util.List<Object> knownHosts;
+
+
+ public ConnectionOpenOk() {}
+
+
+ public ConnectionOpenOk(java.util.List<Object> knownHosts, Option ... _options) {
+ if(knownHosts != null) {
+ setKnownHosts(knownHosts);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionOpenOk(context, this);
+ }
+
+
+ public final boolean hasKnownHosts() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionOpenOk clearKnownHosts() {
+ packing_flags &= ~256;
+ this.knownHosts = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getKnownHosts() {
+ return knownHosts;
+ }
+
+ public final ConnectionOpenOk setKnownHosts(java.util.List<Object> value) {
+ this.knownHosts = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionOpenOk knownHosts(java.util.List<Object> value) {
+ return setKnownHosts(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeArray(this.knownHosts);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.knownHosts = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("knownHosts", getKnownHosts());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionRedirect.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionRedirect.java
new file mode 100644
index 0000000000..c84758c54c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionRedirect.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionRedirect extends Method {
+
+ public static final int TYPE = 265;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private String host;
+ private java.util.List<Object> knownHosts;
+
+
+ public ConnectionRedirect() {}
+
+
+ public ConnectionRedirect(String host, java.util.List<Object> knownHosts, Option ... _options) {
+ if(host != null) {
+ setHost(host);
+ }
+ if(knownHosts != null) {
+ setKnownHosts(knownHosts);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionRedirect(context, this);
+ }
+
+
+ public final boolean hasHost() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionRedirect clearHost() {
+ packing_flags &= ~256;
+ this.host = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getHost() {
+ return host;
+ }
+
+ public final ConnectionRedirect setHost(String value) {
+ this.host = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionRedirect host(String value) {
+ return setHost(value);
+ }
+
+ public final boolean hasKnownHosts() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionRedirect clearKnownHosts() {
+ packing_flags &= ~512;
+ this.knownHosts = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getKnownHosts() {
+ return knownHosts;
+ }
+
+ public final ConnectionRedirect setKnownHosts(java.util.List<Object> value) {
+ this.knownHosts = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionRedirect knownHosts(java.util.List<Object> value) {
+ return setKnownHosts(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr16(this.host);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.knownHosts);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.host = dec.readStr16();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.knownHosts = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("host", getHost());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("knownHosts", getKnownHosts());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecure.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecure.java
new file mode 100644
index 0000000000..44fbac2b19
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecure.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionSecure extends Method {
+
+ public static final int TYPE = 259;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private byte[] challenge;
+
+
+ public ConnectionSecure() {}
+
+
+ public ConnectionSecure(byte[] challenge, Option ... _options) {
+ if(challenge != null) {
+ setChallenge(challenge);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionSecure(context, this);
+ }
+
+
+ public final boolean hasChallenge() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionSecure clearChallenge() {
+ packing_flags &= ~256;
+ this.challenge = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getChallenge() {
+ return challenge;
+ }
+
+ public final ConnectionSecure setChallenge(byte[] value) {
+ this.challenge = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionSecure challenge(byte[] value) {
+ return setChallenge(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin32(this.challenge);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.challenge = dec.readVbin32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("challenge", getChallenge());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecureOk.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecureOk.java
new file mode 100644
index 0000000000..2a2b7df83a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSecureOk.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionSecureOk extends Method {
+
+ public static final int TYPE = 260;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private byte[] response;
+
+
+ public ConnectionSecureOk() {}
+
+
+ public ConnectionSecureOk(byte[] response, Option ... _options) {
+ if(response != null) {
+ setResponse(response);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionSecureOk(context, this);
+ }
+
+
+ public final boolean hasResponse() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionSecureOk clearResponse() {
+ packing_flags &= ~256;
+ this.response = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getResponse() {
+ return response;
+ }
+
+ public final ConnectionSecureOk setResponse(byte[] value) {
+ this.response = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionSecureOk response(byte[] value) {
+ return setResponse(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin32(this.response);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.response = dec.readVbin32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("response", getResponse());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStart.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStart.java
new file mode 100644
index 0000000000..6193122c56
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStart.java
@@ -0,0 +1,238 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionStart extends Method {
+
+ public static final int TYPE = 257;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private Map<String,Object> serverProperties;
+ private java.util.List<Object> mechanisms;
+ private java.util.List<Object> locales;
+
+
+ public ConnectionStart() {}
+
+
+ public ConnectionStart(Map<String,Object> serverProperties, java.util.List<Object> mechanisms, java.util.List<Object> locales, Option ... _options) {
+ if(serverProperties != null) {
+ setServerProperties(serverProperties);
+ }
+ if(mechanisms != null) {
+ setMechanisms(mechanisms);
+ }
+ if(locales != null) {
+ setLocales(locales);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionStart(context, this);
+ }
+
+
+ public final boolean hasServerProperties() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionStart clearServerProperties() {
+ packing_flags &= ~256;
+ this.serverProperties = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getServerProperties() {
+ return serverProperties;
+ }
+
+ public final ConnectionStart setServerProperties(Map<String,Object> value) {
+ this.serverProperties = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStart serverProperties(Map<String,Object> value) {
+ return setServerProperties(value);
+ }
+
+ public final boolean hasMechanisms() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionStart clearMechanisms() {
+ packing_flags &= ~512;
+ this.mechanisms = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getMechanisms() {
+ return mechanisms;
+ }
+
+ public final ConnectionStart setMechanisms(java.util.List<Object> value) {
+ this.mechanisms = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStart mechanisms(java.util.List<Object> value) {
+ return setMechanisms(value);
+ }
+
+ public final boolean hasLocales() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionStart clearLocales() {
+ packing_flags &= ~1024;
+ this.locales = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getLocales() {
+ return locales;
+ }
+
+ public final ConnectionStart setLocales(java.util.List<Object> value) {
+ this.locales = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStart locales(java.util.List<Object> value) {
+ return setLocales(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeMap(this.serverProperties);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.mechanisms);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeArray(this.locales);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.serverProperties = dec.readMap();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.mechanisms = dec.readArray();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.locales = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("serverProperties", getServerProperties());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("mechanisms", getMechanisms());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("locales", getLocales());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStartOk.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStartOk.java
new file mode 100644
index 0000000000..13fe27de34
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionStartOk.java
@@ -0,0 +1,280 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionStartOk extends Method {
+
+ public static final int TYPE = 258;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private Map<String,Object> clientProperties;
+ private String mechanism;
+ private byte[] response;
+ private String locale;
+
+
+ public ConnectionStartOk() {}
+
+
+ public ConnectionStartOk(Map<String,Object> clientProperties, String mechanism, byte[] response, String locale, Option ... _options) {
+ if(clientProperties != null) {
+ setClientProperties(clientProperties);
+ }
+ if(mechanism != null) {
+ setMechanism(mechanism);
+ }
+ if(response != null) {
+ setResponse(response);
+ }
+ if(locale != null) {
+ setLocale(locale);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionStartOk(context, this);
+ }
+
+
+ public final boolean hasClientProperties() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionStartOk clearClientProperties() {
+ packing_flags &= ~256;
+ this.clientProperties = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getClientProperties() {
+ return clientProperties;
+ }
+
+ public final ConnectionStartOk setClientProperties(Map<String,Object> value) {
+ this.clientProperties = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStartOk clientProperties(Map<String,Object> value) {
+ return setClientProperties(value);
+ }
+
+ public final boolean hasMechanism() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionStartOk clearMechanism() {
+ packing_flags &= ~512;
+ this.mechanism = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getMechanism() {
+ return mechanism;
+ }
+
+ public final ConnectionStartOk setMechanism(String value) {
+ this.mechanism = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStartOk mechanism(String value) {
+ return setMechanism(value);
+ }
+
+ public final boolean hasResponse() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionStartOk clearResponse() {
+ packing_flags &= ~1024;
+ this.response = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getResponse() {
+ return response;
+ }
+
+ public final ConnectionStartOk setResponse(byte[] value) {
+ this.response = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStartOk response(byte[] value) {
+ return setResponse(value);
+ }
+
+ public final boolean hasLocale() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ConnectionStartOk clearLocale() {
+ packing_flags &= ~2048;
+ this.locale = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getLocale() {
+ return locale;
+ }
+
+ public final ConnectionStartOk setLocale(String value) {
+ this.locale = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionStartOk locale(String value) {
+ return setLocale(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeMap(this.clientProperties);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.mechanism);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeVbin32(this.response);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeStr8(this.locale);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.clientProperties = dec.readMap();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.mechanism = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.response = dec.readVbin32();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.locale = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("clientProperties", getClientProperties());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("mechanism", getMechanism());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("response", getResponse());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("locale", getLocale());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTune.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTune.java
new file mode 100644
index 0000000000..b838532878
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTune.java
@@ -0,0 +1,272 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionTune extends Method {
+
+ public static final int TYPE = 261;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private int channelMax;
+ private int maxFrameSize;
+ private int heartbeatMin;
+ private int heartbeatMax;
+
+
+ public ConnectionTune() {}
+
+
+ public ConnectionTune(int channelMax, int maxFrameSize, int heartbeatMin, int heartbeatMax, Option ... _options) {
+ setChannelMax(channelMax);
+ setMaxFrameSize(maxFrameSize);
+ setHeartbeatMin(heartbeatMin);
+ setHeartbeatMax(heartbeatMax);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionTune(context, this);
+ }
+
+
+ public final boolean hasChannelMax() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionTune clearChannelMax() {
+ packing_flags &= ~256;
+ this.channelMax = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getChannelMax() {
+ return channelMax;
+ }
+
+ public final ConnectionTune setChannelMax(int value) {
+ this.channelMax = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTune channelMax(int value) {
+ return setChannelMax(value);
+ }
+
+ public final boolean hasMaxFrameSize() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionTune clearMaxFrameSize() {
+ packing_flags &= ~512;
+ this.maxFrameSize = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getMaxFrameSize() {
+ return maxFrameSize;
+ }
+
+ public final ConnectionTune setMaxFrameSize(int value) {
+ this.maxFrameSize = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTune maxFrameSize(int value) {
+ return setMaxFrameSize(value);
+ }
+
+ public final boolean hasHeartbeatMin() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionTune clearHeartbeatMin() {
+ packing_flags &= ~1024;
+ this.heartbeatMin = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getHeartbeatMin() {
+ return heartbeatMin;
+ }
+
+ public final ConnectionTune setHeartbeatMin(int value) {
+ this.heartbeatMin = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTune heartbeatMin(int value) {
+ return setHeartbeatMin(value);
+ }
+
+ public final boolean hasHeartbeatMax() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ConnectionTune clearHeartbeatMax() {
+ packing_flags &= ~2048;
+ this.heartbeatMax = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getHeartbeatMax() {
+ return heartbeatMax;
+ }
+
+ public final ConnectionTune setHeartbeatMax(int value) {
+ this.heartbeatMax = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTune heartbeatMax(int value) {
+ return setHeartbeatMax(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.channelMax);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint16(this.maxFrameSize);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint16(this.heartbeatMin);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeUint16(this.heartbeatMax);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.channelMax = dec.readUint16();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.maxFrameSize = dec.readUint16();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.heartbeatMin = dec.readUint16();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.heartbeatMax = dec.readUint16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("channelMax", getChannelMax());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("maxFrameSize", getMaxFrameSize());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("heartbeatMin", getHeartbeatMin());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("heartbeatMax", getHeartbeatMax());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java
new file mode 100644
index 0000000000..17b5d34752
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionTuneOk extends Method {
+
+ public static final int TYPE = 262;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private int channelMax;
+ private int maxFrameSize;
+ private int heartbeat;
+
+
+ public ConnectionTuneOk() {}
+
+
+ public ConnectionTuneOk(int channelMax, int maxFrameSize, int heartbeat, Option ... _options) {
+ setChannelMax(channelMax);
+ setMaxFrameSize(maxFrameSize);
+ setHeartbeat(heartbeat);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionTuneOk(context, this);
+ }
+
+
+ public final boolean hasChannelMax() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionTuneOk clearChannelMax() {
+ packing_flags &= ~256;
+ this.channelMax = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getChannelMax() {
+ return channelMax;
+ }
+
+ public final ConnectionTuneOk setChannelMax(int value) {
+ this.channelMax = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk channelMax(int value) {
+ return setChannelMax(value);
+ }
+
+ public final boolean hasMaxFrameSize() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionTuneOk clearMaxFrameSize() {
+ packing_flags &= ~512;
+ this.maxFrameSize = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getMaxFrameSize() {
+ return maxFrameSize;
+ }
+
+ public final ConnectionTuneOk setMaxFrameSize(int value) {
+ this.maxFrameSize = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk maxFrameSize(int value) {
+ return setMaxFrameSize(value);
+ }
+
+ public final boolean hasHeartbeat() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionTuneOk clearHeartbeat() {
+ packing_flags &= ~1024;
+ this.heartbeat = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getHeartbeat() {
+ return heartbeat;
+ }
+
+ public final ConnectionTuneOk setHeartbeat(int value) {
+ this.heartbeat = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk heartbeat(int value) {
+ return setHeartbeat(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.channelMax);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint16(this.maxFrameSize);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint16(this.heartbeat);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.channelMax = dec.readUint16();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.maxFrameSize = dec.readUint16();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.heartbeat = dec.readUint16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("channelMax", getChannelMax());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("maxFrameSize", getMaxFrameSize());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("heartbeat", getHeartbeat());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java
new file mode 100644
index 0000000000..17355d3465
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java
@@ -0,0 +1,29 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+
+
+public interface Constant
+{
+ public static final int MIN_MAX_FRAME_SIZE = 4096;
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java
new file mode 100644
index 0000000000..ded5a42247
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java
@@ -0,0 +1,593 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class DeliveryProperties extends Struct {
+
+ public static final int TYPE = 1025;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private MessageDeliveryPriority priority;
+ private MessageDeliveryMode deliveryMode;
+ private long ttl;
+ private long timestamp;
+ private long expiration;
+ private String exchange;
+ private String routingKey;
+ private String resumeId;
+ private long resumeTtl;
+
+
+ public DeliveryProperties() {}
+
+
+ public DeliveryProperties(MessageDeliveryPriority priority, MessageDeliveryMode deliveryMode, long ttl, long timestamp, long expiration, String exchange, String routingKey, String resumeId, long resumeTtl, Option ... _options) {
+ if(priority != null) {
+ setPriority(priority);
+ }
+ if(deliveryMode != null) {
+ setDeliveryMode(deliveryMode);
+ }
+ setTtl(ttl);
+ setTimestamp(timestamp);
+ setExpiration(expiration);
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(routingKey != null) {
+ setRoutingKey(routingKey);
+ }
+ if(resumeId != null) {
+ setResumeId(resumeId);
+ }
+ setResumeTtl(resumeTtl);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case DISCARD_UNROUTABLE: packing_flags |= 256; break;
+ case IMMEDIATE: packing_flags |= 512; break;
+ case REDELIVERED: packing_flags |= 1024; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasDiscardUnroutable() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DeliveryProperties clearDiscardUnroutable() {
+ packing_flags &= ~256;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDiscardUnroutable() {
+ return hasDiscardUnroutable();
+ }
+
+ public final DeliveryProperties setDiscardUnroutable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 256;
+ }
+ else
+ {
+ packing_flags &= ~256;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties discardUnroutable(boolean value) {
+ return setDiscardUnroutable(value);
+ }
+
+ public final boolean hasImmediate() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DeliveryProperties clearImmediate() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getImmediate() {
+ return hasImmediate();
+ }
+
+ public final DeliveryProperties setImmediate(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties immediate(boolean value) {
+ return setImmediate(value);
+ }
+
+ public final boolean hasRedelivered() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DeliveryProperties clearRedelivered() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getRedelivered() {
+ return hasRedelivered();
+ }
+
+ public final DeliveryProperties setRedelivered(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties redelivered(boolean value) {
+ return setRedelivered(value);
+ }
+
+ public final boolean hasPriority() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final DeliveryProperties clearPriority() {
+ packing_flags &= ~2048;
+ this.priority = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageDeliveryPriority getPriority() {
+ return priority;
+ }
+
+ public final DeliveryProperties setPriority(MessageDeliveryPriority value) {
+ this.priority = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties priority(MessageDeliveryPriority value) {
+ return setPriority(value);
+ }
+
+ public final boolean hasDeliveryMode() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final DeliveryProperties clearDeliveryMode() {
+ packing_flags &= ~4096;
+ this.deliveryMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageDeliveryMode getDeliveryMode() {
+ return deliveryMode;
+ }
+
+ public final DeliveryProperties setDeliveryMode(MessageDeliveryMode value) {
+ this.deliveryMode = value;
+ packing_flags |= 4096;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties deliveryMode(MessageDeliveryMode value) {
+ return setDeliveryMode(value);
+ }
+
+ public final boolean hasTtl() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final DeliveryProperties clearTtl() {
+ packing_flags &= ~8192;
+ this.ttl = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTtl() {
+ return ttl;
+ }
+
+ public final DeliveryProperties setTtl(long value) {
+ this.ttl = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties ttl(long value) {
+ return setTtl(value);
+ }
+
+ public final boolean hasTimestamp() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final DeliveryProperties clearTimestamp() {
+ packing_flags &= ~16384;
+ this.timestamp = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimestamp() {
+ return timestamp;
+ }
+
+ public final DeliveryProperties setTimestamp(long value) {
+ this.timestamp = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties timestamp(long value) {
+ return setTimestamp(value);
+ }
+
+ public final boolean hasExpiration() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final DeliveryProperties clearExpiration() {
+ packing_flags &= ~32768;
+ this.expiration = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getExpiration() {
+ return expiration;
+ }
+
+ public final DeliveryProperties setExpiration(long value) {
+ this.expiration = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties expiration(long value) {
+ return setExpiration(value);
+ }
+
+ public final boolean hasExchange() {
+ return (packing_flags & 1) != 0;
+ }
+
+ public final DeliveryProperties clearExchange() {
+ packing_flags &= ~1;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final DeliveryProperties setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 1;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasRoutingKey() {
+ return (packing_flags & 2) != 0;
+ }
+
+ public final DeliveryProperties clearRoutingKey() {
+ packing_flags &= ~2;
+ this.routingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getRoutingKey() {
+ return routingKey;
+ }
+
+ public final DeliveryProperties setRoutingKey(String value) {
+ this.routingKey = value;
+ packing_flags |= 2;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties routingKey(String value) {
+ return setRoutingKey(value);
+ }
+
+ public final boolean hasResumeId() {
+ return (packing_flags & 4) != 0;
+ }
+
+ public final DeliveryProperties clearResumeId() {
+ packing_flags &= ~4;
+ this.resumeId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getResumeId() {
+ return resumeId;
+ }
+
+ public final DeliveryProperties setResumeId(String value) {
+ this.resumeId = value;
+ packing_flags |= 4;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties resumeId(String value) {
+ return setResumeId(value);
+ }
+
+ public final boolean hasResumeTtl() {
+ return (packing_flags & 8) != 0;
+ }
+
+ public final DeliveryProperties clearResumeTtl() {
+ packing_flags &= ~8;
+ this.resumeTtl = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getResumeTtl() {
+ return resumeTtl;
+ }
+
+ public final DeliveryProperties setResumeTtl(long value) {
+ this.resumeTtl = value;
+ packing_flags |= 8;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties resumeTtl(long value) {
+ return setResumeTtl(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeUint8(this.priority.getValue());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ enc.writeUint8(this.deliveryMode.getValue());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeUint64(this.ttl);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeDatetime(this.timestamp);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeDatetime(this.expiration);
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ enc.writeStr8(this.routingKey);
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ enc.writeStr16(this.resumeId);
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ enc.writeUint64(this.resumeTtl);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 2048) != 0)
+ {
+ this.priority = MessageDeliveryPriority.get(dec.readUint8());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ this.deliveryMode = MessageDeliveryMode.get(dec.readUint8());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.ttl = dec.readUint64();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.timestamp = dec.readDatetime();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.expiration = dec.readDatetime();
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ this.routingKey = dec.readStr8();
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ this.resumeId = dec.readStr16();
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ this.resumeTtl = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("discardUnroutable", getDiscardUnroutable());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("immediate", getImmediate());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("redelivered", getRedelivered());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("priority", getPriority());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("deliveryMode", getDeliveryMode());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("ttl", getTtl());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("timestamp", getTimestamp());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("expiration", getExpiration());
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ result.put("routingKey", getRoutingKey());
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ result.put("resumeId", getResumeId());
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ result.put("resumeTtl", getResumeTtl());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java
new file mode 100644
index 0000000000..315b37025d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxCommit extends Method {
+
+ public static final int TYPE = 1540;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxCommit() {}
+
+
+ public DtxCommit(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case ONE_PHASE: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxCommit(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxCommit clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxCommit setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxCommit xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasOnePhase() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxCommit clearOnePhase() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getOnePhase() {
+ return hasOnePhase();
+ }
+
+ public final DtxCommit setOnePhase(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxCommit onePhase(boolean value) {
+ return setOnePhase(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("onePhase", getOnePhase());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java
new file mode 100644
index 0000000000..70cac46379
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxEnd extends Method {
+
+ public static final int TYPE = 1539;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxEnd() {}
+
+
+ public DtxEnd(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case FAIL: packing_flags |= 512; break;
+ case SUSPEND: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxEnd(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxEnd clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxEnd setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasFail() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxEnd clearFail() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getFail() {
+ return hasFail();
+ }
+
+ public final DtxEnd setFail(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd fail(boolean value) {
+ return setFail(value);
+ }
+
+ public final boolean hasSuspend() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DtxEnd clearSuspend() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getSuspend() {
+ return hasSuspend();
+ }
+
+ public final DtxEnd setSuspend(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd suspend(boolean value) {
+ return setSuspend(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("fail", getFail());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("suspend", getSuspend());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java
new file mode 100644
index 0000000000..0d57488e78
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxForget extends Method {
+
+ public static final int TYPE = 1541;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxForget() {}
+
+
+ public DtxForget(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxForget(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxForget clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxForget setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxForget xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java
new file mode 100644
index 0000000000..42293a865f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxGetTimeout extends Method {
+
+ public static final int TYPE = 1542;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxGetTimeout() {}
+
+
+ public DtxGetTimeout(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxGetTimeout(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxGetTimeout clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxGetTimeout setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxGetTimeout xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java
new file mode 100644
index 0000000000..8a771e638f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxPrepare extends Method {
+
+ public static final int TYPE = 1543;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxPrepare() {}
+
+
+ public DtxPrepare(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxPrepare(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxPrepare clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxPrepare setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxPrepare xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java
new file mode 100644
index 0000000000..bbda4a0a60
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxRecover extends Method {
+
+ public static final int TYPE = 1544;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public DtxRecover(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxRecover(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java
new file mode 100644
index 0000000000..d3cb28638c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxRollback extends Method {
+
+ public static final int TYPE = 1545;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxRollback() {}
+
+
+ public DtxRollback(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxRollback(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxRollback clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxRollback setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxRollback xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java
new file mode 100644
index 0000000000..b70a4884ff
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxSelect extends Method {
+
+ public static final int TYPE = 1537;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public DtxSelect(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxSelect(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java
new file mode 100644
index 0000000000..0c8b78e12c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java
@@ -0,0 +1,194 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxSetTimeout extends Method {
+
+ public static final int TYPE = 1546;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+ private long timeout;
+
+
+ public DtxSetTimeout() {}
+
+
+ public DtxSetTimeout(Xid xid, long timeout, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+ setTimeout(timeout);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxSetTimeout(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxSetTimeout clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxSetTimeout setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxSetTimeout xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasTimeout() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxSetTimeout clearTimeout() {
+ packing_flags &= ~512;
+ this.timeout = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimeout() {
+ return timeout;
+ }
+
+ public final DtxSetTimeout setTimeout(long value) {
+ this.timeout = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxSetTimeout timeout(long value) {
+ return setTimeout(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint32(this.timeout);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.timeout = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("timeout", getTimeout());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java
new file mode 100644
index 0000000000..7e60f1fbf1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxStart extends Method {
+
+ public static final int TYPE = 1538;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxStart() {}
+
+
+ public DtxStart(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case JOIN: packing_flags |= 512; break;
+ case RESUME: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxStart(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxStart clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxStart setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasJoin() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxStart clearJoin() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getJoin() {
+ return hasJoin();
+ }
+
+ public final DtxStart setJoin(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart join(boolean value) {
+ return setJoin(value);
+ }
+
+ public final boolean hasResume() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DtxStart clearResume() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getResume() {
+ return hasResume();
+ }
+
+ public final DtxStart setResume(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart resume(boolean value) {
+ return setResume(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("join", getJoin());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("resume", getResume());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java
new file mode 100644
index 0000000000..9300354ad4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java
@@ -0,0 +1,62 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum DtxXaStatus {
+
+ XA_OK((int) 0),
+ XA_RBROLLBACK((int) 1),
+ XA_RBTIMEOUT((int) 2),
+ XA_HEURHAZ((int) 3),
+ XA_HEURCOM((int) 4),
+ XA_HEURRB((int) 5),
+ XA_HEURMIX((int) 6),
+ XA_RDONLY((int) 7);
+
+ private final int value;
+
+ DtxXaStatus(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static DtxXaStatus get(int value)
+ {
+ switch (value)
+ {
+ case (int) 0: return XA_OK;
+ case (int) 1: return XA_RBROLLBACK;
+ case (int) 2: return XA_RBTIMEOUT;
+ case (int) 3: return XA_HEURHAZ;
+ case (int) 4: return XA_HEURCOM;
+ case (int) 5: return XA_HEURRB;
+ case (int) 6: return XA_HEURMIX;
+ case (int) 7: return XA_RDONLY;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java
new file mode 100644
index 0000000000..6ef3b0b460
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java
@@ -0,0 +1,280 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeBind extends Method {
+
+ public static final int TYPE = 1796;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String exchange;
+ private String bindingKey;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeBind() {}
+
+
+ public ExchangeBind(String queue, String exchange, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(bindingKey != null) {
+ setBindingKey(bindingKey);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeBind(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeBind clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final ExchangeBind setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeBind clearExchange() {
+ packing_flags &= ~512;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeBind setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasBindingKey() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeBind clearBindingKey() {
+ packing_flags &= ~1024;
+ this.bindingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getBindingKey() {
+ return bindingKey;
+ }
+
+ public final ExchangeBind setBindingKey(String value) {
+ this.bindingKey = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind bindingKey(String value) {
+ return setBindingKey(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeBind clearArguments() {
+ packing_flags &= ~2048;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeBind setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.bindingKey);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.bindingKey = dec.readStr8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("bindingKey", getBindingKey());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java
new file mode 100644
index 0000000000..5847feed9b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java
@@ -0,0 +1,280 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeBound extends Method {
+
+ public static final int TYPE = 1798;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String exchange;
+ private String queue;
+ private String bindingKey;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeBound() {}
+
+
+ public ExchangeBound(String exchange, String queue, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(bindingKey != null) {
+ setBindingKey(bindingKey);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeBound(context, this);
+ }
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeBound clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeBound setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasQueue() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeBound clearQueue() {
+ packing_flags &= ~512;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final ExchangeBound setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasBindingKey() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeBound clearBindingKey() {
+ packing_flags &= ~1024;
+ this.bindingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getBindingKey() {
+ return bindingKey;
+ }
+
+ public final ExchangeBound setBindingKey(String value) {
+ this.bindingKey = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound bindingKey(String value) {
+ return setBindingKey(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeBound clearArguments() {
+ packing_flags &= ~2048;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeBound setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.bindingKey);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.bindingKey = dec.readStr8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("bindingKey", getBindingKey());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBoundResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBoundResult.java
new file mode 100644
index 0000000000..04d944ea33
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBoundResult.java
@@ -0,0 +1,301 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class ExchangeBoundResult extends Struct {
+
+ public static final int TYPE = 1794;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+ public ExchangeBoundResult() {}
+
+
+ public ExchangeBoundResult(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case EXCHANGE_NOT_FOUND: packing_flags |= 256; break;
+ case QUEUE_NOT_FOUND: packing_flags |= 512; break;
+ case QUEUE_NOT_MATCHED: packing_flags |= 1024; break;
+ case KEY_NOT_MATCHED: packing_flags |= 2048; break;
+ case ARGS_NOT_MATCHED: packing_flags |= 4096; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasExchangeNotFound() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeBoundResult clearExchangeNotFound() {
+ packing_flags &= ~256;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExchangeNotFound() {
+ return hasExchangeNotFound();
+ }
+
+ public final ExchangeBoundResult setExchangeNotFound(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 256;
+ }
+ else
+ {
+ packing_flags &= ~256;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBoundResult exchangeNotFound(boolean value) {
+ return setExchangeNotFound(value);
+ }
+
+ public final boolean hasQueueNotFound() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeBoundResult clearQueueNotFound() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getQueueNotFound() {
+ return hasQueueNotFound();
+ }
+
+ public final ExchangeBoundResult setQueueNotFound(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBoundResult queueNotFound(boolean value) {
+ return setQueueNotFound(value);
+ }
+
+ public final boolean hasQueueNotMatched() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeBoundResult clearQueueNotMatched() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getQueueNotMatched() {
+ return hasQueueNotMatched();
+ }
+
+ public final ExchangeBoundResult setQueueNotMatched(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBoundResult queueNotMatched(boolean value) {
+ return setQueueNotMatched(value);
+ }
+
+ public final boolean hasKeyNotMatched() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeBoundResult clearKeyNotMatched() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getKeyNotMatched() {
+ return hasKeyNotMatched();
+ }
+
+ public final ExchangeBoundResult setKeyNotMatched(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBoundResult keyNotMatched(boolean value) {
+ return setKeyNotMatched(value);
+ }
+
+ public final boolean hasArgsNotMatched() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final ExchangeBoundResult clearArgsNotMatched() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getArgsNotMatched() {
+ return hasArgsNotMatched();
+ }
+
+ public final ExchangeBoundResult setArgsNotMatched(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBoundResult argsNotMatched(boolean value) {
+ return setArgsNotMatched(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchangeNotFound", getExchangeNotFound());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("queueNotFound", getQueueNotFound());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("queueNotMatched", getQueueNotMatched());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("keyNotMatched", getKeyNotMatched());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("argsNotMatched", getArgsNotMatched());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDeclare.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDeclare.java
new file mode 100644
index 0000000000..e339801f44
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDeclare.java
@@ -0,0 +1,397 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeDeclare extends Method {
+
+ public static final int TYPE = 1793;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String exchange;
+ private String type;
+ private String alternateExchange;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeDeclare() {}
+
+
+ public ExchangeDeclare(String exchange, String type, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(type != null) {
+ setType(type);
+ }
+ if(alternateExchange != null) {
+ setAlternateExchange(alternateExchange);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case PASSIVE: packing_flags |= 2048; break;
+ case DURABLE: packing_flags |= 4096; break;
+ case AUTO_DELETE: packing_flags |= 8192; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeDeclare(context, this);
+ }
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeDeclare clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeDeclare setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasType() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeDeclare clearType() {
+ packing_flags &= ~512;
+ this.type = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getType() {
+ return type;
+ }
+
+ public final ExchangeDeclare setType(String value) {
+ this.type = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare type(String value) {
+ return setType(value);
+ }
+
+ public final boolean hasAlternateExchange() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeDeclare clearAlternateExchange() {
+ packing_flags &= ~1024;
+ this.alternateExchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getAlternateExchange() {
+ return alternateExchange;
+ }
+
+ public final ExchangeDeclare setAlternateExchange(String value) {
+ this.alternateExchange = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare alternateExchange(String value) {
+ return setAlternateExchange(value);
+ }
+
+ public final boolean hasPassive() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeDeclare clearPassive() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getPassive() {
+ return hasPassive();
+ }
+
+ public final ExchangeDeclare setPassive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare passive(boolean value) {
+ return setPassive(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final ExchangeDeclare clearDurable() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final ExchangeDeclare setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasAutoDelete() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final ExchangeDeclare clearAutoDelete() {
+ packing_flags &= ~8192;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getAutoDelete() {
+ return hasAutoDelete();
+ }
+
+ public final ExchangeDeclare setAutoDelete(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 8192;
+ }
+ else
+ {
+ packing_flags &= ~8192;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare autoDelete(boolean value) {
+ return setAutoDelete(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final ExchangeDeclare clearArguments() {
+ packing_flags &= ~16384;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeDeclare setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDeclare arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.type);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.alternateExchange);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.type = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.alternateExchange = dec.readStr8();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("type", getType());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("alternateExchange", getAlternateExchange());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("passive", getPassive());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("autoDelete", getAutoDelete());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDelete.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDelete.java
new file mode 100644
index 0000000000..a7dcd0cf2c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeDelete.java
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeDelete extends Method {
+
+ public static final int TYPE = 1794;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String exchange;
+
+
+ public ExchangeDelete() {}
+
+
+ public ExchangeDelete(String exchange, Option ... _options) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case IF_UNUSED: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeDelete(context, this);
+ }
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeDelete clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeDelete setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDelete exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasIfUnused() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeDelete clearIfUnused() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getIfUnused() {
+ return hasIfUnused();
+ }
+
+ public final ExchangeDelete setIfUnused(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeDelete ifUnused(boolean value) {
+ return setIfUnused(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("ifUnused", getIfUnused());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQuery.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQuery.java
new file mode 100644
index 0000000000..d5f46e7bbf
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQuery.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeQuery extends Method {
+
+ public static final int TYPE = 1795;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String name;
+
+
+ public ExchangeQuery() {}
+
+
+ public ExchangeQuery(String name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeQuery(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeQuery clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getName() {
+ return name;
+ }
+
+ public final ExchangeQuery setName(String value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeQuery name(String value) {
+ return setName(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQueryResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQueryResult.java
new file mode 100644
index 0000000000..9f83a4aaa7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeQueryResult.java
@@ -0,0 +1,268 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class ExchangeQueryResult extends Struct {
+
+ public static final int TYPE = 1793;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String type;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeQueryResult() {}
+
+
+ public ExchangeQueryResult(String type, Map<String,Object> arguments, Option ... _options) {
+ if(type != null) {
+ setType(type);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case DURABLE: packing_flags |= 512; break;
+ case NOT_FOUND: packing_flags |= 1024; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasType() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeQueryResult clearType() {
+ packing_flags &= ~256;
+ this.type = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getType() {
+ return type;
+ }
+
+ public final ExchangeQueryResult setType(String value) {
+ this.type = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeQueryResult type(String value) {
+ return setType(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeQueryResult clearDurable() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final ExchangeQueryResult setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeQueryResult durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasNotFound() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeQueryResult clearNotFound() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getNotFound() {
+ return hasNotFound();
+ }
+
+ public final ExchangeQueryResult setNotFound(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeQueryResult notFound(boolean value) {
+ return setNotFound(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeQueryResult clearArguments() {
+ packing_flags &= ~2048;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeQueryResult setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeQueryResult arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.type);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.type = dec.readStr8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("type", getType());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("notFound", getNotFound());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeUnbind.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeUnbind.java
new file mode 100644
index 0000000000..ba3fe95952
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeUnbind.java
@@ -0,0 +1,238 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeUnbind extends Method {
+
+ public static final int TYPE = 1797;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String exchange;
+ private String bindingKey;
+
+
+ public ExchangeUnbind() {}
+
+
+ public ExchangeUnbind(String queue, String exchange, String bindingKey, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(bindingKey != null) {
+ setBindingKey(bindingKey);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeUnbind(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeUnbind clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final ExchangeUnbind setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeUnbind queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeUnbind clearExchange() {
+ packing_flags &= ~512;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeUnbind setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeUnbind exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasBindingKey() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeUnbind clearBindingKey() {
+ packing_flags &= ~1024;
+ this.bindingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getBindingKey() {
+ return bindingKey;
+ }
+
+ public final ExchangeUnbind setBindingKey(String value) {
+ this.bindingKey = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeUnbind bindingKey(String value) {
+ return setBindingKey(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.bindingKey);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.bindingKey = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("bindingKey", getBindingKey());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionErrorCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionErrorCode.java
new file mode 100644
index 0000000000..0ba83296e7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionErrorCode.java
@@ -0,0 +1,72 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum ExecutionErrorCode {
+
+ UNAUTHORIZED_ACCESS((int) 403),
+ NOT_FOUND((int) 404),
+ RESOURCE_LOCKED((int) 405),
+ PRECONDITION_FAILED((int) 406),
+ RESOURCE_DELETED((int) 408),
+ ILLEGAL_STATE((int) 409),
+ COMMAND_INVALID((int) 503),
+ RESOURCE_LIMIT_EXCEEDED((int) 506),
+ NOT_ALLOWED((int) 530),
+ ILLEGAL_ARGUMENT((int) 531),
+ NOT_IMPLEMENTED((int) 540),
+ INTERNAL_ERROR((int) 541),
+ INVALID_ARGUMENT((int) 542);
+
+ private final int value;
+
+ ExecutionErrorCode(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static ExecutionErrorCode get(int value)
+ {
+ switch (value)
+ {
+ case (int) 403: return UNAUTHORIZED_ACCESS;
+ case (int) 404: return NOT_FOUND;
+ case (int) 405: return RESOURCE_LOCKED;
+ case (int) 406: return PRECONDITION_FAILED;
+ case (int) 408: return RESOURCE_DELETED;
+ case (int) 409: return ILLEGAL_STATE;
+ case (int) 503: return COMMAND_INVALID;
+ case (int) 506: return RESOURCE_LIMIT_EXCEEDED;
+ case (int) 530: return NOT_ALLOWED;
+ case (int) 531: return ILLEGAL_ARGUMENT;
+ case (int) 540: return NOT_IMPLEMENTED;
+ case (int) 541: return INTERNAL_ERROR;
+ case (int) 542: return INVALID_ARGUMENT;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionException.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionException.java
new file mode 100644
index 0000000000..0f61272476
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionException.java
@@ -0,0 +1,398 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExecutionException extends Method {
+
+ public static final int TYPE = 771;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private ExecutionErrorCode errorCode;
+ private int commandId;
+ private short classCode;
+ private short commandCode;
+ private short fieldIndex;
+ private String description;
+ private Map<String,Object> errorInfo;
+
+
+ public ExecutionException() {}
+
+
+ public ExecutionException(ExecutionErrorCode errorCode, int commandId, short classCode, short commandCode, short fieldIndex, String description, Map<String,Object> errorInfo, Option ... _options) {
+ if(errorCode != null) {
+ setErrorCode(errorCode);
+ }
+ setCommandId(commandId);
+ setClassCode(classCode);
+ setCommandCode(commandCode);
+ setFieldIndex(fieldIndex);
+ if(description != null) {
+ setDescription(description);
+ }
+ if(errorInfo != null) {
+ setErrorInfo(errorInfo);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.executionException(context, this);
+ }
+
+
+ public final boolean hasErrorCode() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExecutionException clearErrorCode() {
+ packing_flags &= ~256;
+ this.errorCode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionErrorCode getErrorCode() {
+ return errorCode;
+ }
+
+ public final ExecutionException setErrorCode(ExecutionErrorCode value) {
+ this.errorCode = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException errorCode(ExecutionErrorCode value) {
+ return setErrorCode(value);
+ }
+
+ public final boolean hasCommandId() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExecutionException clearCommandId() {
+ packing_flags &= ~512;
+ this.commandId = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final ExecutionException setCommandId(int value) {
+ this.commandId = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final boolean hasClassCode() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExecutionException clearClassCode() {
+ packing_flags &= ~1024;
+ this.classCode = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final short getClassCode() {
+ return classCode;
+ }
+
+ public final ExecutionException setClassCode(short value) {
+ this.classCode = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException classCode(short value) {
+ return setClassCode(value);
+ }
+
+ public final boolean hasCommandCode() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExecutionException clearCommandCode() {
+ packing_flags &= ~2048;
+ this.commandCode = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final short getCommandCode() {
+ return commandCode;
+ }
+
+ public final ExecutionException setCommandCode(short value) {
+ this.commandCode = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException commandCode(short value) {
+ return setCommandCode(value);
+ }
+
+ public final boolean hasFieldIndex() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final ExecutionException clearFieldIndex() {
+ packing_flags &= ~4096;
+ this.fieldIndex = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final short getFieldIndex() {
+ return fieldIndex;
+ }
+
+ public final ExecutionException setFieldIndex(short value) {
+ this.fieldIndex = value;
+ packing_flags |= 4096;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException fieldIndex(short value) {
+ return setFieldIndex(value);
+ }
+
+ public final boolean hasDescription() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final ExecutionException clearDescription() {
+ packing_flags &= ~8192;
+ this.description = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDescription() {
+ return description;
+ }
+
+ public final ExecutionException setDescription(String value) {
+ this.description = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException description(String value) {
+ return setDescription(value);
+ }
+
+ public final boolean hasErrorInfo() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final ExecutionException clearErrorInfo() {
+ packing_flags &= ~16384;
+ this.errorInfo = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getErrorInfo() {
+ return errorInfo;
+ }
+
+ public final ExecutionException setErrorInfo(Map<String,Object> value) {
+ this.errorInfo = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionException errorInfo(Map<String,Object> value) {
+ return setErrorInfo(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.errorCode.getValue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeSequenceNo(this.commandId);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint8(this.classCode);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeUint8(this.commandCode);
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ enc.writeUint8(this.fieldIndex);
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeStr16(this.description);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeMap(this.errorInfo);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.errorCode = ExecutionErrorCode.get(dec.readUint16());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.commandId = dec.readSequenceNo();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.classCode = dec.readUint8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.commandCode = dec.readUint8();
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ this.fieldIndex = dec.readUint8();
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.description = dec.readStr16();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.errorInfo = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("errorCode", getErrorCode());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("commandId", getCommandId());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("classCode", getClassCode());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("commandCode", getCommandCode());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("fieldIndex", getFieldIndex());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("description", getDescription());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("errorInfo", getErrorInfo());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionResult.java
new file mode 100644
index 0000000000..123848b7eb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionResult.java
@@ -0,0 +1,194 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExecutionResult extends Method {
+
+ public static final int TYPE = 770;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private int commandId;
+ private Struct value;
+
+
+ public ExecutionResult() {}
+
+
+ public ExecutionResult(int commandId, Struct value, Option ... _options) {
+ setCommandId(commandId);
+ if(value != null) {
+ setValue(value);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.executionResult(context, this);
+ }
+
+
+ public final boolean hasCommandId() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExecutionResult clearCommandId() {
+ packing_flags &= ~256;
+ this.commandId = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final ExecutionResult setCommandId(int value) {
+ this.commandId = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionResult commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final boolean hasValue() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExecutionResult clearValue() {
+ packing_flags &= ~512;
+ this.value = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Struct getValue() {
+ return value;
+ }
+
+ public final ExecutionResult setValue(Struct value) {
+ this.value = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExecutionResult value(Struct value) {
+ return setValue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceNo(this.commandId);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStruct32(this.value);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commandId = dec.readSequenceNo();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.value = dec.readStruct32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commandId", getCommandId());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("value", getValue());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionSync.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionSync.java
new file mode 100644
index 0000000000..db35beb161
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ExecutionSync.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExecutionSync extends Method {
+
+ public static final int TYPE = 769;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public ExecutionSync(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.executionSync(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/FileReturnCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/FileReturnCode.java
new file mode 100644
index 0000000000..2c0b4d510b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/FileReturnCode.java
@@ -0,0 +1,52 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum FileReturnCode {
+
+ CONTENT_TOO_LARGE((int) 311),
+ NO_ROUTE((int) 312),
+ NO_CONSUMERS((int) 313);
+
+ private final int value;
+
+ FileReturnCode(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static FileReturnCode get(int value)
+ {
+ switch (value)
+ {
+ case (int) 311: return CONTENT_TOO_LARGE;
+ case (int) 312: return NO_ROUTE;
+ case (int) 313: return NO_CONSUMERS;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/FragmentProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/FragmentProperties.java
new file mode 100644
index 0000000000..0b9774355e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/FragmentProperties.java
@@ -0,0 +1,224 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class FragmentProperties extends Struct {
+
+ public static final int TYPE = 1026;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long fragmentSize;
+
+
+ public FragmentProperties() {}
+
+
+ public FragmentProperties(long fragmentSize, Option ... _options) {
+ setFragmentSize(fragmentSize);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case FIRST: packing_flags |= 256; break;
+ case LAST: packing_flags |= 512; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasFirst() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final FragmentProperties clearFirst() {
+ packing_flags &= ~256;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getFirst() {
+ return hasFirst();
+ }
+
+ public final FragmentProperties setFirst(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 256;
+ }
+ else
+ {
+ packing_flags &= ~256;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final FragmentProperties first(boolean value) {
+ return setFirst(value);
+ }
+
+ public final boolean hasLast() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final FragmentProperties clearLast() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getLast() {
+ return hasLast();
+ }
+
+ public final FragmentProperties setLast(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final FragmentProperties last(boolean value) {
+ return setLast(value);
+ }
+
+ public final boolean hasFragmentSize() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final FragmentProperties clearFragmentSize() {
+ packing_flags &= ~1024;
+ this.fragmentSize = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getFragmentSize() {
+ return fragmentSize;
+ }
+
+ public final FragmentProperties setFragmentSize(long value) {
+ this.fragmentSize = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final FragmentProperties fragmentSize(long value) {
+ return setFragmentSize(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint64(this.fragmentSize);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 1024) != 0)
+ {
+ this.fragmentSize = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("first", getFirst());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("last", getLast());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("fragmentSize", getFragmentSize());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/GetTimeoutResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/GetTimeoutResult.java
new file mode 100644
index 0000000000..ebff105464
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/GetTimeoutResult.java
@@ -0,0 +1,139 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class GetTimeoutResult extends Struct {
+
+ public static final int TYPE = 1538;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long timeout;
+
+
+ public GetTimeoutResult() {}
+
+
+ public GetTimeoutResult(long timeout) {
+ setTimeout(timeout);
+
+ }
+
+
+
+
+ public final boolean hasTimeout() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final GetTimeoutResult clearTimeout() {
+ packing_flags &= ~256;
+ this.timeout = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimeout() {
+ return timeout;
+ }
+
+ public final GetTimeoutResult setTimeout(long value) {
+ this.timeout = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final GetTimeoutResult timeout(long value) {
+ return setTimeout(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint32(this.timeout);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.timeout = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("timeout", getTimeout());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAccept.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAccept.java
new file mode 100644
index 0000000000..e30a4e4f66
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAccept.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageAccept extends Method {
+
+ public static final int TYPE = 1026;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet transfers;
+
+
+ public MessageAccept() {}
+
+
+ public MessageAccept(RangeSet transfers, Option ... _options) {
+ if(transfers != null) {
+ setTransfers(transfers);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageAccept(context, this);
+ }
+
+
+ public final boolean hasTransfers() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageAccept clearTransfers() {
+ packing_flags &= ~256;
+ this.transfers = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getTransfers() {
+ return transfers;
+ }
+
+ public final MessageAccept setTransfers(RangeSet value) {
+ this.transfers = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAccept transfers(RangeSet value) {
+ return setTransfers(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.transfers);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.transfers = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("transfers", getTransfers());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcceptMode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcceptMode.java
new file mode 100644
index 0000000000..0f11560c66
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcceptMode.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageAcceptMode {
+
+ EXPLICIT((short) 0),
+ NONE((short) 1);
+
+ private final short value;
+
+ MessageAcceptMode(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageAcceptMode get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return EXPLICIT;
+ case (short) 1: return NONE;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquire.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquire.java
new file mode 100644
index 0000000000..6ef5283163
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquire.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageAcquire extends Method {
+
+ public static final int TYPE = 1029;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet transfers;
+
+
+ public MessageAcquire() {}
+
+
+ public MessageAcquire(RangeSet transfers, Option ... _options) {
+ if(transfers != null) {
+ setTransfers(transfers);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageAcquire(context, this);
+ }
+
+
+ public final boolean hasTransfers() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageAcquire clearTransfers() {
+ packing_flags &= ~256;
+ this.transfers = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getTransfers() {
+ return transfers;
+ }
+
+ public final MessageAcquire setTransfers(RangeSet value) {
+ this.transfers = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAcquire transfers(RangeSet value) {
+ return setTransfers(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.transfers);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.transfers = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("transfers", getTransfers());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquireMode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquireMode.java
new file mode 100644
index 0000000000..3d46baf1af
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageAcquireMode.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageAcquireMode {
+
+ PRE_ACQUIRED((short) 0),
+ NOT_ACQUIRED((short) 1);
+
+ private final short value;
+
+ MessageAcquireMode(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageAcquireMode get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return PRE_ACQUIRED;
+ case (short) 1: return NOT_ACQUIRED;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCancel.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCancel.java
new file mode 100644
index 0000000000..1ab510150d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCancel.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageCancel extends Method {
+
+ public static final int TYPE = 1032;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+
+
+ public MessageCancel() {}
+
+
+ public MessageCancel(String destination, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageCancel(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageCancel clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageCancel setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageCancel destination(String value) {
+ return setDestination(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCreditUnit.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCreditUnit.java
new file mode 100644
index 0000000000..f3ade93c69
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageCreditUnit.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageCreditUnit {
+
+ MESSAGE((short) 0),
+ BYTE((short) 1);
+
+ private final short value;
+
+ MessageCreditUnit(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageCreditUnit get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return MESSAGE;
+ case (short) 1: return BYTE;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryMode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryMode.java
new file mode 100644
index 0000000000..eb21465c10
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryMode.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageDeliveryMode {
+
+ NON_PERSISTENT((short) 1),
+ PERSISTENT((short) 2);
+
+ private final short value;
+
+ MessageDeliveryMode(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageDeliveryMode get(short value)
+ {
+ switch (value)
+ {
+ case (short) 1: return NON_PERSISTENT;
+ case (short) 2: return PERSISTENT;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryPriority.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryPriority.java
new file mode 100644
index 0000000000..d5d1b861e8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageDeliveryPriority.java
@@ -0,0 +1,66 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageDeliveryPriority {
+
+ LOWEST((short) 0),
+ LOWER((short) 1),
+ LOW((short) 2),
+ BELOW_AVERAGE((short) 3),
+ MEDIUM((short) 4),
+ ABOVE_AVERAGE((short) 5),
+ HIGH((short) 6),
+ HIGHER((short) 7),
+ VERY_HIGH((short) 8),
+ HIGHEST((short) 9);
+
+ private final short value;
+
+ MessageDeliveryPriority(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageDeliveryPriority get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return LOWEST;
+ case (short) 1: return LOWER;
+ case (short) 2: return LOW;
+ case (short) 3: return BELOW_AVERAGE;
+ case (short) 4: return MEDIUM;
+ case (short) 5: return ABOVE_AVERAGE;
+ case (short) 6: return HIGH;
+ case (short) 7: return HIGHER;
+ case (short) 8: return VERY_HIGH;
+ case (short) 9: return HIGHEST;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlow.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlow.java
new file mode 100644
index 0000000000..0ece4245b3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlow.java
@@ -0,0 +1,236 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageFlow extends Method {
+
+ public static final int TYPE = 1034;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+ private MessageCreditUnit unit;
+ private long value;
+
+
+ public MessageFlow() {}
+
+
+ public MessageFlow(String destination, MessageCreditUnit unit, long value, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+ if(unit != null) {
+ setUnit(unit);
+ }
+ setValue(value);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageFlow(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageFlow clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageFlow setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageFlow destination(String value) {
+ return setDestination(value);
+ }
+
+ public final boolean hasUnit() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageFlow clearUnit() {
+ packing_flags &= ~512;
+ this.unit = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageCreditUnit getUnit() {
+ return unit;
+ }
+
+ public final MessageFlow setUnit(MessageCreditUnit value) {
+ this.unit = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageFlow unit(MessageCreditUnit value) {
+ return setUnit(value);
+ }
+
+ public final boolean hasValue() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final MessageFlow clearValue() {
+ packing_flags &= ~1024;
+ this.value = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getValue() {
+ return value;
+ }
+
+ public final MessageFlow setValue(long value) {
+ this.value = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageFlow value(long value) {
+ return setValue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint8(this.unit.getValue());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint32(this.value);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.unit = MessageCreditUnit.get(dec.readUint8());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.value = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("unit", getUnit());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("value", getValue());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlowMode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlowMode.java
new file mode 100644
index 0000000000..60670260fb
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlowMode.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageFlowMode {
+
+ CREDIT((short) 0),
+ WINDOW((short) 1);
+
+ private final short value;
+
+ MessageFlowMode(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static MessageFlowMode get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return CREDIT;
+ case (short) 1: return WINDOW;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlush.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlush.java
new file mode 100644
index 0000000000..8e093dd003
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageFlush.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageFlush extends Method {
+
+ public static final int TYPE = 1035;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+
+
+ public MessageFlush() {}
+
+
+ public MessageFlush(String destination, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageFlush(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageFlush clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageFlush setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageFlush destination(String value) {
+ return setDestination(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageProperties.java
new file mode 100644
index 0000000000..37b5e7a052
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageProperties.java
@@ -0,0 +1,475 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class MessageProperties extends Struct {
+
+ public static final int TYPE = 1027;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long contentLength;
+ private java.util.UUID messageId;
+ private byte[] correlationId;
+ private ReplyTo replyTo;
+ private String contentType;
+ private String contentEncoding;
+ private byte[] userId;
+ private byte[] appId;
+ private Map<String,Object> applicationHeaders;
+
+
+ public MessageProperties() {}
+
+
+ public MessageProperties(long contentLength, java.util.UUID messageId, byte[] correlationId, ReplyTo replyTo, String contentType, String contentEncoding, byte[] userId, byte[] appId, Map<String,Object> applicationHeaders) {
+ setContentLength(contentLength);
+ if(messageId != null) {
+ setMessageId(messageId);
+ }
+ if(correlationId != null) {
+ setCorrelationId(correlationId);
+ }
+ if(replyTo != null) {
+ setReplyTo(replyTo);
+ }
+ if(contentType != null) {
+ setContentType(contentType);
+ }
+ if(contentEncoding != null) {
+ setContentEncoding(contentEncoding);
+ }
+ if(userId != null) {
+ setUserId(userId);
+ }
+ if(appId != null) {
+ setAppId(appId);
+ }
+ if(applicationHeaders != null) {
+ setApplicationHeaders(applicationHeaders);
+ }
+
+ }
+
+
+
+
+ public final boolean hasContentLength() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageProperties clearContentLength() {
+ packing_flags &= ~256;
+ this.contentLength = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getContentLength() {
+ return contentLength;
+ }
+
+ public final MessageProperties setContentLength(long value) {
+ this.contentLength = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties contentLength(long value) {
+ return setContentLength(value);
+ }
+
+ public final boolean hasMessageId() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageProperties clearMessageId() {
+ packing_flags &= ~512;
+ this.messageId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.UUID getMessageId() {
+ return messageId;
+ }
+
+ public final MessageProperties setMessageId(java.util.UUID value) {
+ this.messageId = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties messageId(java.util.UUID value) {
+ return setMessageId(value);
+ }
+
+ public final boolean hasCorrelationId() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final MessageProperties clearCorrelationId() {
+ packing_flags &= ~1024;
+ this.correlationId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getCorrelationId() {
+ return correlationId;
+ }
+
+ public final MessageProperties setCorrelationId(byte[] value) {
+ this.correlationId = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties correlationId(byte[] value) {
+ return setCorrelationId(value);
+ }
+
+ public final boolean hasReplyTo() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final MessageProperties clearReplyTo() {
+ packing_flags &= ~2048;
+ this.replyTo = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final ReplyTo getReplyTo() {
+ return replyTo;
+ }
+
+ public final MessageProperties setReplyTo(ReplyTo value) {
+ this.replyTo = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties replyTo(ReplyTo value) {
+ return setReplyTo(value);
+ }
+
+ public final boolean hasContentType() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final MessageProperties clearContentType() {
+ packing_flags &= ~4096;
+ this.contentType = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getContentType() {
+ return contentType;
+ }
+
+ public final MessageProperties setContentType(String value) {
+ this.contentType = value;
+ packing_flags |= 4096;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties contentType(String value) {
+ return setContentType(value);
+ }
+
+ public final boolean hasContentEncoding() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final MessageProperties clearContentEncoding() {
+ packing_flags &= ~8192;
+ this.contentEncoding = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getContentEncoding() {
+ return contentEncoding;
+ }
+
+ public final MessageProperties setContentEncoding(String value) {
+ this.contentEncoding = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties contentEncoding(String value) {
+ return setContentEncoding(value);
+ }
+
+ public final boolean hasUserId() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final MessageProperties clearUserId() {
+ packing_flags &= ~16384;
+ this.userId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getUserId() {
+ return userId;
+ }
+
+ public final MessageProperties setUserId(byte[] value) {
+ this.userId = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties userId(byte[] value) {
+ return setUserId(value);
+ }
+
+ public final boolean hasAppId() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final MessageProperties clearAppId() {
+ packing_flags &= ~32768;
+ this.appId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getAppId() {
+ return appId;
+ }
+
+ public final MessageProperties setAppId(byte[] value) {
+ this.appId = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties appId(byte[] value) {
+ return setAppId(value);
+ }
+
+ public final boolean hasApplicationHeaders() {
+ return (packing_flags & 1) != 0;
+ }
+
+ public final MessageProperties clearApplicationHeaders() {
+ packing_flags &= ~1;
+ this.applicationHeaders = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getApplicationHeaders() {
+ return applicationHeaders;
+ }
+
+ public final MessageProperties setApplicationHeaders(Map<String,Object> value) {
+ this.applicationHeaders = value;
+ packing_flags |= 1;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageProperties applicationHeaders(Map<String,Object> value) {
+ return setApplicationHeaders(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint64(this.contentLength);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUuid(this.messageId);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeVbin16(this.correlationId);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeStruct(ReplyTo.TYPE, this.replyTo);
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ enc.writeStr8(this.contentType);
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeStr8(this.contentEncoding);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeVbin16(this.userId);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeVbin16(this.appId);
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ enc.writeMap(this.applicationHeaders);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.contentLength = dec.readUint64();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.messageId = dec.readUuid();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.correlationId = dec.readVbin16();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.replyTo = (ReplyTo)dec.readStruct(ReplyTo.TYPE);
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ this.contentType = dec.readStr8();
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.contentEncoding = dec.readStr8();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.userId = dec.readVbin16();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.appId = dec.readVbin16();
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ this.applicationHeaders = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("contentLength", getContentLength());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("messageId", getMessageId());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("correlationId", getCorrelationId());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("replyTo", getReplyTo());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("contentType", getContentType());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("contentEncoding", getContentEncoding());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("userId", getUserId());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("appId", getAppId());
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ result.put("applicationHeaders", getApplicationHeaders());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageReject.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageReject.java
new file mode 100644
index 0000000000..60cb37d55c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageReject.java
@@ -0,0 +1,238 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageReject extends Method {
+
+ public static final int TYPE = 1027;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet transfers;
+ private MessageRejectCode code;
+ private String text;
+
+
+ public MessageReject() {}
+
+
+ public MessageReject(RangeSet transfers, MessageRejectCode code, String text, Option ... _options) {
+ if(transfers != null) {
+ setTransfers(transfers);
+ }
+ if(code != null) {
+ setCode(code);
+ }
+ if(text != null) {
+ setText(text);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageReject(context, this);
+ }
+
+
+ public final boolean hasTransfers() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageReject clearTransfers() {
+ packing_flags &= ~256;
+ this.transfers = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getTransfers() {
+ return transfers;
+ }
+
+ public final MessageReject setTransfers(RangeSet value) {
+ this.transfers = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageReject transfers(RangeSet value) {
+ return setTransfers(value);
+ }
+
+ public final boolean hasCode() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageReject clearCode() {
+ packing_flags &= ~512;
+ this.code = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageRejectCode getCode() {
+ return code;
+ }
+
+ public final MessageReject setCode(MessageRejectCode value) {
+ this.code = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageReject code(MessageRejectCode value) {
+ return setCode(value);
+ }
+
+ public final boolean hasText() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final MessageReject clearText() {
+ packing_flags &= ~1024;
+ this.text = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getText() {
+ return text;
+ }
+
+ public final MessageReject setText(String value) {
+ this.text = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageReject text(String value) {
+ return setText(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.transfers);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint16(this.code.getValue());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.text);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.transfers = dec.readSequenceSet();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.code = MessageRejectCode.get(dec.readUint16());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.text = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("transfers", getTransfers());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("code", getCode());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("text", getText());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRejectCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRejectCode.java
new file mode 100644
index 0000000000..dc41de100b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRejectCode.java
@@ -0,0 +1,52 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum MessageRejectCode {
+
+ UNSPECIFIED((int) 0),
+ UNROUTABLE((int) 1),
+ IMMEDIATE((int) 2);
+
+ private final int value;
+
+ MessageRejectCode(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static MessageRejectCode get(int value)
+ {
+ switch (value)
+ {
+ case (int) 0: return UNSPECIFIED;
+ case (int) 1: return UNROUTABLE;
+ case (int) 2: return IMMEDIATE;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRelease.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRelease.java
new file mode 100644
index 0000000000..557139dd01
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageRelease.java
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageRelease extends Method {
+
+ public static final int TYPE = 1028;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet transfers;
+
+
+ public MessageRelease() {}
+
+
+ public MessageRelease(RangeSet transfers, Option ... _options) {
+ if(transfers != null) {
+ setTransfers(transfers);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SET_REDELIVERED: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageRelease(context, this);
+ }
+
+
+ public final boolean hasTransfers() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageRelease clearTransfers() {
+ packing_flags &= ~256;
+ this.transfers = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getTransfers() {
+ return transfers;
+ }
+
+ public final MessageRelease setTransfers(RangeSet value) {
+ this.transfers = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageRelease transfers(RangeSet value) {
+ return setTransfers(value);
+ }
+
+ public final boolean hasSetRedelivered() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageRelease clearSetRedelivered() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getSetRedelivered() {
+ return hasSetRedelivered();
+ }
+
+ public final MessageRelease setSetRedelivered(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageRelease setRedelivered(boolean value) {
+ return setSetRedelivered(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.transfers);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.transfers = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("transfers", getTransfers());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("setRedelivered", getSetRedelivered());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResume.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResume.java
new file mode 100644
index 0000000000..e0dfbdfd57
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResume.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageResume extends Method {
+
+ public static final int TYPE = 1030;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+ private String resumeId;
+
+
+ public MessageResume() {}
+
+
+ public MessageResume(String destination, String resumeId, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+ if(resumeId != null) {
+ setResumeId(resumeId);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageResume(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageResume clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageResume setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageResume destination(String value) {
+ return setDestination(value);
+ }
+
+ public final boolean hasResumeId() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageResume clearResumeId() {
+ packing_flags &= ~512;
+ this.resumeId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getResumeId() {
+ return resumeId;
+ }
+
+ public final MessageResume setResumeId(String value) {
+ this.resumeId = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageResume resumeId(String value) {
+ return setResumeId(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr16(this.resumeId);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.resumeId = dec.readStr16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("resumeId", getResumeId());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResumeResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResumeResult.java
new file mode 100644
index 0000000000..1524b09509
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageResumeResult.java
@@ -0,0 +1,139 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class MessageResumeResult extends Struct {
+
+ public static final int TYPE = 1029;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long offset;
+
+
+ public MessageResumeResult() {}
+
+
+ public MessageResumeResult(long offset) {
+ setOffset(offset);
+
+ }
+
+
+
+
+ public final boolean hasOffset() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageResumeResult clearOffset() {
+ packing_flags &= ~256;
+ this.offset = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getOffset() {
+ return offset;
+ }
+
+ public final MessageResumeResult setOffset(long value) {
+ this.offset = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageResumeResult offset(long value) {
+ return setOffset(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint64(this.offset);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.offset = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("offset", getOffset());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSetFlowMode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSetFlowMode.java
new file mode 100644
index 0000000000..09457b9764
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSetFlowMode.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageSetFlowMode extends Method {
+
+ public static final int TYPE = 1033;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+ private MessageFlowMode flowMode;
+
+
+ public MessageSetFlowMode() {}
+
+
+ public MessageSetFlowMode(String destination, MessageFlowMode flowMode, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+ if(flowMode != null) {
+ setFlowMode(flowMode);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageSetFlowMode(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageSetFlowMode clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageSetFlowMode setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSetFlowMode destination(String value) {
+ return setDestination(value);
+ }
+
+ public final boolean hasFlowMode() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageSetFlowMode clearFlowMode() {
+ packing_flags &= ~512;
+ this.flowMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageFlowMode getFlowMode() {
+ return flowMode;
+ }
+
+ public final MessageSetFlowMode setFlowMode(MessageFlowMode value) {
+ this.flowMode = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSetFlowMode flowMode(MessageFlowMode value) {
+ return setFlowMode(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint8(this.flowMode.getValue());
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.flowMode = MessageFlowMode.get(dec.readUint8());
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("flowMode", getFlowMode());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageStop.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageStop.java
new file mode 100644
index 0000000000..45bb0ffe68
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageStop.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageStop extends Method {
+
+ public static final int TYPE = 1036;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+
+
+ public MessageStop() {}
+
+
+ public MessageStop(String destination, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageStop(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageStop clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageStop setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageStop destination(String value) {
+ return setDestination(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSubscribe.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSubscribe.java
new file mode 100644
index 0000000000..4f9a1edf64
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageSubscribe.java
@@ -0,0 +1,443 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageSubscribe extends Method {
+
+ public static final int TYPE = 1031;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String destination;
+ private MessageAcceptMode acceptMode;
+ private MessageAcquireMode acquireMode;
+ private String resumeId;
+ private long resumeTtl;
+ private Map<String,Object> arguments;
+
+
+ public MessageSubscribe() {}
+
+
+ public MessageSubscribe(String queue, String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, String resumeId, long resumeTtl, Map<String,Object> arguments, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(destination != null) {
+ setDestination(destination);
+ }
+ if(acceptMode != null) {
+ setAcceptMode(acceptMode);
+ }
+ if(acquireMode != null) {
+ setAcquireMode(acquireMode);
+ }
+ if(resumeId != null) {
+ setResumeId(resumeId);
+ }
+ setResumeTtl(resumeTtl);
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case EXCLUSIVE: packing_flags |= 4096; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageSubscribe(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageSubscribe clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final MessageSubscribe setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasDestination() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageSubscribe clearDestination() {
+ packing_flags &= ~512;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageSubscribe setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe destination(String value) {
+ return setDestination(value);
+ }
+
+ public final boolean hasAcceptMode() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final MessageSubscribe clearAcceptMode() {
+ packing_flags &= ~1024;
+ this.acceptMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAcceptMode getAcceptMode() {
+ return acceptMode;
+ }
+
+ public final MessageSubscribe setAcceptMode(MessageAcceptMode value) {
+ this.acceptMode = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe acceptMode(MessageAcceptMode value) {
+ return setAcceptMode(value);
+ }
+
+ public final boolean hasAcquireMode() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final MessageSubscribe clearAcquireMode() {
+ packing_flags &= ~2048;
+ this.acquireMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAcquireMode getAcquireMode() {
+ return acquireMode;
+ }
+
+ public final MessageSubscribe setAcquireMode(MessageAcquireMode value) {
+ this.acquireMode = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe acquireMode(MessageAcquireMode value) {
+ return setAcquireMode(value);
+ }
+
+ public final boolean hasExclusive() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final MessageSubscribe clearExclusive() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExclusive() {
+ return hasExclusive();
+ }
+
+ public final MessageSubscribe setExclusive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe exclusive(boolean value) {
+ return setExclusive(value);
+ }
+
+ public final boolean hasResumeId() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final MessageSubscribe clearResumeId() {
+ packing_flags &= ~8192;
+ this.resumeId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getResumeId() {
+ return resumeId;
+ }
+
+ public final MessageSubscribe setResumeId(String value) {
+ this.resumeId = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe resumeId(String value) {
+ return setResumeId(value);
+ }
+
+ public final boolean hasResumeTtl() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final MessageSubscribe clearResumeTtl() {
+ packing_flags &= ~16384;
+ this.resumeTtl = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getResumeTtl() {
+ return resumeTtl;
+ }
+
+ public final MessageSubscribe setResumeTtl(long value) {
+ this.resumeTtl = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe resumeTtl(long value) {
+ return setResumeTtl(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final MessageSubscribe clearArguments() {
+ packing_flags &= ~32768;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final MessageSubscribe setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageSubscribe arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint8(this.acceptMode.getValue());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeUint8(this.acquireMode.getValue());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeStr16(this.resumeId);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeUint64(this.resumeTtl);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.acceptMode = MessageAcceptMode.get(dec.readUint8());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.acquireMode = MessageAcquireMode.get(dec.readUint8());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.resumeId = dec.readStr16();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.resumeTtl = dec.readUint64();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("acceptMode", getAcceptMode());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("acquireMode", getAcquireMode());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("exclusive", getExclusive());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("resumeId", getResumeId());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("resumeTtl", getResumeTtl());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageTransfer.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageTransfer.java
new file mode 100644
index 0000000000..38fe5d89d8
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MessageTransfer.java
@@ -0,0 +1,302 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import java.nio.ByteBuffer;
+import org.apache.qpid.util.Strings;
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class MessageTransfer extends Method {
+
+ public static final int TYPE = 1025;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return true;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String destination;
+ private MessageAcceptMode acceptMode;
+ private MessageAcquireMode acquireMode;
+ private Header header;
+ private ByteBuffer body;
+
+
+ public MessageTransfer() {}
+
+
+ public MessageTransfer(String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, Header header, java.nio.ByteBuffer body, Option ... _options) {
+ if(destination != null) {
+ setDestination(destination);
+ }
+ if(acceptMode != null) {
+ setAcceptMode(acceptMode);
+ }
+ if(acquireMode != null) {
+ setAcquireMode(acquireMode);
+ }
+ setHeader(header);
+ setBody(body);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.messageTransfer(context, this);
+ }
+
+
+ public final boolean hasDestination() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final MessageTransfer clearDestination() {
+ packing_flags &= ~256;
+ this.destination = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getDestination() {
+ return destination;
+ }
+
+ public final MessageTransfer setDestination(String value) {
+ this.destination = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageTransfer destination(String value) {
+ return setDestination(value);
+ }
+
+ public final boolean hasAcceptMode() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final MessageTransfer clearAcceptMode() {
+ packing_flags &= ~512;
+ this.acceptMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAcceptMode getAcceptMode() {
+ return acceptMode;
+ }
+
+ public final MessageTransfer setAcceptMode(MessageAcceptMode value) {
+ this.acceptMode = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageTransfer acceptMode(MessageAcceptMode value) {
+ return setAcceptMode(value);
+ }
+
+ public final boolean hasAcquireMode() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final MessageTransfer clearAcquireMode() {
+ packing_flags &= ~1024;
+ this.acquireMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageAcquireMode getAcquireMode() {
+ return acquireMode;
+ }
+
+ public final MessageTransfer setAcquireMode(MessageAcquireMode value) {
+ this.acquireMode = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageTransfer acquireMode(MessageAcquireMode value) {
+ return setAcquireMode(value);
+ }
+
+
+ public final Header getHeader() {
+ return this.header;
+ }
+
+ public final void setHeader(Header header) {
+ this.header = header;
+ }
+
+ public final MessageTransfer header(Header header) {
+ setHeader(header);
+ return this;
+ }
+
+ public int getBodySize()
+ {
+ return this.body == null ? 0 : this.body.remaining();
+ }
+
+ public final ByteBuffer getBody() {
+ if (this.body == null)
+ {
+ return null;
+ }
+ else
+ {
+ return this.body.slice();
+ }
+ }
+
+ public final void setBody(ByteBuffer body) {
+ this.body = body;
+ }
+
+ public final MessageTransfer body(ByteBuffer body)
+ {
+ setBody(body);
+ return this;
+ }
+
+ public final byte[] getBodyBytes() {
+ ByteBuffer buf = getBody();
+ byte[] bytes = new byte[buf.remaining()];
+ buf.get(bytes);
+ return bytes;
+ }
+
+ public final void setBody(byte[] body)
+ {
+ setBody(ByteBuffer.wrap(body));
+ }
+
+ public final String getBodyString() {
+ return Strings.fromUTF8(getBodyBytes());
+ }
+
+ public final void setBody(String body) {
+ setBody(Strings.toUTF8(body));
+ }
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.destination);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint8(this.acceptMode.getValue());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint8(this.acquireMode.getValue());
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.destination = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.acceptMode = MessageAcceptMode.get(dec.readUint8());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.acquireMode = MessageAcquireMode.get(dec.readUint8());
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("destination", getDestination());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("acceptMode", getAcceptMode());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("acquireMode", getAcquireMode());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java
new file mode 100644
index 0000000000..33f52d9f2b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java
@@ -0,0 +1,217 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public abstract class MethodDelegate<C> {
+
+ public abstract void handle(C context, Method method);
+
+ public void connectionStart(C context, ConnectionStart method) {
+ handle(context, method);
+ }
+ public void connectionStartOk(C context, ConnectionStartOk method) {
+ handle(context, method);
+ }
+ public void connectionSecure(C context, ConnectionSecure method) {
+ handle(context, method);
+ }
+ public void connectionSecureOk(C context, ConnectionSecureOk method) {
+ handle(context, method);
+ }
+ public void connectionTune(C context, ConnectionTune method) {
+ handle(context, method);
+ }
+ public void connectionTuneOk(C context, ConnectionTuneOk method) {
+ handle(context, method);
+ }
+ public void connectionOpen(C context, ConnectionOpen method) {
+ handle(context, method);
+ }
+ public void connectionOpenOk(C context, ConnectionOpenOk method) {
+ handle(context, method);
+ }
+ public void connectionRedirect(C context, ConnectionRedirect method) {
+ handle(context, method);
+ }
+ public void connectionHeartbeat(C context, ConnectionHeartbeat method) {
+ handle(context, method);
+ }
+ public void connectionClose(C context, ConnectionClose method) {
+ handle(context, method);
+ }
+ public void connectionCloseOk(C context, ConnectionCloseOk method) {
+ handle(context, method);
+ }
+ public void sessionAttach(C context, SessionAttach method) {
+ handle(context, method);
+ }
+ public void sessionAttached(C context, SessionAttached method) {
+ handle(context, method);
+ }
+ public void sessionDetach(C context, SessionDetach method) {
+ handle(context, method);
+ }
+ public void sessionDetached(C context, SessionDetached method) {
+ handle(context, method);
+ }
+ public void sessionRequestTimeout(C context, SessionRequestTimeout method) {
+ handle(context, method);
+ }
+ public void sessionTimeout(C context, SessionTimeout method) {
+ handle(context, method);
+ }
+ public void sessionCommandPoint(C context, SessionCommandPoint method) {
+ handle(context, method);
+ }
+ public void sessionExpected(C context, SessionExpected method) {
+ handle(context, method);
+ }
+ public void sessionConfirmed(C context, SessionConfirmed method) {
+ handle(context, method);
+ }
+ public void sessionCompleted(C context, SessionCompleted method) {
+ handle(context, method);
+ }
+ public void sessionKnownCompleted(C context, SessionKnownCompleted method) {
+ handle(context, method);
+ }
+ public void sessionFlush(C context, SessionFlush method) {
+ handle(context, method);
+ }
+ public void sessionGap(C context, SessionGap method) {
+ handle(context, method);
+ }
+ public void executionSync(C context, ExecutionSync method) {
+ handle(context, method);
+ }
+ public void executionResult(C context, ExecutionResult method) {
+ handle(context, method);
+ }
+ public void executionException(C context, ExecutionException method) {
+ handle(context, method);
+ }
+ public void messageTransfer(C context, MessageTransfer method) {
+ handle(context, method);
+ }
+ public void messageAccept(C context, MessageAccept method) {
+ handle(context, method);
+ }
+ public void messageReject(C context, MessageReject method) {
+ handle(context, method);
+ }
+ public void messageRelease(C context, MessageRelease method) {
+ handle(context, method);
+ }
+ public void messageAcquire(C context, MessageAcquire method) {
+ handle(context, method);
+ }
+ public void messageResume(C context, MessageResume method) {
+ handle(context, method);
+ }
+ public void messageSubscribe(C context, MessageSubscribe method) {
+ handle(context, method);
+ }
+ public void messageCancel(C context, MessageCancel method) {
+ handle(context, method);
+ }
+ public void messageSetFlowMode(C context, MessageSetFlowMode method) {
+ handle(context, method);
+ }
+ public void messageFlow(C context, MessageFlow method) {
+ handle(context, method);
+ }
+ public void messageFlush(C context, MessageFlush method) {
+ handle(context, method);
+ }
+ public void messageStop(C context, MessageStop method) {
+ handle(context, method);
+ }
+ public void txSelect(C context, TxSelect method) {
+ handle(context, method);
+ }
+ public void txCommit(C context, TxCommit method) {
+ handle(context, method);
+ }
+ public void txRollback(C context, TxRollback method) {
+ handle(context, method);
+ }
+ public void dtxSelect(C context, DtxSelect method) {
+ handle(context, method);
+ }
+ public void dtxStart(C context, DtxStart method) {
+ handle(context, method);
+ }
+ public void dtxEnd(C context, DtxEnd method) {
+ handle(context, method);
+ }
+ public void dtxCommit(C context, DtxCommit method) {
+ handle(context, method);
+ }
+ public void dtxForget(C context, DtxForget method) {
+ handle(context, method);
+ }
+ public void dtxGetTimeout(C context, DtxGetTimeout method) {
+ handle(context, method);
+ }
+ public void dtxPrepare(C context, DtxPrepare method) {
+ handle(context, method);
+ }
+ public void dtxRecover(C context, DtxRecover method) {
+ handle(context, method);
+ }
+ public void dtxRollback(C context, DtxRollback method) {
+ handle(context, method);
+ }
+ public void dtxSetTimeout(C context, DtxSetTimeout method) {
+ handle(context, method);
+ }
+ public void exchangeDeclare(C context, ExchangeDeclare method) {
+ handle(context, method);
+ }
+ public void exchangeDelete(C context, ExchangeDelete method) {
+ handle(context, method);
+ }
+ public void exchangeQuery(C context, ExchangeQuery method) {
+ handle(context, method);
+ }
+ public void exchangeBind(C context, ExchangeBind method) {
+ handle(context, method);
+ }
+ public void exchangeUnbind(C context, ExchangeUnbind method) {
+ handle(context, method);
+ }
+ public void exchangeBound(C context, ExchangeBound method) {
+ handle(context, method);
+ }
+ public void queueDeclare(C context, QueueDeclare method) {
+ handle(context, method);
+ }
+ public void queueDelete(C context, QueueDelete method) {
+ handle(context, method);
+ }
+ public void queuePurge(C context, QueuePurge method) {
+ handle(context, method);
+ }
+ public void queueQuery(C context, QueueQuery method) {
+ handle(context, method);
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java
new file mode 100644
index 0000000000..72187795b3
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java
@@ -0,0 +1,60 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum Option {
+
+ SYNC,
+ DISCARD_UNROUTABLE,
+ IMMEDIATE,
+ REDELIVERED,
+ FIRST,
+ LAST,
+ DURABLE,
+ NOT_FOUND,
+ EXCHANGE_NOT_FOUND,
+ QUEUE_NOT_FOUND,
+ QUEUE_NOT_MATCHED,
+ KEY_NOT_MATCHED,
+ ARGS_NOT_MATCHED,
+ EXCLUSIVE,
+ AUTO_DELETE,
+ INSIST,
+ FORCE,
+ TIMELY_REPLY,
+ EXPECTED,
+ CONFIRMED,
+ COMPLETED,
+ SET_REDELIVERED,
+ JOIN,
+ RESUME,
+ FAIL,
+ SUSPEND,
+ ONE_PHASE,
+ PASSIVE,
+ IF_UNUSED,
+ IF_EMPTY,
+
+ BATCH,
+ UNRELIABLE,
+ NONE
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java
new file mode 100644
index 0000000000..2b7495e622
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java
@@ -0,0 +1,394 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class QueueDeclare extends Method {
+
+ public static final int TYPE = 2049;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String alternateExchange;
+ private Map<String,Object> arguments;
+
+
+ public QueueDeclare() {}
+
+
+ public QueueDeclare(String queue, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(alternateExchange != null) {
+ setAlternateExchange(alternateExchange);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case PASSIVE: packing_flags |= 1024; break;
+ case DURABLE: packing_flags |= 2048; break;
+ case EXCLUSIVE: packing_flags |= 4096; break;
+ case AUTO_DELETE: packing_flags |= 8192; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.queueDeclare(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueDeclare clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueDeclare setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasAlternateExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueDeclare clearAlternateExchange() {
+ packing_flags &= ~512;
+ this.alternateExchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getAlternateExchange() {
+ return alternateExchange;
+ }
+
+ public final QueueDeclare setAlternateExchange(String value) {
+ this.alternateExchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare alternateExchange(String value) {
+ return setAlternateExchange(value);
+ }
+
+ public final boolean hasPassive() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueDeclare clearPassive() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getPassive() {
+ return hasPassive();
+ }
+
+ public final QueueDeclare setPassive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare passive(boolean value) {
+ return setPassive(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final QueueDeclare clearDurable() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final QueueDeclare setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasExclusive() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final QueueDeclare clearExclusive() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExclusive() {
+ return hasExclusive();
+ }
+
+ public final QueueDeclare setExclusive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare exclusive(boolean value) {
+ return setExclusive(value);
+ }
+
+ public final boolean hasAutoDelete() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final QueueDeclare clearAutoDelete() {
+ packing_flags &= ~8192;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getAutoDelete() {
+ return hasAutoDelete();
+ }
+
+ public final QueueDeclare setAutoDelete(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 8192;
+ }
+ else
+ {
+ packing_flags &= ~8192;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare autoDelete(boolean value) {
+ return setAutoDelete(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final QueueDeclare clearArguments() {
+ packing_flags &= ~16384;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final QueueDeclare setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.alternateExchange);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.alternateExchange = dec.readStr8();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("alternateExchange", getAlternateExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("passive", getPassive());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("exclusive", getExclusive());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("autoDelete", getAutoDelete());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java
new file mode 100644
index 0000000000..2c0040ff1d
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class QueueDelete extends Method {
+
+ public static final int TYPE = 2050;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+
+
+ public QueueDelete() {}
+
+
+ public QueueDelete(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case IF_UNUSED: packing_flags |= 512; break;
+ case IF_EMPTY: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.queueDelete(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueDelete clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueDelete setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasIfUnused() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueDelete clearIfUnused() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getIfUnused() {
+ return hasIfUnused();
+ }
+
+ public final QueueDelete setIfUnused(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete ifUnused(boolean value) {
+ return setIfUnused(value);
+ }
+
+ public final boolean hasIfEmpty() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueDelete clearIfEmpty() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getIfEmpty() {
+ return hasIfEmpty();
+ }
+
+ public final QueueDelete setIfEmpty(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete ifEmpty(boolean value) {
+ return setIfEmpty(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("ifUnused", getIfUnused());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("ifEmpty", getIfEmpty());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java
new file mode 100644
index 0000000000..972149e251
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class QueuePurge extends Method {
+
+ public static final int TYPE = 2051;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+
+
+ public QueuePurge() {}
+
+
+ public QueuePurge(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.queuePurge(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueuePurge clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueuePurge setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueuePurge queue(String value) {
+ return setQueue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java
new file mode 100644
index 0000000000..22da74f6b7
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class QueueQuery extends Method {
+
+ public static final int TYPE = 2052;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+
+
+ public QueueQuery() {}
+
+
+ public QueueQuery(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.queueQuery(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueQuery clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueQuery setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQuery queue(String value) {
+ return setQueue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java
new file mode 100644
index 0000000000..ca0c027603
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java
@@ -0,0 +1,429 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class QueueQueryResult extends Struct {
+
+ public static final int TYPE = 2049;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String alternateExchange;
+ private Map<String,Object> arguments;
+ private long messageCount;
+ private long subscriberCount;
+
+
+ public QueueQueryResult() {}
+
+
+ public QueueQueryResult(String queue, String alternateExchange, Map<String,Object> arguments, long messageCount, long subscriberCount, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(alternateExchange != null) {
+ setAlternateExchange(alternateExchange);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+ setMessageCount(messageCount);
+ setSubscriberCount(subscriberCount);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case DURABLE: packing_flags |= 1024; break;
+ case EXCLUSIVE: packing_flags |= 2048; break;
+ case AUTO_DELETE: packing_flags |= 4096; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueQueryResult clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueQueryResult setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasAlternateExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueQueryResult clearAlternateExchange() {
+ packing_flags &= ~512;
+ this.alternateExchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getAlternateExchange() {
+ return alternateExchange;
+ }
+
+ public final QueueQueryResult setAlternateExchange(String value) {
+ this.alternateExchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult alternateExchange(String value) {
+ return setAlternateExchange(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueQueryResult clearDurable() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final QueueQueryResult setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasExclusive() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final QueueQueryResult clearExclusive() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExclusive() {
+ return hasExclusive();
+ }
+
+ public final QueueQueryResult setExclusive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult exclusive(boolean value) {
+ return setExclusive(value);
+ }
+
+ public final boolean hasAutoDelete() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final QueueQueryResult clearAutoDelete() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getAutoDelete() {
+ return hasAutoDelete();
+ }
+
+ public final QueueQueryResult setAutoDelete(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult autoDelete(boolean value) {
+ return setAutoDelete(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final QueueQueryResult clearArguments() {
+ packing_flags &= ~8192;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final QueueQueryResult setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+ public final boolean hasMessageCount() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final QueueQueryResult clearMessageCount() {
+ packing_flags &= ~16384;
+ this.messageCount = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getMessageCount() {
+ return messageCount;
+ }
+
+ public final QueueQueryResult setMessageCount(long value) {
+ this.messageCount = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult messageCount(long value) {
+ return setMessageCount(value);
+ }
+
+ public final boolean hasSubscriberCount() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final QueueQueryResult clearSubscriberCount() {
+ packing_flags &= ~32768;
+ this.subscriberCount = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getSubscriberCount() {
+ return subscriberCount;
+ }
+
+ public final QueueQueryResult setSubscriberCount(long value) {
+ this.subscriberCount = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult subscriberCount(long value) {
+ return setSubscriberCount(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.alternateExchange);
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeUint32(this.messageCount);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeUint32(this.subscriberCount);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.alternateExchange = dec.readStr8();
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.messageCount = dec.readUint32();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.subscriberCount = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("alternateExchange", getAlternateExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("exclusive", getExclusive());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("autoDelete", getAutoDelete());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("messageCount", getMessageCount());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("subscriberCount", getSubscriberCount());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java
new file mode 100644
index 0000000000..7a78f373f6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java
@@ -0,0 +1,141 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class RecoverResult extends Struct {
+
+ public static final int TYPE = 1539;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private java.util.List<Object> inDoubt;
+
+
+ public RecoverResult() {}
+
+
+ public RecoverResult(java.util.List<Object> inDoubt) {
+ if(inDoubt != null) {
+ setInDoubt(inDoubt);
+ }
+
+ }
+
+
+
+
+ public final boolean hasInDoubt() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final RecoverResult clearInDoubt() {
+ packing_flags &= ~256;
+ this.inDoubt = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getInDoubt() {
+ return inDoubt;
+ }
+
+ public final RecoverResult setInDoubt(java.util.List<Object> value) {
+ this.inDoubt = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final RecoverResult inDoubt(java.util.List<Object> value) {
+ return setInDoubt(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeArray(this.inDoubt);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.inDoubt = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("inDoubt", getInDoubt());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java
new file mode 100644
index 0000000000..38340db5ce
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java
@@ -0,0 +1,200 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class ReplyTo extends Struct {
+
+ public static final int TYPE = -3;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 2;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String exchange;
+ private String routingKey;
+
+
+ public ReplyTo() {}
+
+
+ public ReplyTo(String exchange, String routingKey) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(routingKey != null) {
+ setRoutingKey(routingKey);
+ }
+
+ }
+
+
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ReplyTo clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ReplyTo setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ReplyTo exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasRoutingKey() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ReplyTo clearRoutingKey() {
+ packing_flags &= ~512;
+ this.routingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getRoutingKey() {
+ return routingKey;
+ }
+
+ public final ReplyTo setRoutingKey(String value) {
+ this.routingKey = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ReplyTo routingKey(String value) {
+ return setRoutingKey(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.routingKey);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.routingKey = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("routingKey", getRoutingKey());
+ }
+
+
+ return result;
+ }
+
+ public boolean equals(final Object obj){
+ if (this == obj){
+ return true;
+ }
+
+ if(!(obj instanceof ReplyTo)){
+ return false;
+ }
+
+ final ReplyTo reply = (ReplyTo) obj;
+ return (routingKey == null ? reply.getRoutingKey() == null : routingKey.equals(reply.getRoutingKey()))
+ && (exchange == null ? reply.getExchange() == null : exchange.equals(reply.getExchange()));
+ }
+
+ public int hashCode(){
+ int result = routingKey == null ? 1 : routingKey.hashCode();
+ return 31 * result + (exchange == null ? 5 : exchange.hashCode());
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java
new file mode 100644
index 0000000000..c9ba87abf4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java
@@ -0,0 +1,54 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum SegmentType {
+
+ CONTROL((short) 0),
+ COMMAND((short) 1),
+ HEADER((short) 2),
+ BODY((short) 3);
+
+ private final short value;
+
+ SegmentType(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static SegmentType get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return CONTROL;
+ case (short) 1: return COMMAND;
+ case (short) 2: return HEADER;
+ case (short) 3: return BODY;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java
new file mode 100644
index 0000000000..cc056c2157
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionAttach extends Method {
+
+ public static final int TYPE = 513;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+
+
+ public SessionAttach() {}
+
+
+ public SessionAttach(byte[] name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case FORCE: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionAttach(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionAttach clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionAttach setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttach name(byte[] value) {
+ return setName(value);
+ }
+
+ public final boolean hasForce() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionAttach clearForce() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getForce() {
+ return hasForce();
+ }
+
+ public final SessionAttach setForce(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttach force(boolean value) {
+ return setForce(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("force", getForce());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java
new file mode 100644
index 0000000000..edba391120
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionAttached extends Method {
+
+ public static final int TYPE = 514;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+
+
+ public SessionAttached() {}
+
+
+ public SessionAttached(byte[] name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionAttached(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionAttached clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionAttached setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttached name(byte[] value) {
+ return setName(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java
new file mode 100644
index 0000000000..6ae2d45238
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java
@@ -0,0 +1,138 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class SessionCommandFragment extends Struct {
+
+ public static final int TYPE = -2;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 0;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private int commandId;
+ private RangeSet byteRanges;
+
+
+ public SessionCommandFragment() {}
+
+
+ public SessionCommandFragment(int commandId, RangeSet byteRanges) {
+ setCommandId(commandId);
+ if(byteRanges != null) {
+ setByteRanges(byteRanges);
+ }
+
+ }
+
+
+
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final SessionCommandFragment setCommandId(int value) {
+ this.commandId = value;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandFragment commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final RangeSet getByteRanges() {
+ return byteRanges;
+ }
+
+ public final SessionCommandFragment setByteRanges(RangeSet value) {
+ this.byteRanges = value;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandFragment byteRanges(RangeSet value) {
+ return setByteRanges(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeSequenceNo(this.commandId);
+ enc.writeByteRanges(this.byteRanges);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ this.commandId = dec.readSequenceNo();
+ this.byteRanges = dec.readByteRanges();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ result.put("commandId", getCommandId());
+ result.put("byteRanges", getByteRanges());
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java
new file mode 100644
index 0000000000..b0bb0559fe
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java
@@ -0,0 +1,192 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionCommandPoint extends Method {
+
+ public static final int TYPE = 519;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private int commandId;
+ private long commandOffset;
+
+
+ public SessionCommandPoint() {}
+
+
+ public SessionCommandPoint(int commandId, long commandOffset, Option ... _options) {
+ setCommandId(commandId);
+ setCommandOffset(commandOffset);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionCommandPoint(context, this);
+ }
+
+
+ public final boolean hasCommandId() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionCommandPoint clearCommandId() {
+ packing_flags &= ~256;
+ this.commandId = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final SessionCommandPoint setCommandId(int value) {
+ this.commandId = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandPoint commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final boolean hasCommandOffset() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionCommandPoint clearCommandOffset() {
+ packing_flags &= ~512;
+ this.commandOffset = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getCommandOffset() {
+ return commandOffset;
+ }
+
+ public final SessionCommandPoint setCommandOffset(long value) {
+ this.commandOffset = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandPoint commandOffset(long value) {
+ return setCommandOffset(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceNo(this.commandId);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint64(this.commandOffset);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commandId = dec.readSequenceNo();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.commandOffset = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commandId", getCommandId());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("commandOffset", getCommandOffset());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java
new file mode 100644
index 0000000000..2b30f376b2
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionCompleted extends Method {
+
+ public static final int TYPE = 522;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+
+
+ public SessionCompleted() {}
+
+
+ public SessionCompleted(RangeSet commands, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case TIMELY_REPLY: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionCompleted(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionCompleted clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionCompleted setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCompleted commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+ public final boolean hasTimelyReply() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionCompleted clearTimelyReply() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getTimelyReply() {
+ return hasTimelyReply();
+ }
+
+ public final SessionCompleted setTimelyReply(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCompleted timelyReply(boolean value) {
+ return setTimelyReply(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("timelyReply", getTimelyReply());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java
new file mode 100644
index 0000000000..d162fb8e10
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionConfirmed extends Method {
+
+ public static final int TYPE = 521;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+ private java.util.List<Object> fragments;
+
+
+ public SessionConfirmed() {}
+
+
+ public SessionConfirmed(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+ if(fragments != null) {
+ setFragments(fragments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionConfirmed(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionConfirmed clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionConfirmed setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionConfirmed commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+ public final boolean hasFragments() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionConfirmed clearFragments() {
+ packing_flags &= ~512;
+ this.fragments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getFragments() {
+ return fragments;
+ }
+
+ public final SessionConfirmed setFragments(java.util.List<Object> value) {
+ this.fragments = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionConfirmed fragments(java.util.List<Object> value) {
+ return setFragments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.fragments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.fragments = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("fragments", getFragments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java
new file mode 100644
index 0000000000..c6f8e9bad4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionDetach extends Method {
+
+ public static final int TYPE = 515;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+
+
+ public SessionDetach() {}
+
+
+ public SessionDetach(byte[] name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionDetach(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionDetach clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionDetach setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionDetach name(byte[] value) {
+ return setName(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java
new file mode 100644
index 0000000000..892f0edc36
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java
@@ -0,0 +1,56 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum SessionDetachCode {
+
+ NORMAL((short) 0),
+ SESSION_BUSY((short) 1),
+ TRANSPORT_BUSY((short) 2),
+ NOT_ATTACHED((short) 3),
+ UNKNOWN_IDS((short) 4);
+
+ private final short value;
+
+ SessionDetachCode(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static SessionDetachCode get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return NORMAL;
+ case (short) 1: return SESSION_BUSY;
+ case (short) 2: return TRANSPORT_BUSY;
+ case (short) 3: return NOT_ATTACHED;
+ case (short) 4: return UNKNOWN_IDS;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java
new file mode 100644
index 0000000000..d577d7c28a
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionDetached extends Method {
+
+ public static final int TYPE = 516;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+ private SessionDetachCode code;
+
+
+ public SessionDetached() {}
+
+
+ public SessionDetached(byte[] name, SessionDetachCode code, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+ if(code != null) {
+ setCode(code);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionDetached(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionDetached clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionDetached setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionDetached name(byte[] value) {
+ return setName(value);
+ }
+
+ public final boolean hasCode() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionDetached clearCode() {
+ packing_flags &= ~512;
+ this.code = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionDetachCode getCode() {
+ return code;
+ }
+
+ public final SessionDetached setCode(SessionDetachCode value) {
+ this.code = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionDetached code(SessionDetachCode value) {
+ return setCode(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint8(this.code.getValue());
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.code = SessionDetachCode.get(dec.readUint8());
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("code", getCode());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java
new file mode 100644
index 0000000000..324316f88c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java
@@ -0,0 +1,196 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionExpected extends Method {
+
+ public static final int TYPE = 520;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+ private java.util.List<Object> fragments;
+
+
+ public SessionExpected() {}
+
+
+ public SessionExpected(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+ if(fragments != null) {
+ setFragments(fragments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionExpected(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionExpected clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionExpected setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionExpected commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+ public final boolean hasFragments() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionExpected clearFragments() {
+ packing_flags &= ~512;
+ this.fragments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getFragments() {
+ return fragments;
+ }
+
+ public final SessionExpected setFragments(java.util.List<Object> value) {
+ this.fragments = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionExpected fragments(java.util.List<Object> value) {
+ return setFragments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.fragments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.fragments = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("fragments", getFragments());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java
new file mode 100644
index 0000000000..193fe9b255
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java
@@ -0,0 +1,229 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionFlush extends Method {
+
+ public static final int TYPE = 524;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+ public SessionFlush() {}
+
+
+ public SessionFlush(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case EXPECTED: packing_flags |= 256; break;
+ case CONFIRMED: packing_flags |= 512; break;
+ case COMPLETED: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionFlush(context, this);
+ }
+
+
+ public final boolean hasExpected() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionFlush clearExpected() {
+ packing_flags &= ~256;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExpected() {
+ return hasExpected();
+ }
+
+ public final SessionFlush setExpected(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 256;
+ }
+ else
+ {
+ packing_flags &= ~256;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionFlush expected(boolean value) {
+ return setExpected(value);
+ }
+
+ public final boolean hasConfirmed() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionFlush clearConfirmed() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getConfirmed() {
+ return hasConfirmed();
+ }
+
+ public final SessionFlush setConfirmed(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionFlush confirmed(boolean value) {
+ return setConfirmed(value);
+ }
+
+ public final boolean hasCompleted() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final SessionFlush clearCompleted() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getCompleted() {
+ return hasCompleted();
+ }
+
+ public final SessionFlush setCompleted(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionFlush completed(boolean value) {
+ return setCompleted(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("expected", getExpected());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("confirmed", getConfirmed());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("completed", getCompleted());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java
new file mode 100644
index 0000000000..62cf753df6
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionGap extends Method {
+
+ public static final int TYPE = 525;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+
+
+ public SessionGap() {}
+
+
+ public SessionGap(RangeSet commands, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionGap(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionGap clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionGap setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionGap commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java
new file mode 100644
index 0000000000..9287d594b1
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java
@@ -0,0 +1,145 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class SessionHeader extends Struct {
+
+ public static final int TYPE = -1;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 1;
+ }
+
+ public final int getPackWidth() {
+ return 1;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private byte packing_flags = 0;
+
+
+ public SessionHeader() {}
+
+
+ public SessionHeader(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: packing_flags |= 1; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasSync() {
+ return (packing_flags & 1) != 0;
+ }
+
+ public final SessionHeader clearSync() {
+ packing_flags &= ~1;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getSync() {
+ return hasSync();
+ }
+
+ public final SessionHeader setSync(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1;
+ }
+ else
+ {
+ packing_flags &= ~1;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionHeader sync(boolean value) {
+ return setSync(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint8(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (byte) dec.readUint8();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 1) != 0)
+ {
+ result.put("sync", getSync());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java
new file mode 100644
index 0000000000..2d5c54d96c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java
@@ -0,0 +1,236 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.Map;
+
+public abstract class SessionInvoker {
+
+ final void sessionAttach(byte[] name, Option ... _options) {
+ invoke(new SessionAttach(name, _options));
+ }
+
+ final void sessionAttached(byte[] name, Option ... _options) {
+ invoke(new SessionAttached(name, _options));
+ }
+
+ final void sessionDetach(byte[] name, Option ... _options) {
+ invoke(new SessionDetach(name, _options));
+ }
+
+ final void sessionDetached(byte[] name, SessionDetachCode code, Option ... _options) {
+ invoke(new SessionDetached(name, code, _options));
+ }
+
+ final void sessionRequestTimeout(long timeout, Option ... _options) {
+ invoke(new SessionRequestTimeout(timeout, _options));
+ }
+
+ final void sessionTimeout(long timeout, Option ... _options) {
+ invoke(new SessionTimeout(timeout, _options));
+ }
+
+ final void sessionCommandPoint(int commandId, long commandOffset, Option ... _options) {
+ invoke(new SessionCommandPoint(commandId, commandOffset, _options));
+ }
+
+ final void sessionExpected(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+ invoke(new SessionExpected(commands, fragments, _options));
+ }
+
+ final void sessionConfirmed(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+ invoke(new SessionConfirmed(commands, fragments, _options));
+ }
+
+ final void sessionCompleted(RangeSet commands, Option ... _options) {
+ invoke(new SessionCompleted(commands, _options));
+ }
+
+ final void sessionKnownCompleted(RangeSet commands, Option ... _options) {
+ invoke(new SessionKnownCompleted(commands, _options));
+ }
+
+ final void sessionFlush(Option ... _options) {
+ invoke(new SessionFlush(_options));
+ }
+
+ final void sessionGap(RangeSet commands, Option ... _options) {
+ invoke(new SessionGap(commands, _options));
+ }
+
+ public final void executionSync(Option ... _options) {
+ invoke(new ExecutionSync(_options));
+ }
+
+ public final void executionResult(int commandId, Struct value, Option ... _options) {
+ invoke(new ExecutionResult(commandId, value, _options));
+ }
+
+ public final void executionException(ExecutionErrorCode errorCode, int commandId, short classCode, short commandCode, short fieldIndex, String description, Map<String,Object> errorInfo, Option ... _options) {
+ invoke(new ExecutionException(errorCode, commandId, classCode, commandCode, fieldIndex, description, errorInfo, _options));
+ }
+
+ public final void messageTransfer(String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, Header header, java.nio.ByteBuffer body, Option ... _options) {
+ invoke(new MessageTransfer(destination, acceptMode, acquireMode, header, body, _options));
+ }
+
+ public final void messageAccept(RangeSet transfers, Option ... _options) {
+ invoke(new MessageAccept(transfers, _options));
+ }
+
+ public final void messageReject(RangeSet transfers, MessageRejectCode code, String text, Option ... _options) {
+ invoke(new MessageReject(transfers, code, text, _options));
+ }
+
+ public final void messageRelease(RangeSet transfers, Option ... _options) {
+ invoke(new MessageRelease(transfers, _options));
+ }
+
+ public final Future<Acquired> messageAcquire(RangeSet transfers, Option ... _options) {
+ return invoke(new MessageAcquire(transfers, _options), Acquired.class);
+ }
+
+ public final Future<MessageResumeResult> messageResume(String destination, String resumeId, Option ... _options) {
+ return invoke(new MessageResume(destination, resumeId, _options), MessageResumeResult.class);
+ }
+
+ public final void messageSubscribe(String queue, String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, String resumeId, long resumeTtl, Map<String,Object> arguments, Option ... _options) {
+ invoke(new MessageSubscribe(queue, destination, acceptMode, acquireMode, resumeId, resumeTtl, arguments, _options));
+ }
+
+ public final void messageCancel(String destination, Option ... _options) {
+ invoke(new MessageCancel(destination, _options));
+ }
+
+ public final void messageSetFlowMode(String destination, MessageFlowMode flowMode, Option ... _options) {
+ invoke(new MessageSetFlowMode(destination, flowMode, _options));
+ }
+
+ public final void messageFlow(String destination, MessageCreditUnit unit, long value, Option ... _options) {
+ invoke(new MessageFlow(destination, unit, value, _options));
+ }
+
+ public final void messageFlush(String destination, Option ... _options) {
+ invoke(new MessageFlush(destination, _options));
+ }
+
+ public final void messageStop(String destination, Option ... _options) {
+ invoke(new MessageStop(destination, _options));
+ }
+
+ public final void txSelect(Option ... _options) {
+ invoke(new TxSelect(_options));
+ }
+
+ public final void txCommit(Option ... _options) {
+ invoke(new TxCommit(_options));
+ }
+
+ public final void txRollback(Option ... _options) {
+ invoke(new TxRollback(_options));
+ }
+
+ public final void dtxSelect(Option ... _options) {
+ invoke(new DtxSelect(_options));
+ }
+
+ public final Future<XaResult> dtxStart(Xid xid, Option ... _options) {
+ return invoke(new DtxStart(xid, _options), XaResult.class);
+ }
+
+ public final Future<XaResult> dtxEnd(Xid xid, Option ... _options) {
+ return invoke(new DtxEnd(xid, _options), XaResult.class);
+ }
+
+ public final Future<XaResult> dtxCommit(Xid xid, Option ... _options) {
+ return invoke(new DtxCommit(xid, _options), XaResult.class);
+ }
+
+ public final void dtxForget(Xid xid, Option ... _options) {
+ invoke(new DtxForget(xid, _options));
+ }
+
+ public final Future<GetTimeoutResult> dtxGetTimeout(Xid xid, Option ... _options) {
+ return invoke(new DtxGetTimeout(xid, _options), GetTimeoutResult.class);
+ }
+
+ public final Future<XaResult> dtxPrepare(Xid xid, Option ... _options) {
+ return invoke(new DtxPrepare(xid, _options), XaResult.class);
+ }
+
+ public final Future<RecoverResult> dtxRecover(Option ... _options) {
+ return invoke(new DtxRecover(_options), RecoverResult.class);
+ }
+
+ public final Future<XaResult> dtxRollback(Xid xid, Option ... _options) {
+ return invoke(new DtxRollback(xid, _options), XaResult.class);
+ }
+
+ public final void dtxSetTimeout(Xid xid, long timeout, Option ... _options) {
+ invoke(new DtxSetTimeout(xid, timeout, _options));
+ }
+
+ public final void exchangeDeclare(String exchange, String type, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+ invoke(new ExchangeDeclare(exchange, type, alternateExchange, arguments, _options));
+ }
+
+ public final void exchangeDelete(String exchange, Option ... _options) {
+ invoke(new ExchangeDelete(exchange, _options));
+ }
+
+ public final Future<ExchangeQueryResult> exchangeQuery(String name, Option ... _options) {
+ return invoke(new ExchangeQuery(name, _options), ExchangeQueryResult.class);
+ }
+
+ public final void exchangeBind(String queue, String exchange, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ invoke(new ExchangeBind(queue, exchange, bindingKey, arguments, _options));
+ }
+
+ public final void exchangeUnbind(String queue, String exchange, String bindingKey, Option ... _options) {
+ invoke(new ExchangeUnbind(queue, exchange, bindingKey, _options));
+ }
+
+ public final Future<ExchangeBoundResult> exchangeBound(String exchange, String queue, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ return invoke(new ExchangeBound(exchange, queue, bindingKey, arguments, _options), ExchangeBoundResult.class);
+ }
+
+ public final void queueDeclare(String queue, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+ invoke(new QueueDeclare(queue, alternateExchange, arguments, _options));
+ }
+
+ public final void queueDelete(String queue, Option ... _options) {
+ invoke(new QueueDelete(queue, _options));
+ }
+
+ public final void queuePurge(String queue, Option ... _options) {
+ invoke(new QueuePurge(queue, _options));
+ }
+
+ public final Future<QueueQueryResult> queueQuery(String queue, Option ... _options) {
+ return invoke(new QueueQuery(queue, _options), QueueQueryResult.class);
+ }
+
+ protected abstract void invoke(Method method);
+
+ protected abstract <T> Future<T> invoke(Method method, Class<T> resultClass);
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java
new file mode 100644
index 0000000000..4f78724ee0
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionKnownCompleted extends Method {
+
+ public static final int TYPE = 523;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+
+
+ public SessionKnownCompleted() {}
+
+
+ public SessionKnownCompleted(RangeSet commands, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionKnownCompleted(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionKnownCompleted clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionKnownCompleted setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionKnownCompleted commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java
new file mode 100644
index 0000000000..7608c8e75e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java
@@ -0,0 +1,152 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionRequestTimeout extends Method {
+
+ public static final int TYPE = 517;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long timeout;
+
+
+ public SessionRequestTimeout() {}
+
+
+ public SessionRequestTimeout(long timeout, Option ... _options) {
+ setTimeout(timeout);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionRequestTimeout(context, this);
+ }
+
+
+ public final boolean hasTimeout() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionRequestTimeout clearTimeout() {
+ packing_flags &= ~256;
+ this.timeout = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimeout() {
+ return timeout;
+ }
+
+ public final SessionRequestTimeout setTimeout(long value) {
+ this.timeout = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionRequestTimeout timeout(long value) {
+ return setTimeout(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint32(this.timeout);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.timeout = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("timeout", getTimeout());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java
new file mode 100644
index 0000000000..cc5054ab28
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java
@@ -0,0 +1,152 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class SessionTimeout extends Method {
+
+ public static final int TYPE = 518;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long timeout;
+
+
+ public SessionTimeout() {}
+
+
+ public SessionTimeout(long timeout, Option ... _options) {
+ setTimeout(timeout);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.sessionTimeout(context, this);
+ }
+
+
+ public final boolean hasTimeout() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionTimeout clearTimeout() {
+ packing_flags &= ~256;
+ this.timeout = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimeout() {
+ return timeout;
+ }
+
+ public final SessionTimeout setTimeout(long value) {
+ this.timeout = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionTimeout timeout(long value) {
+ return setTimeout(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint32(this.timeout);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.timeout = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("timeout", getTimeout());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java
new file mode 100644
index 0000000000..7a4e8c083b
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java
@@ -0,0 +1,52 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum StreamReturnCode {
+
+ CONTENT_TOO_LARGE((int) 311),
+ NO_ROUTE((int) 312),
+ NO_CONSUMERS((int) 313);
+
+ private final int value;
+
+ StreamReturnCode(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static StreamReturnCode get(int value)
+ {
+ switch (value)
+ {
+ case (int) 311: return CONTENT_TOO_LARGE;
+ case (int) 312: return NO_ROUTE;
+ case (int) 313: return NO_CONSUMERS;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java
new file mode 100644
index 0000000000..4dcd02da9f
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java
@@ -0,0 +1,200 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+class StructFactory {
+
+ public static Struct create(int type)
+ {
+ switch (type)
+ {
+ case SessionHeader.TYPE:
+ return new SessionHeader();
+ case SessionCommandFragment.TYPE:
+ return new SessionCommandFragment();
+ case DeliveryProperties.TYPE:
+ return new DeliveryProperties();
+ case FragmentProperties.TYPE:
+ return new FragmentProperties();
+ case ReplyTo.TYPE:
+ return new ReplyTo();
+ case MessageProperties.TYPE:
+ return new MessageProperties();
+ case XaResult.TYPE:
+ return new XaResult();
+ case Xid.TYPE:
+ return new Xid();
+ case Acquired.TYPE:
+ return new Acquired();
+ case MessageResumeResult.TYPE:
+ return new MessageResumeResult();
+ case GetTimeoutResult.TYPE:
+ return new GetTimeoutResult();
+ case RecoverResult.TYPE:
+ return new RecoverResult();
+ case ExchangeQueryResult.TYPE:
+ return new ExchangeQueryResult();
+ case ExchangeBoundResult.TYPE:
+ return new ExchangeBoundResult();
+ case QueueQueryResult.TYPE:
+ return new QueueQueryResult();
+ default:
+ throw new IllegalArgumentException("type: " + type);
+ }
+ }
+
+ public static Struct createInstruction(int type)
+ {
+ switch (type)
+ {
+ case ConnectionStart.TYPE:
+ return new ConnectionStart();
+ case ConnectionStartOk.TYPE:
+ return new ConnectionStartOk();
+ case ConnectionSecure.TYPE:
+ return new ConnectionSecure();
+ case ConnectionSecureOk.TYPE:
+ return new ConnectionSecureOk();
+ case ConnectionTune.TYPE:
+ return new ConnectionTune();
+ case ConnectionTuneOk.TYPE:
+ return new ConnectionTuneOk();
+ case ConnectionOpen.TYPE:
+ return new ConnectionOpen();
+ case ConnectionOpenOk.TYPE:
+ return new ConnectionOpenOk();
+ case ConnectionRedirect.TYPE:
+ return new ConnectionRedirect();
+ case ConnectionHeartbeat.TYPE:
+ return new ConnectionHeartbeat();
+ case ConnectionClose.TYPE:
+ return new ConnectionClose();
+ case ConnectionCloseOk.TYPE:
+ return new ConnectionCloseOk();
+ case SessionAttach.TYPE:
+ return new SessionAttach();
+ case SessionAttached.TYPE:
+ return new SessionAttached();
+ case SessionDetach.TYPE:
+ return new SessionDetach();
+ case SessionDetached.TYPE:
+ return new SessionDetached();
+ case SessionRequestTimeout.TYPE:
+ return new SessionRequestTimeout();
+ case SessionTimeout.TYPE:
+ return new SessionTimeout();
+ case SessionCommandPoint.TYPE:
+ return new SessionCommandPoint();
+ case SessionExpected.TYPE:
+ return new SessionExpected();
+ case SessionConfirmed.TYPE:
+ return new SessionConfirmed();
+ case SessionCompleted.TYPE:
+ return new SessionCompleted();
+ case SessionKnownCompleted.TYPE:
+ return new SessionKnownCompleted();
+ case SessionFlush.TYPE:
+ return new SessionFlush();
+ case SessionGap.TYPE:
+ return new SessionGap();
+ case ExecutionSync.TYPE:
+ return new ExecutionSync();
+ case ExecutionResult.TYPE:
+ return new ExecutionResult();
+ case ExecutionException.TYPE:
+ return new ExecutionException();
+ case MessageTransfer.TYPE:
+ return new MessageTransfer();
+ case MessageAccept.TYPE:
+ return new MessageAccept();
+ case MessageReject.TYPE:
+ return new MessageReject();
+ case MessageRelease.TYPE:
+ return new MessageRelease();
+ case MessageAcquire.TYPE:
+ return new MessageAcquire();
+ case MessageResume.TYPE:
+ return new MessageResume();
+ case MessageSubscribe.TYPE:
+ return new MessageSubscribe();
+ case MessageCancel.TYPE:
+ return new MessageCancel();
+ case MessageSetFlowMode.TYPE:
+ return new MessageSetFlowMode();
+ case MessageFlow.TYPE:
+ return new MessageFlow();
+ case MessageFlush.TYPE:
+ return new MessageFlush();
+ case MessageStop.TYPE:
+ return new MessageStop();
+ case TxSelect.TYPE:
+ return new TxSelect();
+ case TxCommit.TYPE:
+ return new TxCommit();
+ case TxRollback.TYPE:
+ return new TxRollback();
+ case DtxSelect.TYPE:
+ return new DtxSelect();
+ case DtxStart.TYPE:
+ return new DtxStart();
+ case DtxEnd.TYPE:
+ return new DtxEnd();
+ case DtxCommit.TYPE:
+ return new DtxCommit();
+ case DtxForget.TYPE:
+ return new DtxForget();
+ case DtxGetTimeout.TYPE:
+ return new DtxGetTimeout();
+ case DtxPrepare.TYPE:
+ return new DtxPrepare();
+ case DtxRecover.TYPE:
+ return new DtxRecover();
+ case DtxRollback.TYPE:
+ return new DtxRollback();
+ case DtxSetTimeout.TYPE:
+ return new DtxSetTimeout();
+ case ExchangeDeclare.TYPE:
+ return new ExchangeDeclare();
+ case ExchangeDelete.TYPE:
+ return new ExchangeDelete();
+ case ExchangeQuery.TYPE:
+ return new ExchangeQuery();
+ case ExchangeBind.TYPE:
+ return new ExchangeBind();
+ case ExchangeUnbind.TYPE:
+ return new ExchangeUnbind();
+ case ExchangeBound.TYPE:
+ return new ExchangeBound();
+ case QueueDeclare.TYPE:
+ return new QueueDeclare();
+ case QueueDelete.TYPE:
+ return new QueueDelete();
+ case QueuePurge.TYPE:
+ return new QueuePurge();
+ case QueueQuery.TYPE:
+ return new QueueQuery();
+ default:
+ throw new IllegalArgumentException("type: " + type);
+ }
+ }
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java
new file mode 100644
index 0000000000..861a992a83
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java
@@ -0,0 +1,50 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum Track {
+
+ CONTROL((short) 0),
+ COMMAND((short) 1);
+
+ private final short value;
+
+ Track(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static Track get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return CONTROL;
+ case (short) 1: return COMMAND;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java
new file mode 100644
index 0000000000..837aa1e1d4
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class TxCommit extends Method {
+
+ public static final int TYPE = 1282;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public TxCommit(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.txCommit(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java
new file mode 100644
index 0000000000..f8b54f2e5c
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class TxRollback extends Method {
+
+ public static final int TYPE = 1283;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public TxRollback(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.txRollback(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java
new file mode 100644
index 0000000000..6fd886e94e
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class TxSelect extends Method {
+
+ public static final int TYPE = 1281;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public TxSelect(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.txSelect(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java
new file mode 100644
index 0000000000..05904f2995
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java
@@ -0,0 +1,148 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+
+
+public enum Type
+{
+
+ BIN8((byte) 0x00, 1, true),
+ INT8((byte) 0x01, 1, true),
+ UINT8((byte) 0x02, 1, true),
+ CHAR((byte) 0x04, 1, true),
+ BOOLEAN((byte) 0x08, 1, true),
+ BIN16((byte) 0x10, 2, true),
+ INT16((byte) 0x11, 2, true),
+ UINT16((byte) 0x12, 2, true),
+ BIN32((byte) 0x20, 4, true),
+ INT32((byte) 0x21, 4, true),
+ UINT32((byte) 0x22, 4, true),
+ FLOAT((byte) 0x23, 4, true),
+ CHAR_UTF32((byte) 0x27, 4, true),
+ BIN64((byte) 0x30, 8, true),
+ INT64((byte) 0x31, 8, true),
+ UINT64((byte) 0x32, 8, true),
+ DOUBLE((byte) 0x33, 8, true),
+ DATETIME((byte) 0x38, 8, true),
+ BIN128((byte) 0x40, 16, true),
+ UUID((byte) 0x48, 16, true),
+ BIN256((byte) 0x50, 32, true),
+ BIN512((byte) 0x60, 64, true),
+ BIN1024((byte) 0x70, 128, true),
+ VBIN8((byte) 0x80, 1, false),
+ STR8_LATIN((byte) 0x84, 1, false),
+ STR8((byte) 0x85, 1, false),
+ STR8_UTF16((byte) 0x86, 1, false),
+ VBIN16((byte) 0x90, 2, false),
+ STR16_LATIN((byte) 0x94, 2, false),
+ STR16((byte) 0x95, 2, false),
+ STR16_UTF16((byte) 0x96, 2, false),
+ VBIN32((byte) 0xa0, 4, false),
+ MAP((byte) 0xa8, 4, false),
+ LIST((byte) 0xa9, 4, false),
+ ARRAY((byte) 0xaa, 4, false),
+ STRUCT32((byte) 0xab, 4, false),
+ BIN40((byte) 0xc0, 5, true),
+ DEC32((byte) 0xc8, 5, true),
+ BIN72((byte) 0xd0, 9, true),
+ DEC64((byte) 0xd8, 9, true),
+ VOID((byte) 0xf0, 0, true),
+ BIT((byte) 0xf1, 0, true);
+
+ private final byte code;
+ private final int width;
+ private final boolean fixed;
+
+ Type(byte code, int width, boolean fixed)
+ {
+ this.code = code;
+ this.width = width;
+ this.fixed = fixed;
+ }
+
+ public byte getCode()
+ {
+ return code;
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public boolean isFixed()
+ {
+ return fixed;
+ }
+
+ public static Type get(byte code)
+ {
+ switch (code)
+ {
+ case (byte) 0x00: return BIN8;
+ case (byte) 0x01: return INT8;
+ case (byte) 0x02: return UINT8;
+ case (byte) 0x04: return CHAR;
+ case (byte) 0x08: return BOOLEAN;
+ case (byte) 0x10: return BIN16;
+ case (byte) 0x11: return INT16;
+ case (byte) 0x12: return UINT16;
+ case (byte) 0x20: return BIN32;
+ case (byte) 0x21: return INT32;
+ case (byte) 0x22: return UINT32;
+ case (byte) 0x23: return FLOAT;
+ case (byte) 0x27: return CHAR_UTF32;
+ case (byte) 0x30: return BIN64;
+ case (byte) 0x31: return INT64;
+ case (byte) 0x32: return UINT64;
+ case (byte) 0x33: return DOUBLE;
+ case (byte) 0x38: return DATETIME;
+ case (byte) 0x40: return BIN128;
+ case (byte) 0x48: return UUID;
+ case (byte) 0x50: return BIN256;
+ case (byte) 0x60: return BIN512;
+ case (byte) 0x70: return BIN1024;
+ case (byte) 0x80: return VBIN8;
+ case (byte) 0x84: return STR8_LATIN;
+ case (byte) 0x85: return STR8;
+ case (byte) 0x86: return STR8_UTF16;
+ case (byte) 0x90: return VBIN16;
+ case (byte) 0x94: return STR16_LATIN;
+ case (byte) 0x95: return STR16;
+ case (byte) 0x96: return STR16_UTF16;
+ case (byte) 0xa0: return VBIN32;
+ case (byte) 0xa8: return MAP;
+ case (byte) 0xa9: return LIST;
+ case (byte) 0xaa: return ARRAY;
+ case (byte) 0xab: return STRUCT32;
+ case (byte) 0xc0: return BIN40;
+ case (byte) 0xc8: return DEC32;
+ case (byte) 0xd0: return BIN72;
+ case (byte) 0xd8: return DEC64;
+ case (byte) 0xf0: return VOID;
+ case (byte) 0xf1: return BIT;
+
+ default: return null;
+ }
+ }
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java
new file mode 100644
index 0000000000..c9d502f7ea
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java
@@ -0,0 +1,141 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class XaResult extends Struct {
+
+ public static final int TYPE = 1537;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private DtxXaStatus status;
+
+
+ public XaResult() {}
+
+
+ public XaResult(DtxXaStatus status) {
+ if(status != null) {
+ setStatus(status);
+ }
+
+ }
+
+
+
+
+ public final boolean hasStatus() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final XaResult clearStatus() {
+ packing_flags &= ~256;
+ this.status = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxXaStatus getStatus() {
+ return status;
+ }
+
+ public final XaResult setStatus(DtxXaStatus value) {
+ this.status = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final XaResult status(DtxXaStatus value) {
+ return setStatus(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.status.getValue());
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.status = DtxXaStatus.get(dec.readUint16());
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("status", getStatus());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Xid.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Xid.java
new file mode 100644
index 0000000000..4e142079af
--- /dev/null
+++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Xid.java
@@ -0,0 +1,223 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class Xid extends Struct {
+
+ public static final int TYPE = 1540;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private long format;
+ private byte[] globalId;
+ private byte[] branchId;
+
+
+ public Xid() {}
+
+
+ public Xid(long format, byte[] globalId, byte[] branchId) {
+ setFormat(format);
+ if(globalId != null) {
+ setGlobalId(globalId);
+ }
+ if(branchId != null) {
+ setBranchId(branchId);
+ }
+
+ }
+
+
+
+
+ public final boolean hasFormat() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final Xid clearFormat() {
+ packing_flags &= ~256;
+ this.format = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getFormat() {
+ return format;
+ }
+
+ public final Xid setFormat(long value) {
+ this.format = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid format(long value) {
+ return setFormat(value);
+ }
+
+ public final boolean hasGlobalId() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final Xid clearGlobalId() {
+ packing_flags &= ~512;
+ this.globalId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getGlobalId() {
+ return globalId;
+ }
+
+ public final Xid setGlobalId(byte[] value) {
+ this.globalId = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid globalId(byte[] value) {
+ return setGlobalId(value);
+ }
+
+ public final boolean hasBranchId() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final Xid clearBranchId() {
+ packing_flags &= ~1024;
+ this.branchId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getBranchId() {
+ return branchId;
+ }
+
+ public final Xid setBranchId(byte[] value) {
+ this.branchId = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid branchId(byte[] value) {
+ return setBranchId(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint32(this.format);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeVbin8(this.globalId);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeVbin8(this.branchId);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.format = dec.readUint32();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.globalId = dec.readVbin8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.branchId = dec.readVbin8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("format", getFormat());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("globalId", getGlobalId());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("branchId", getBranchId());
+ }
+
+
+ return result;
+ }
+
+
+}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java b/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java
deleted file mode 100644
index e0244e0581..0000000000
--- a/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.codec;
-
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.HeartbeatBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.transport.Sender;
-
-import java.nio.ByteBuffer;
-
-public class MockAMQVersionAwareProtocolSession implements AMQVersionAwareProtocolSession
-{
-
- public void contentBodyReceived(int channelId, ContentBody body) throws AMQException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void contentHeaderReceived(int channelId, ContentHeaderBody body) throws AMQException
- {
- // TODO Auto-generated method stub
-
- }
-
- public MethodRegistry getMethodRegistry()
- {
- return MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
- }
-
- public void heartbeatBodyReceived(int channelId, HeartbeatBody body) throws AMQException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void init()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void methodFrameReceived(int channelId, AMQMethodBody body) throws AMQException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setSender(Sender<ByteBuffer> sender)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void writeFrame(AMQDataBlock frame)
- {
- // TODO Auto-generated method stub
-
- }
-
- public byte getProtocolMajorVersion()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public byte getProtocolMinorVersion()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public ProtocolVersion getProtocolVersion()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java b/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
index 1a2c5283b0..4902e8ad64 100644
--- a/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
+++ b/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
@@ -144,6 +144,9 @@ public class BasicContentHeaderPropertiesTest extends TestCase
long expiration = 999999999;
_testProperties.setExpiration(expiration);
assertEquals(expiration, _testProperties.getExpiration());
+ expiration = 0l;
+ _testProperties.setExpiration(expiration);
+ assertEquals(expiration, _testProperties.getExpiration());
}
public void testSetGetMessageId()
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java
deleted file mode 100644
index 8f556ece5a..0000000000
--- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.test.utils;
-
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-
-public class QpidTestCase extends TestCase
-{
- public static final String QPID_HOME = System.getProperty("QPID_HOME");
- public static final String TEST_RESOURCES_DIR = QPID_HOME + "/../test-profiles/test_resources/";
- public static final String TMP_FOLDER = System.getProperty("java.io.tmpdir");
- public static final String LOG4J_CONFIG_FILE_PATH = System.getProperty("log4j.configuration.file");
-
- private static final Logger _logger = Logger.getLogger(QpidTestCase.class);
-
- private final Map<Logger, Level> _loggerLevelSetForTest = new HashMap<Logger, Level>();
- private final Map<String, String> _propertiesSetForTest = new HashMap<String, String>();
-
- private String _testName;
-
- /**
- * Some tests are excluded when the property test.excludes is set to true.
- * An exclusion list is either a file (prop test.excludesfile) which contains one test name
- * to be excluded per line or a String (prop test.excludeslist) where tests to be excluded are
- * separated by " ". Excluded tests are specified following the format:
- * className#testName where className is the class of the test to be
- * excluded and testName is the name of the test to be excluded.
- * className#* excludes all the tests of the specified class.
- */
- static
- {
- if (Boolean.getBoolean("test.exclude"))
- {
- _logger.info("Some tests should be excluded, building the exclude list");
- String exclusionListURIs = System.getProperties().getProperty("test.excludefiles", "");
- String exclusionListString = System.getProperties().getProperty("test.excludelist", "");
- List<String> exclusionList = new ArrayList<String>();
-
- for (String uri : exclusionListURIs.split(";\\s*"))
- {
- File file = new File(uri);
- if (file.exists())
- {
- _logger.info("Using exclude file: " + uri);
- try
- {
- BufferedReader in = new BufferedReader(new FileReader(file));
- String excludedTest = in.readLine();
- do
- {
- exclusionList.add(excludedTest);
- excludedTest = in.readLine();
- }
- while (excludedTest != null);
- }
- catch (IOException e)
- {
- _logger.warn("Exception when reading exclusion list", e);
- }
- }
- else
- {
- _logger.info("Specified exclude file does not exist: " + uri);
- }
- }
-
- if (!exclusionListString.equals(""))
- {
- _logger.info("Using excludeslist: " + exclusionListString);
- for (String test : exclusionListString.split("\\s+"))
- {
- exclusionList.add(test);
- }
- }
-
- _exclusionList = exclusionList;
- }
- }
-
- protected static final String MESSAGE_STORE_CLASS_NAME_KEY = "messagestore.class.name";
- protected static final String CONFIGURATION_STORE_CLASS_NAME_KEY = "configurationstore.class.name";
-
- protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
-
- private static List<String> _exclusionList;
-
- public QpidTestCase()
- {
- super();
- }
-
- public void run(TestResult testResult)
- {
- if (_exclusionList != null && (_exclusionList.contains(getClass().getPackage().getName() + ".*") ||
- _exclusionList.contains(getClass().getName() + "#*") ||
- _exclusionList.contains(getClass().getName() + "#" + getName())))
- {
- _logger.info("Test: " + getName() + " is excluded");
- testResult.endTest(this);
- }
- else
- {
- super.run(testResult);
- }
- }
-
- public String getTestProfileMessageStoreClassName()
- {
- final String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
- _logger.debug("MESSAGE_STORE_CLASS_NAME_KEY " + storeClass);
-
- return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
- }
-
-
- public static final int MIN_PORT_NUMBER = 1;
- public static final int MAX_PORT_NUMBER = 49151;
-
-
- /**
- * Gets the next available port starting at a port.
- *
- * @param fromPort the port to scan for availability
- * @throws NoSuchElementException if there are no ports available
- */
- public int getNextAvailable(int fromPort)
- {
- if ((fromPort < MIN_PORT_NUMBER) || (fromPort > MAX_PORT_NUMBER))
- {
- throw new IllegalArgumentException("Invalid start port: " + fromPort);
- }
-
- PortHelper portHelper = new PortHelper();
- for (int i = fromPort; i <= MAX_PORT_NUMBER; i++)
- {
- if (portHelper.isPortAvailable(i)) {
- return i;
- }
- }
-
- throw new NoSuchElementException("Could not find an available port above " + fromPort);
- }
-
- public int findFreePort()
- {
- return getNextAvailable(10000);
- }
-
- /**
- * Set a System property for duration of this test only. The tearDown will
- * guarantee to reset the property to its previous value after the test
- * completes.
- *
- * @param property The property to set
- * @param value the value to set it to, if null, the property will be cleared
- */
- protected void setTestSystemProperty(final String property, final String value)
- {
- if (!_propertiesSetForTest.containsKey(property))
- {
- // Record the current value so we can revert it later.
- _propertiesSetForTest.put(property, System.getProperty(property));
- }
-
- if (value == null)
- {
- System.clearProperty(property);
- }
- else
- {
- System.setProperty(property, value);
- }
-
- _logger.info("Set system property \"" + property + "\" to: \"" + value + "\"");
- }
-
- /**
- * Restore the System property values that were set by this test run.
- */
- protected void revertTestSystemProperties()
- {
- if(!_propertiesSetForTest.isEmpty())
- {
- _logger.debug("reverting " + _propertiesSetForTest.size() + " test properties");
- for (String key : _propertiesSetForTest.keySet())
- {
- String value = _propertiesSetForTest.get(key);
- if (value != null)
- {
- System.setProperty(key, value);
- }
- else
- {
- System.clearProperty(key);
- }
- }
-
- _propertiesSetForTest.clear();
- }
- }
-
- /**
- * Adjust the VMs Log4j Settings just for this test run
- *
- * @param logger the logger to change
- * @param level the level to set
- */
- protected void setLoggerLevel(Logger logger, Level level)
- {
- assertNotNull("Cannot set level of null logger", logger);
- assertNotNull("Cannot set Logger("+logger.getName()+") to null level.",level);
-
- if (!_loggerLevelSetForTest.containsKey(logger))
- {
- // Record the current value so we can revert it later.
- _loggerLevelSetForTest.put(logger, logger.getLevel());
- }
-
- logger.setLevel(level);
- }
-
- /**
- * Restore the logging levels defined by this test.
- */
- protected void revertLoggingLevels()
- {
- for (Logger logger : _loggerLevelSetForTest.keySet())
- {
- logger.setLevel(_loggerLevelSetForTest.get(logger));
- }
-
- _loggerLevelSetForTest.clear();
- }
-
- protected void tearDown() throws java.lang.Exception
- {
- _logger.info("========== tearDown " + _testName + " ==========");
- revertTestSystemProperties();
- revertLoggingLevels();
- }
-
- protected void setUp() throws Exception
- {
- _testName = getClass().getSimpleName() + "." + getName();
- _logger.info("========== start " + _testName + " ==========");
- }
-
- protected String getTestName()
- {
- return _testName;
- }
-}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestFileUtils.java b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestFileUtils.java
deleted file mode 100644
index 14dec8efad..0000000000
--- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestFileUtils.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.test.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.io.FileOutputStream;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.util.FileUtils;
-
-/**
- * Utility methods intended to be used in unit tests that manipulate files
- */
-public class TestFileUtils
-{
- private static final String SYSTEM_TMP_DIR = System.getProperty("java.io.tmpdir");
- private static final String SUFFIX = "tmp";
-
- /**
- * Create and return a temporary directory that will be deleted on exit.
- */
- public static File createTestDirectory()
- {
- String dirNameStem = TestFileUtils.class.getSimpleName() + "-testDir";
- return createTestDirectory(dirNameStem, true);
- }
-
- /**
- * Creates an empty directory with a name like /tmp/dirNameStem-12345678
- */
- public static File createTestDirectory(String dirNameStem, boolean deleteOnExit)
- {
- File testDir = new File(SYSTEM_TMP_DIR, dirNameStem + "-" + System.currentTimeMillis());
- if (testDir.exists())
- {
- FileUtils.delete(testDir, true);
- }
-
- testDir.mkdirs();
-
- if (deleteOnExit)
- {
- testDir.deleteOnExit();
- }
-
- return testDir;
- }
-
- public static File createTempFile(TestCase testcase)
- {
- return createTempFile(testcase, SUFFIX);
- }
-
- public static File createTempFile(TestCase testcase, String suffix)
- {
- String prefix = testcase.getClass().getSimpleName() + "-" + testcase.getName();
-
- File tmpFile;
- try
- {
- tmpFile = File.createTempFile(prefix, suffix);
- tmpFile.deleteOnExit();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Cannot create temporary file with prefix " + prefix + " and suffix " + SUFFIX, e);
- }
-
- return tmpFile;
- }
-
- /**
- * Creates a temporary file from the resource name given, using the resource name as the file suffix.
- *
- * This is required because the tests use the jar files as their class path.
- */
- public static File createTempFileFromResource(TestCase testCase, String resourceName)
- {
- File dst = createTempFile(testCase, resourceName);
- InputStream in = testCase.getClass().getResourceAsStream(resourceName);
- try
- {
- FileUtils.copy(in, dst);
- }
- catch (Exception e)
- {
- throw new RuntimeException("Cannot copy resource " + resourceName +
- " to temp file " + dst.getAbsolutePath(), e);
- }
- dst.deleteOnExit();
- return dst;
- }
-
- /**
- * Creates a temporary file for given test with given suffix in file name.
- * The given content is stored in the file using UTF-8 encoding.
- */
- public static File createTempFile(TestCase testcase, String suffix, String content)
- {
- File file = createTempFile(testcase, suffix);
- if (content != null)
- {
- FileOutputStream fos = null;
- try
- {
- fos = new FileOutputStream(file);
- fos.write(content.getBytes("UTF-8"));
- fos.flush();
- }
- catch (Exception e)
- {
- throw new RuntimeException("Cannot add the content into temp file " + file.getAbsolutePath(), e);
- }
- finally
- {
- if (fos != null)
- {
- try
- {
- fos.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Cannot close output stream into temp file " + file.getAbsolutePath(), e);
- }
- }
- }
- }
- return file;
- }
-}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/MockSender.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/MockSender.java
deleted file mode 100644
index 4b38b7318a..0000000000
--- a/qpid/java/common/src/test/java/org/apache/qpid/transport/MockSender.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.transport;
-
-import java.nio.ByteBuffer;
-
-public class MockSender implements Sender<ByteBuffer>
-{
-
- public void setIdleTimeout(int i)
- {
-
- }
-
- public void send(ByteBuffer msg)
- {
-
- }
-
- public void flush()
- {
-
- }
-
- public void close()
- {
-
- }
-}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java
deleted file mode 100644
index a19c2e7e43..0000000000
--- a/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.transport;
-
-import java.security.Principal;
-import org.apache.qpid.protocol.ProtocolEngineFactory;
-import org.apache.qpid.ssl.SSLContextFactory;
-import org.apache.qpid.transport.network.NetworkConnection;
-
-import java.net.BindException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-
-/**
- * Test implementation of IoSession, which is required for some tests. Methods not being used are not implemented,
- * so if this class is being used and some methods are to be used, then please update those.
- */
-public class TestNetworkConnection implements NetworkConnection
-{
- private String _remoteHost = "127.0.0.1";
- private String _localHost = "127.0.0.1";
- private int _port = 1;
- private SocketAddress _localAddress = null;
- private SocketAddress _remoteAddress = null;
- private final MockSender _sender;
-
- public TestNetworkConnection()
- {
- _sender = new MockSender();
- }
-
-
-
- public void bind(int port, InetAddress[] addresses, ProtocolEngineFactory protocolFactory,
- NetworkTransportConfiguration config, SSLContextFactory sslFactory) throws BindException
- {
-
- }
-
- public SocketAddress getLocalAddress()
- {
- return (_localAddress != null) ? _localAddress : new InetSocketAddress(_localHost, _port);
- }
-
- public SocketAddress getRemoteAddress()
- {
- return (_remoteAddress != null) ? _remoteAddress : new InetSocketAddress(_remoteHost, _port);
- }
-
- public void setMaxReadIdle(int idleTime)
- {
-
- }
-
- @Override
- public void setPeerPrincipal(Principal principal)
- {
- }
-
- @Override
- public Principal getPeerPrincipal()
- {
- return null;
- }
-
- @Override
- public int getMaxReadIdle()
- {
- return 0;
- }
-
- @Override
- public int getMaxWriteIdle()
- {
- return 0;
- }
-
- public void setMaxWriteIdle(int idleTime)
- {
-
- }
-
- public void close()
- {
-
- }
-
- public void flush()
- {
-
- }
-
- public void send(ByteBuffer msg)
- {
-
- }
-
- public void setIdleTimeout(int i)
- {
-
- }
-
- public void setPort(int port)
- {
- _port = port;
- }
-
- public int getPort()
- {
- return _port;
- }
-
- public void setLocalHost(String host)
- {
- _localHost = host;
- }
-
- public void setRemoteHost(String host)
- {
- _remoteHost = host;
- }
-
- public void setLocalAddress(SocketAddress address)
- {
- _localAddress = address;
- }
-
- public void setRemoteAddress(SocketAddress address)
- {
- _remoteAddress = address;
- }
-
- public Sender<ByteBuffer> getSender()
- {
- return _sender;
- }
-
- public void start()
- {
- }
-}
diff --git a/qpid/java/common/templates/method/MethodBodyInterface.vm b/qpid/java/common/templates/method/MethodBodyInterface.vm
index d5feba12de..29ecc4f115 100644
--- a/qpid/java/common/templates/method/MethodBodyInterface.vm
+++ b/qpid/java/common/templates/method/MethodBodyInterface.vm
@@ -2,16 +2,11 @@
#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
#end
#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
-
-
-
#set( $amqp_ClassName = $amqpClass.Name)
#UpperCamel( $amqp_ClassName )
#set( $amqp_MethodName = $amqpMethod.Name )
#UpperCamel( $amqp_MethodName )
#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}Body" )
-
-
#set( $filename = "${javaClassName}.java")
/*
*
@@ -22,9 +17,9 @@
* 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
@@ -41,22 +36,15 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
-
-package org.apache.qpid.framing;
+package org.apache.qpid.framing;
public interface ${javaClassName} extends EncodableAMQDataBlock, AMQMethodBody
{
-
-
#foreach( $field in $amqpMethod.Fields )
#if( $amqpMethod.isCommon( $field ) )
public $field.ConsistentNativeType get#toUpperCamel( ${field.Name} )();
#end
#end
-
-
-
}
diff --git a/qpid/java/common/templates/method/version/MethodBodyClass.vm b/qpid/java/common/templates/method/version/MethodBodyClass.vm
index caa7277d22..a960d357d2 100644
--- a/qpid/java/common/templates/method/version/MethodBodyClass.vm
+++ b/qpid/java/common/templates/method/version/MethodBodyClass.vm
@@ -19,9 +19,9 @@
* 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
@@ -36,10 +36,9 @@
* Supported AMQP version:
* $version.getMajor()-$version.getMinor()
*/
-
+
#set( $clazz = $amqpClass.asSingleVersionClass( $version ) )
#set( $method = $amqpMethod.asSingleVersionMethod( $version ) )
-
package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
import org.apache.qpid.codec.MarkableDataInput;
@@ -57,37 +56,29 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
{
return new ${javaClassName}(in);
}
-
-
};
-
-
+
public static AMQMethodBodyInstanceFactory getFactory()
{
return FACTORY_INSTANCE;
}
- public static final int CLASS_ID = $clazz.ClassId;
-
- public static final int METHOD_ID = $method.MethodId;
-
+ public static final int CLASS_ID = $clazz.ClassId;
+ public static final int METHOD_ID = $method.MethodId;
-
// Fields declared in specification
#foreach( $field in $method.ConsolidatedFields )
private final $field.NativeType _$field.getName(); // $field.UnderlyingFields
#end
-
// Constructor
-
public ${javaClassName}(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
{
#foreach( $field in $method.ConsolidatedFields )
_$field.Name = read$field.getEncodingType()( buffer );
#end
- }
-
+ }
+
public ${javaClassName}(
#foreach( $field in $method.FieldList )
#if( $velocityCount == $method.getFieldList().size() )
@@ -109,35 +100,34 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
byte $consolidatedFieldName = (byte)0;
#end
if( $field.Name )
- {
+ {
$consolidatedFieldName = (byte) (((int) $consolidatedFieldName) | (1 << $method.getPositionInBitField( $field.Name )));
- }
+ }
#if( $velocityCount == $method.getFieldList().size())
- _$consolidatedFieldName = $consolidatedFieldName;
-#else
-
-#end
+ _$consolidatedFieldName = $consolidatedFieldName;
+#else
+
+#end
#else
#if( !$consolidatedFieldName.equals("") )
- _$consolidatedFieldName = $consolidatedFieldName;
+ _$consolidatedFieldName = $consolidatedFieldName;
#end
#set( $consolidatedFieldName = "" )
_$field.Name = $field.Name;
#end
#end
}
-
- public int getClazz()
- {
- return CLASS_ID;
+
+ public int getClazz()
+ {
+ return CLASS_ID;
}
-
- public int getMethod()
- {
- return METHOD_ID;
+
+ public int getMethod()
+ {
+ return METHOD_ID;
}
-
#foreach( $field in $method.FieldList )
public final $field.NativeType get#toUpperCamel( ${field.Name} )()
{
@@ -150,20 +140,20 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
#end
protected int getBodySize()
- {
+ {
#set( $fixedSize = 0 )
#foreach( $field in $method.ConsolidatedFields )
-#if( $field.isFixedSize() )
+#if( $field.isFixedSize() )
#set( $fixedSize = $fixedSize + $field.Size )
#end
#end
- int size = $fixedSize;
+ int size = $fixedSize;
#foreach( $field in $method.ConsolidatedFields )
-#if( ! $field.isFixedSize() )
+#if( ! $field.isFixedSize() )
size += getSizeOf( _$field.Name );
#end
#end
- return size;
+ return size;
}
public void writeMethodPayload(DataOutput buffer) throws IOException
@@ -179,32 +169,28 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
#if( $amqpMethod.inAllVersions() )
- return dispatcher.dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(this, channelId);
+ return dispatcher.dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(this, channelId);
#else
- return ((MethodDispatcher_$version.getMajor()_$version.getMinor())dispatcher).dispatch${amqp_ClassName}${amqpMethodNameUpperCamel}(this, channelId);
-
-#end
-
+ return ((MethodDispatcher_$version.getMajor()_$version.getMinor())dispatcher).dispatch${amqp_ClassName}${amqpMethodNameUpperCamel}(this, channelId);
+#end
}
-
-
+
public String toString()
{
StringBuilder buf = new StringBuilder("[$javaClassName: ");
#foreach( $field in $method.FieldList )
buf.append( "$field.Name=" );
#if( $field.NativeType == "byte[]" )
- buf.append( get#toUpperCamel( $field.Name )() == null ? "null" : java.util.Arrays.toString( get#toUpperCamel( $field.Name )() ) );
+ buf.append( get#toUpperCamel( $field.Name )() == null ? "null" : java.util.Arrays.toString( get#toUpperCamel( $field.Name )() ) );
#else
- buf.append( get#toUpperCamel( $field.Name )() );
+ buf.append( get#toUpperCamel( $field.Name )() );
#end
#if( $velocityCount != $method.FieldList.size() )
- buf.append( ", " );
+ buf.append( ", " );
#end
#end
buf.append("]");
return buf.toString();
}
-
}
diff --git a/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm b/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm
index 9e4aee7dee..e814d6b672 100644
--- a/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,12 +27,11 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing;
import org.apache.qpid.AMQException;
-
public interface ClientMethodDispatcher
{
@@ -48,7 +47,7 @@ public interface ClientMethodDispatcher
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
+#end
#end
#end
#end
diff --git a/qpid/java/common/templates/model/MethodDispatcherInterface.vm b/qpid/java/common/templates/model/MethodDispatcherInterface.vm
index a2c6328c4e..698d68e76c 100644
--- a/qpid/java/common/templates/model/MethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/MethodDispatcherInterface.vm
@@ -1,36 +1,36 @@
-#set( $filename = "MethodDispatcher.java")
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * This file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing;
-
-public interface MethodDispatcher extends
- ClientMethodDispatcher, ServerMethodDispatcher
-{
-}
+#set( $filename = "MethodDispatcher.java")
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing;
+
+public interface MethodDispatcher extends
+ ClientMethodDispatcher, ServerMethodDispatcher
+{
+}
diff --git a/qpid/java/common/templates/model/MethodRegistryClass.vm b/qpid/java/common/templates/model/MethodRegistryClass.vm
index f8a55f245a..cad115aa6c 100644
--- a/qpid/java/common/templates/model/MethodRegistryClass.vm
+++ b/qpid/java/common/templates/model/MethodRegistryClass.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,7 +27,7 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing;
import java.io.IOException;
@@ -48,12 +48,10 @@ public abstract class MethodRegistry
#set( $verName = "_$supportedVersion.getMajor()_$supportedVersion.getMinor()" )
#set( $regPackage = "org.apache.qpid.framing.amqp$verName" )
- public static final MethodRegistry registry_$supportedVersion.getMajor()_$supportedVersion.getMinor() =
- new ${regPackage}.MethodRegistry${verName}();
-
+ public static final MethodRegistry registry_$supportedVersion.getMajor()_$supportedVersion.getMinor() =
+ new ${regPackage}.MethodRegistry${verName}();
#end
-
-
+
public abstract AMQMethodBody convertToBody(MarkableDataInput in, long size)
throws AMQFrameDecodingException, IOException;
@@ -61,7 +59,6 @@ public abstract class MethodRegistry
public abstract int getMaxMethodId(int classId);
-
protected MethodRegistry(ProtocolVersion pv)
{
_registries.put(pv, this);
@@ -84,22 +81,18 @@ public abstract class MethodRegistry
#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public abstract ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
+ public abstract ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
#foreach( $field in $amqpMethod.FieldList )
#if( $velocityCount == $amqpMethod.getFieldList().size() )
final $field.NativeType $field.Name
#else
final $field.NativeType $field.Name,
#end
-#end
- );
-
-
+#end
+ );
#end
#end
#end
-
- public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
-
+ public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
}
diff --git a/qpid/java/common/templates/model/ProtocolVersionListClass.vm b/qpid/java/common/templates/model/ProtocolVersionListClass.vm
index 78605c70ff..e8e2b8cc5d 100644
--- a/qpid/java/common/templates/model/ProtocolVersionListClass.vm
+++ b/qpid/java/common/templates/model/ProtocolVersionListClass.vm
@@ -8,9 +8,9 @@
* 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
@@ -36,14 +36,12 @@ import java.util.TreeSet;
import java.util.Map;
import java.util.HashMap;
-
public class ProtocolVersion implements Comparable
{
private final byte _majorVersion;
private final byte _minorVersion;
private final String _stringFormat;
-
public ProtocolVersion(byte majorVersion, byte minorVersion)
{
_majorVersion = majorVersion;
@@ -66,7 +64,6 @@ public class ProtocolVersion implements Comparable
return _minorVersion > 90 ? (byte) (_minorVersion / 10) : _minorVersion;
}
-
public byte getRevisionVersion()
{
return _minorVersion > 90 ? (byte) (_minorVersion % 10) : (byte) 0;
@@ -77,28 +74,27 @@ public class ProtocolVersion implements Comparable
return _stringFormat;
}
-
public int compareTo(Object o)
{
ProtocolVersion pv = (ProtocolVersion) o;
-
- /*
- * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
- * so we need to deal with that case specially
- */
-
+
+ /*
+ * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
+ * so we need to deal with that case specially
+ */
+
if((_majorVersion == (byte) 8) && (_minorVersion == (byte) 0))
- {
- ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
- return fixedThis.compareTo(pv);
- }
-
- if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
- {
- ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
- return this.compareTo(fixedOther);
- }
-
+ {
+ ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
+ return fixedThis.compareTo(pv);
+ }
+
+ if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
+ {
+ ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
+ return this.compareTo(fixedOther);
+ }
+
if(_majorVersion > pv.getMajorVersion())
{
return 1;
@@ -131,71 +127,63 @@ public class ProtocolVersion implements Comparable
{
return (0xFF & (int)_minorVersion) | ((0xFF & (int)_majorVersion) << 8);
}
-
-
+
public boolean isSupported()
{
return _supportedVersions.contains(this);
}
-
+
public static ProtocolVersion getLatestSupportedVersion()
{
return _supportedVersions.last();
}
-
+
private static final SortedSet<ProtocolVersion> _supportedVersions;
- private static final Map<String, ProtocolVersion> _nameToVersionMap =
- new HashMap<String, ProtocolVersion>();
- private static final ProtocolVersion _defaultVersion;
+ private static final Map<String, ProtocolVersion> _nameToVersionMap =
+ new HashMap<String, ProtocolVersion>();
+ private static final ProtocolVersion _defaultVersion;
-
public static final ProtocolVersion v0_10 = new ProtocolVersion((byte)0,(byte)10);
#foreach( $version in $model.getVersionSet() )
#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
public static final ProtocolVersion $versionId = new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor());
#end
-
-
+
static
{
SortedSet<ProtocolVersion> versions = new TreeSet<ProtocolVersion>();
- versions.add(v0_10);
- _nameToVersionMap.put("0-10", v0_10);
+ versions.add(v0_10);
+ _nameToVersionMap.put("0-10", v0_10);
#foreach( $version in $model.getVersionSet() )
#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
versions.add($versionId);
- _nameToVersionMap.put("${version.getMajor()}-${version.getMinor()}", $versionId);
+ _nameToVersionMap.put("${version.getMajor()}-${version.getMinor()}", $versionId);
#end
_supportedVersions = Collections.unmodifiableSortedSet(versions);
-
-
- ProtocolVersion systemDefinedVersion =
- _nameToVersionMap.get(System.getProperty("org.apache.qpid.amqp_version"));
-
- _defaultVersion = (systemDefinedVersion == null)
- ? getLatestSupportedVersion()
- : systemDefinedVersion;
+
+ ProtocolVersion systemDefinedVersion =
+ _nameToVersionMap.get(System.getProperty("org.apache.qpid.amqp_version"));
+
+ _defaultVersion = (systemDefinedVersion == null)
+ ? getLatestSupportedVersion()
+ : systemDefinedVersion;
}
-
public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
{
return _supportedVersions;
}
-
-
public static ProtocolVersion parse(String name)
{
return _nameToVersionMap.get(name);
}
-
+
public static ProtocolVersion defaultProtocolVersion()
{
return _defaultVersion;
}
-
}
diff --git a/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm b/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm
index b80d6027b7..fd7b643806 100644
--- a/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,12 +27,11 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing;
import org.apache.qpid.AMQException;
-
public interface ServerMethodDispatcher
{
@@ -48,7 +47,7 @@ public interface ServerMethodDispatcher
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
+#end
#end
#end
#end
diff --git a/qpid/java/common/templates/model/version/AmqpConstantsClass.vm b/qpid/java/common/templates/model/version/AmqpConstantsClass.vm
deleted file mode 100644
index 8d459f2977..0000000000
--- a/qpid/java/common/templates/model/version/AmqpConstantsClass.vm
+++ /dev/null
@@ -1,37 +0,0 @@
-&{AmqpConstants.java}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * This file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-package org.apache.qpid.framing;
-
-class AmqpConstants
-{
- // Constant getValue methods
-
-%{TLIST} ${const_get_method}
-
-}
diff --git a/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm b/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
index 80705c1a39..24fe9e8223 100644
--- a/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,13 +27,12 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.*;
-
public interface ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()} extends ClientMethodDispatcher
{
diff --git a/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm b/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm
index 272ceff915..2209188b15 100644
--- a/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,14 +27,14 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
import org.apache.qpid.framing.*;
-public interface MethodDispatcher_${version.getMajor()}_${version.getMinor()}
+public interface MethodDispatcher_${version.getMajor()}_${version.getMinor()}
extends MethodDispatcher,
- ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()},
+ ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()},
ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()}
{
diff --git a/qpid/java/common/templates/model/version/MethodRegistryClass.vm b/qpid/java/common/templates/model/version/MethodRegistryClass.vm
index ab5db0ea38..0c14bdd786 100644
--- a/qpid/java/common/templates/model/version/MethodRegistryClass.vm
+++ b/qpid/java/common/templates/model/version/MethodRegistryClass.vm
@@ -8,9 +8,9 @@
* 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
@@ -25,7 +25,7 @@
* Supported AMQP version:
* $version.getMajor()-$version.getMinor()
*/
-
+
package org.apache.qpid.framing.amqp_${version.getMajor()}_${version.getMinor()};
import org.apache.qpid.framing.*;
@@ -43,25 +43,23 @@ import org.apache.qpid.codec.MarkableDataInput;
public class MethodRegistry_$version.getMajor()_$version.getMinor() extends MethodRegistry
{
-
+
private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_$version.getMajor()_$version.getMinor()();
-
-#set( $specificModel = $model.asSingleVersionModel() )
-
-
-#set( $maxClassId = $specificModel.getMaximumClassId()+1 )
+
+#set( $specificModel = $model.asSingleVersionModel() )
+#set( $maxClassId = $specificModel.getMaximumClassId()+1 )
private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$maxClassId][];
public MethodRegistry_$version.getMajor()_$version.getMinor()()
{
this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
}
-
+
public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
{
- super(pv);
+ super(pv);
#foreach( $amqpClass in $specificModel.getClassList() )
#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
@@ -71,28 +69,24 @@ public class MethodRegistry_$version.getMajor()_$version.getMinor() extends Meth
// Register method body instance factories for the $amqpClassNameUpperCamel class.
-#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )
+#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )
_factories[$amqpClass.getClassId()] = new AMQMethodBodyInstanceFactory[$maxMethodId];
-
+
#foreach( $amqpMethod in $amqpClass.getMethodList() )
#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory();
-#end
-
+ _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory();
+#end
#end
-
-
}
-
public AMQMethodBody convertToBody(MarkableDataInput in, long size)
throws AMQFrameDecodingException, IOException
{
int classId = in.readUnsignedShort();
int methodId = in.readUnsignedShort();
-
+
AMQMethodBodyInstanceFactory bodyFactory;
try
{
@@ -122,7 +116,6 @@ public class MethodRegistry_$version.getMajor()_$version.getMinor() extends Meth
}
}
-
if (bodyFactory == null)
{
throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
@@ -130,44 +123,38 @@ public class MethodRegistry_$version.getMajor()_$version.getMinor() extends Meth
+ " (while trying to decode class " + classId + " method " + methodId + ".");
}
-
return bodyFactory.newInstance(in, size);
-
-
}
-
public int getMaxClassId()
{
return $specificModel.getMaximumClassId();
}
-
+
public int getMaxMethodId(int classId)
{
- return _factories[classId].length - 1;
+ return _factories[classId].length - 1;
}
-
-
#foreach( $amqpClass in $specificModel.getClassList() )
#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-
+
#foreach( $amqpMethod in $amqpClass.getMethodList() )
#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
+ public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
#foreach( $field in $amqpMethod.FieldList )
#if( $velocityCount == $amqpMethod.getFieldList().size() )
final $field.NativeType $field.Name
#else
final $field.NativeType $field.Name,
#end
-#end
- )
+#end
+ )
{
return new ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl(
#foreach( $field in $amqpMethod.FieldList )
@@ -176,19 +163,17 @@ public class MethodRegistry_$version.getMajor()_$version.getMinor() extends Meth
#else
$field.Name,
#end
-#end
- );
+#end
+ );
}
-
-#end
-
+
+#end
+
#end
-
-
+
public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
{
return _protocolVersionConverter;
- }
+ }
-
}
diff --git a/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm b/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
index db388fcc65..a26154ff84 100644
--- a/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
+++ b/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
@@ -8,9 +8,9 @@
* 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
@@ -27,7 +27,7 @@
* $supportedVersion.getMajor()-$supportedVersion.getMinor()
#end
*/
-
+
package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
import org.apache.qpid.AMQException;
diff --git a/qpid/java/genpom b/qpid/java/genpom
index 43c0132ecf..55da2fe3d6 100755
--- a/qpid/java/genpom
+++ b/qpid/java/genpom
@@ -145,6 +145,11 @@ for jar in jars:
<scope>%s</scope>""" % (group, artifactId, version,
scopes.get(artifactId, "compile")))
+ deptype = lookup(dep, "deptype")
+ if deptype is not None:
+ deps.append("""
+ <type>%s</type>""" % deptype)
+
exclusions = lookupElement(dep, "exclusions")
if exclusions is not None:
deps.append("""
diff --git a/qpid/java/ivy.retrieve.xml b/qpid/java/ivy.retrieve.xml
index faecfb2dbf..388e2d0dc4 100644
--- a/qpid/java/ivy.retrieve.xml
+++ b/qpid/java/ivy.retrieve.xml
@@ -42,6 +42,7 @@
<dependency org="commons-digester" name="commons-digester" rev="1.8.1" transitive="false"/>
<dependency org="commons-lang" name="commons-lang" rev="2.6" transitive="false"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"/>
+ <dependency org="org.apache.bcel" name="bcel" rev="5.2" transitive="false"/>
<dependency org="org.apache.derby" name="derby" rev="10.8.2.2" transitive="false"/>
<dependency org="org.apache.geronimo.framework" name="geronimo-kernel" rev="2.2.1" transitive="false"/>
<dependency org="org.apache.geronimo.specs" name="geronimo-ejb_3.0_spec" rev="1.0.1" transitive="false"/>
@@ -68,15 +69,17 @@
<dependency org="org.eclipse.jetty" name="jetty-security" rev="7.6.10.v20130312" transitive="false"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="7.6.10.v20130312" transitive="false"/>
<dependency org="org.eclipse.jetty" name="jetty-util" rev="7.6.10.v20130312" transitive="false"/>
- <dependency org="org.dojotoolkit" name="dojo-war" rev="1.8.3" transitive="false"/>
<dependency org="xalan" name="xalan" rev="2.7.0" transitive="false"/>
<dependency org="velocity" name="velocity" rev="1.4" transitive="false"/>
<dependency org="velocity" name="velocity-dep" rev="1.4" transitive="false"/>
+ <dependency org="org.dojotoolkit" name="dojo" rev="1.9.1" transitive="false">
+ <artifact name="dojo" type="zip"/>
+ </dependency>
<!-- The following are optional dependencies, for modules providing optional functionlity or
for use in optional build/test steps. Their optional status is usually indicative of licences
which are not compatible with the Apache Licence -->
- <dependency org="com.sleepycat" name="je" rev="5.0.84" transitive="false" conf="bdbje"/>
+ <dependency org="com.sleepycat" name="je" rev="5.0.97" transitive="false" conf="bdbje"/>
<dependency org="jfree" name="jfreechart" rev="1.0.13" transitive="false" conf="jfree"/>
<dependency org="jfree" name="jcommon" rev="1.0.16" transitive="false" conf="jfree"/>
<dependency org="com.jolbox" name="bonecp" rev="0.7.1.RELEASE" transitive="false" conf="bonecp"/>
diff --git a/qpid/java/jca/pom.xml b/qpid/java/jca/pom.xml
new file mode 100644
index 0000000000..467175db90
--- /dev/null
+++ b/qpid/java/jca/pom.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-jca</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_3.0_spec</artifactId>
+ <version>1.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>geronimo-kernel</artifactId>
+ <version>2.2.1</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm-commons</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-reflect</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.testsupport</groupId>
+ <artifactId>testsupport-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>geronimo-crypto</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/jca/rar/pom.xml b/qpid/java/jca/rar/pom.xml
new file mode 100644
index 0000000000..192f34255d
--- /dev/null
+++ b/qpid/java/jca/rar/pom.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-rar</artifactId>
+ <packaging>rar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-jca</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-rar-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <raXmlFile>src/main/resources/META-INF/ra.xml</raXmlFile>
+ <rarSourceDirectory>src/main/resources</rarSourceDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+<!-- <profiles>
+ <profile>
+ <id>deploy</id>
+ <build>
+ <defaultGoal>deploy</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ <configuration>
+ <attach>false</attach>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles> -->
+</project>
diff --git a/qpid/java/lib/poms/bcel-5.2.xml b/qpid/java/lib/poms/bcel-5.2.xml
new file mode 100644
index 0000000000..b218981e8a
--- /dev/null
+++ b/qpid/java/lib/poms/bcel-5.2.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<dep>
+ <groupId>org.apache.bcel</groupId>
+ <artifactId>bcel</artifactId>
+ <version>5.2</version>
+</dep>
diff --git a/qpid/java/lib/poms/dojo-1.9.1.xml b/qpid/java/lib/poms/dojo-1.9.1.xml
new file mode 100644
index 0000000000..0b8c341353
--- /dev/null
+++ b/qpid/java/lib/poms/dojo-1.9.1.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<dep>
+ <groupId>org.dojotoolkit</groupId>
+ <artifactId>dojo</artifactId>
+ <version>1.9.1</version>
+ <deptype>zip</deptype>
+</dep>
diff --git a/qpid/java/lib/poms/je-5.0.84.xml b/qpid/java/lib/poms/je-5.0.84.xml
deleted file mode 100644
index 7a556bbe1c..0000000000
--- a/qpid/java/lib/poms/je-5.0.84.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<dep>
- <groupId>com.sleepycat</groupId>
- <artifactId>je</artifactId>
- <version>5.0.84</version>
-</dep>
diff --git a/qpid/java/lib/poms/je-5.0.97.xml b/qpid/java/lib/poms/je-5.0.97.xml
new file mode 100644
index 0000000000..9ab0f3a1fe
--- /dev/null
+++ b/qpid/java/lib/poms/je-5.0.97.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<dep>
+ <groupId>com.sleepycat</groupId>
+ <artifactId>je</artifactId>
+ <version>5.0.97</version>
+</dep>
diff --git a/qpid/java/management/common/pom.xml b/qpid/java/management/common/pom.xml
new file mode 100644
index 0000000000..ad5d103165
--- /dev/null
+++ b/qpid/java/management/common/pom.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-management-common</artifactId>
+
+ <dependencies>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/management/example/pom.xml b/qpid/java/management/example/pom.xml
new file mode 100644
index 0000000000..bdddc3d2dc
--- /dev/null
+++ b/qpid/java/management/example/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-management-examples</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-management-common</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/module.xml b/qpid/java/module.xml
index b3029645e0..28c31f967d 100644
--- a/qpid/java/module.xml
+++ b/qpid/java/module.xml
@@ -398,7 +398,6 @@
<property name="test.output" value="${module.results}"/>
<property name="QPID_HOME" value="${qpid.home}"/>
<property name="QPID_WORK" value="${qpid.work}"/>
- <property name="broker.existing.qpid.work" value=""/>
<propertyset id="all.test.systemproperties">
<propertyref prefix="test"/>
@@ -423,7 +422,6 @@
<propertyref name="QPID_HOME"/>
<propertyref name="QPID_WORK"/>
- <propertyref name="example.plugin.target"/>
</propertyset>
<target name="test" depends="build,compile-tests" if="module.test.src.exists"
@@ -539,7 +537,14 @@
</copy>
</target>
- <target name="copy-resources" if="module.src.resources.exists">
+ <target name="copy-extra-resources" if="module.src.resources.extra">
+ <echo message="Copying extra resources from ${module.src.resources.extra} to ${module.classes}..."/>
+ <copy todir="${module.classes}" failonerror="true">
+ <fileset dir="${module.src.resources.extra}"/>
+ </copy>
+ </target>
+
+ <target name="copy-resources" depends="copy-extra-resources" if="module.src.resources.exists">
<echo message="Copying resources from ${module.src.resources} to ${module.classes}..."/>
<copy todir="${module.classes}" failonerror="true">
<fileset dir="${module.src.resources}" excludes="META-INF/**"/>
@@ -796,104 +801,6 @@
</cobertura-report>
</target>
- <property name="version.file" location="${module.classes}/qpidversion.properties"/>
- <property file="${version.file}" prefix="old."/>
-
- <target name="check-version">
- <exec executable="svnversion" spawn="false" failifexecutionfails="false"
- dir="${project.root}" outputproperty="svnversion.output">
- <arg line="."/>
- </exec>
- <condition property="version.stale">
- <not>
- <equals arg1="${svnversion.output}" arg2="${old.qpid.svnversion}"/>
- </not>
- </condition>
- </target>
-
- <target name="create-version" depends="check-version" if="version.stale">
- <!-- Write the version.properties out.-->
- <!-- Echos exactly as shown, so leave no spaces before/after lines -->
- <echo file="${version.file}" append="false">qpid.version=${project.version}
-qpid.svnversion=${svnversion.output}
-qpid.name=${project.name}
-</echo>
- </target>
-
- <!-- Additions to perform LogMessage generation
- To activate for your plugin add the following to your plugin build.xml
-
- <target name="precompile" depends="gen_logging"/>
-
- -->
-
- <property name="gentools.home" location="${project.root}/common/gentools" />
- <property name="gentools.build" location="${build.scratch}/common/gentools" />
- <property name="generated.dir" location="${module.precompiled}" />
- <property name="velocity.compile.dir" value="${build.scratch}/broker/velocity"/>
- <property name="velocity.timestamp" location="${generated.dir}/velocity.timestamp" />
-
- <target name="compile_velocity" >
- <mkdir dir="${velocity.compile.dir}" />
- <!-- Compile LogMessages Velocity Generator -->
- <javac source="${java.source}" target="${java.target}"
- destdir="${velocity.compile.dir}" debug="on" includeantruntime="false"
- deprecation="${javac.deprecation}"
- srcdir="${project.root}/broker/src/velocity/java" >
- <classpath>
- <pathelement path="${project.root}/${velocity.jar}" />
- </classpath>
- <compilerarg line="${javac.compiler.args}"/>
- </javac>
- </target>
-
-
- <target name="check_velocity_deps">
- <uptodate property="velocity.notRequired" targetfile="${velocity.timestamp}">
- <srcfiles dir="${module.src}" includes="**/*_logmessages.properties" />
- <srcfiles dir="${project.root}/broker/src/velocity/" includes="**/*.java **/*.vm" />
- </uptodate>
- </target>
-
-
- <target name="gen_logging" depends="compile_velocity,check_velocity_deps" unless="velocity.notRequired">
- <mkdir dir="${generated.dir}"/>
-
- <path id="logmessages.path">
- <fileset dir="${module.src}">
- <include name="**/*_logmessages.properties"/>
- </fileset>
- </path>
-
- <pathconvert property="logmessages"
- refid="logmessages.path"
- pathsep="' '"/>
-
- <echo message="logmessages is ${logmessages}"/>
-
- <java classname="org.apache.qpid.server.logging.GenerateLogMessages" fork="true" dir="${gentools.build}/classes" failonerror="true">
- <arg line="'${logmessages}'"/>
- <arg value="-j"/>
- <arg value="-o"/>
- <arg value="${generated.dir}"/>
- <arg value="-t"/>
- <arg value="${project.root}/broker/src/velocity/templates/org/apache/qpid/server/logging/messages"/>
- <arg value="-s"/>
- <arg value="${module.src}"/>
-
-
- <classpath>
- <pathelement path="${module.src}"/>
- <pathelement path="${velocity.compile.dir}" />
- <fileset dir="${project.root}/lib/required">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${project.root}/${velocity.jar}" />
- </classpath>
- </java>
- <touch file="${velocity.timestamp}" />
- </target>
-
<target name="eclipse" depends="eclipse-setup,eclipse-project,eclipse-source-only,eclipse-source-and-test"/>
<target name="eclipse-setup">
diff --git a/qpid/java/perftests/build.xml b/qpid/java/perftests/build.xml
index 3b19c7645a..449dd7e89b 100644
--- a/qpid/java/perftests/build.xml
+++ b/qpid/java/perftests/build.xml
@@ -33,7 +33,7 @@
</condition>
<property name="module.depends" value="client common"/>
- <property name="module.test.depends" value="systests broker broker-plugins/memory-store broker-plugins/derby-store common/tests management/common broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol ${perftests.optional.test.depends}"/>
+ <property name="module.test.depends" value="systests broker-core broker-plugins/memory-store broker-plugins/derby-store qpid-test-utils management/common broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol ${perftests.optional.test.depends}"/>
<import file="../module.xml"/>
diff --git a/qpid/java/perftests/pom.xml b/qpid/java/perftests/pom.xml
new file mode 100644
index 0000000000..25d0cce626
--- /dev/null
+++ b/qpid/java/perftests/pom.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-perftests</artifactId>
+
+ <properties>
+ <broker.home.dir>target/qpid-broker/${project.version}</broker.home.dir>
+ <!-- test properties -->
+ <qpid.home>${basedir}/${broker.home.dir}</qpid.home>
+ <qpid.home.qbtc.output>${qpid.home}/qbtc-output</qpid.home.qbtc.output>
+ </properties>
+
+ <dependencies>
+ <!-- client deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- logging deps -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- other deps -->
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils-core</artifactId>
+ <version>1.8.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.8.2.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- test deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-systests</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>src/test/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/qpid-perftests-bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <!-- copy the systests config files into the ${qpid.home}/etc
+ directory where the tests expect them -->
+ <execution>
+ <id>copy-systests-etc-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/../systests</directory>
+ <includes>
+ <include>etc/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <!-- copy the ../test-profiles directory into ${qpid.home}/..
+ directory where the tests expect it -->
+ <execution>
+ <id>copy-test-profile-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}/..</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/..</directory>
+ <includes>
+ <include>test-profiles/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>extract-broker-distribution</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputAbsoluteArtifactFilename>false</outputAbsoluteArtifactFilename>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker</artifactId>
+ <version>${project.version}</version>
+ <classifier>bin</classifier>
+ <type>tar.gz</type>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <workingDirectory>${basedir}/..</workingDirectory>
+ <excludes>
+ <exclude>**/org/apache/qpid/systest/**/*.java</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>**/org/apache/qpid/disttest/**/*.java</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/perftests/src/main/assembly/qpid-perftests-bin.xml b/qpid/java/perftests/src/main/assembly/qpid-perftests-bin.xml
new file mode 100644
index 0000000000..52ac6884ae
--- /dev/null
+++ b/qpid/java/perftests/src/main/assembly/qpid-perftests-bin.xml
@@ -0,0 +1,33 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <baseDirectory>qpid-perftests-${project.version}</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ <include>etc/</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ <excludes>
+ <!-- Exclude client artifacts, user provides appropriate version -->
+ <exclude>org.apache.qpid:qpid-client</exclude>
+ <exclude>org.apache.qpid:qpid-common</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
diff --git a/qpid/java/perftests/visualisation-jfc/pom.xml b/qpid/java/perftests/visualisation-jfc/pom.xml
new file mode 100644
index 0000000000..da84df1d2e
--- /dev/null
+++ b/qpid/java/perftests/visualisation-jfc/pom.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-perftests-visualisation-jfc</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-perftests</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.8.2.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Non Apache Licence deps, use provided scope so users must supply -->
+ <dependency>
+ <groupId>net.sourceforge.csvjdbc</groupId>
+ <artifactId>csvjdbc</artifactId>
+ <version>1.0.8</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jfree</groupId>
+ <artifactId>jfreechart</artifactId>
+ <version>1.0.13</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- test deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>src/test/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/pom.xml b/qpid/java/pom.xml
new file mode 100644
index 0000000000..51671296d0
--- /dev/null
+++ b/qpid/java/pom.xml
@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>12</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <!-- ###### TODO ######
+
+ - Add project details such as Website, Mailing List, SCM.
+ - Test deploying the modules to a local Nexus instance (overriding the repo properties).
+ - Dont deploy modules we aren't already doing so.
+ - Decide on name for this parent module.
+ - Fix the version numbers in all the modules.
+ - Align the XML in the pom files consistently, fix whitepsace errors.
+ - Complete setting properties for the dependency version numbers.
+ - Use dependancy management sections to control the version numbers.
+ - Add LICENCE, NOTICE, README files to the binary assemblies.
+ - Add the test profiles, log4j config etc to a module which can be extracted by the others.
+ - Then fix log4j configuration property to work with all modules.
+ - Then fix what the systests/perftests do to copy the test-profiles dir to the encessary location.
+ - Figure out dependency setup for optional bdbstore tests.
+ - Add the other test profiles
+ - Generate HTML reports of the test results
+
+ === Once the Ant build is removed ===
+ - Move all the resources to be in the /src/foo/resources folders.
+ - Make qpidversion.properties in common be a filtered resource instead of generated.
+ - Get rid of the antrun-plugin execution in common, directly invoke the required java elements.
+ - Do the above in the generate-sources-common profile instead of current default config.
+ - Get rid of the antrun-plugin execution in broker-core, directly invoke the required java elements.
+ - Fix the tests not to be dependant on the working dir being the java dir.
+ - Fix the tests not to be dependant on the test config/output dirs being children of qpid.home.
+ - Remove the QBTC output file mechanics, rely on Surefire to do it?
+ -->
+
+ <properties>
+ <!-- dependency version numbers -->
+ <dojo-version>1.9.1</dojo-version>
+
+ <!-- test dependency version numbers -->
+ <junit-version>3.8.1</junit-version>
+ <mockito-version>1.9.0</mockito-version>
+
+ <!-- plugin version numbers -->
+ <maven-antrun-plugin-version>1.7</maven-antrun-plugin-version>
+ <maven-assembly-plugin-version>2.4</maven-assembly-plugin-version>
+ <maven-clean-plugin-version>2.5</maven-clean-plugin-version>
+ <maven-compiler-plugin-version>3.1</maven-compiler-plugin-version>
+ <maven-deploy-plugin-version>2.7</maven-deploy-plugin-version>
+ <maven-docck-plugin-version>1.0</maven-docck-plugin-version>
+ <maven-enforcer-plugin-version>1.3.1</maven-enforcer-plugin-version>
+ <maven-failsafe-and-surefire-plugins-version>2.16</maven-failsafe-and-surefire-plugins-version>
+ <maven-gpg-plugin-version>1.4</maven-gpg-plugin-version>
+ <maven-install-plugin-version>2.5</maven-install-plugin-version>
+ <maven-invoker-plugin-version>1.8</maven-invoker-plugin-version>
+ <maven-jar-plugin-version>2.4</maven-jar-plugin-version>
+ <maven-javadoc-plugin-version>2.9.1</maven-javadoc-plugin-version>
+ <maven-plugin-plugin-version>3.2</maven-plugin-plugin-version>
+ <maven-release-plugin-version>2.3.2</maven-release-plugin-version>
+ <maven-remote-resources-plugin-version>1.5</maven-remote-resources-plugin-version>
+ <maven-resources-plugin-version>2.6</maven-resources-plugin-version>
+ <maven-scm-plugin-version>1.8</maven-scm-plugin-version>
+ <maven-scm-publish-plugin-version>1.0-beta-2</maven-scm-publish-plugin-version>
+ <maven-site-plugin-version>3.3</maven-site-plugin-version>
+ <maven-source-plugin-version>2.2.1</maven-source-plugin-version>
+ <apache-rat-plugin-version>0.10</apache-rat-plugin-version>
+ <clirr-maven-plugin-version>2.6</clirr-maven-plugin-version>
+ <maven-dependency-plugin-version>2.8</maven-dependency-plugin-version>
+ <javacc-maven-plugin-version>2.6</javacc-maven-plugin-version>
+ <maven-rar-plugin-version>2.3</maven-rar-plugin-version>
+ <maven-project-info-reports-plugin-version>2.7</maven-project-info-reports-plugin-version>
+
+ <!-- javac source/target properties -->
+ <java.source>1.6</java.source>
+ <java.target>1.6</java.target>
+
+ <!-- enforcer plugin config properties -->
+ <supported-maven-version-range>[3.0.0,)</supported-maven-version-range>
+ <supported-test-profiles-regex>(java-mms.0-9-1|java-mms.0-10)</supported-test-profiles-regex>
+
+ <!-- test properties -->
+ <qpid.home>${basedir}</qpid.home> <!-- override for broker tests -->
+ <qpid.home.qbtc.output>${qpid.home}/target/qbtc-output</qpid.home.qbtc.output> <!-- override for broker tests -->
+ <qpid.work>${project.build.directory}/QPID_WORK</qpid.work>
+
+ <profile.excludes.java-mms.0-10>JavaTransientExcludes Java010Excludes</profile.excludes.java-mms.0-10>
+ <broker.version.java-mms.0-10>v0_10</broker.version.java-mms.0-10>
+ <qpid.broker_default_amqp_protocol_excludes.java-mms.0-10>AMQP_1_0</qpid.broker_default_amqp_protocol_excludes.java-mms.0-10>
+
+ <profile>java-mms.0-10</profile>
+ <profile.excludes>${profile.excludes.java-mms.0-10}</profile.excludes>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit-version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>${mockito-version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <modules>
+ <module>amqp-1-0-client</module>
+ <module>amqp-1-0-client-jms</module>
+ <module>amqp-1-0-common</module>
+ <module>broker</module>
+ <module>broker-core</module>
+ <module>broker-plugins/access-control</module>
+ <module>broker-plugins/amqp-0-8-protocol</module>
+ <module>broker-plugins/amqp-0-10-protocol</module>
+ <module>broker-plugins/amqp-1-0-protocol</module>
+ <module>broker-plugins/amqp-msg-conv-0-8-to-0-10</module>
+ <module>broker-plugins/amqp-msg-conv-0-8-to-1-0</module>
+ <module>broker-plugins/amqp-msg-conv-0-10-to-1-0</module>
+ <module>broker-plugins/derby-store</module>
+ <module>broker-plugins/jdbc-provider-bone</module>
+ <module>broker-plugins/jdbc-store</module>
+ <module>broker-plugins/management-http</module>
+ <module>broker-plugins/management-jmx</module>
+ <module>broker-plugins/memory-store</module>
+ <module>common</module>
+ <module>client</module>
+ <module>management/common</module>
+ <module>jca</module>
+ <module>jca/rar</module>
+
+ <module>tools</module>
+ <module>management/example</module>
+
+ <module>qpid-test-utils</module>
+ <module>systests</module>
+ <module>perftests</module>
+
+ <module>perftests/visualisation-jfc</module>
+ <module>bdbstore</module>
+ <module>bdbstore/jmx</module>
+ <module>bdbstore/systests</module>
+ </modules>
+
+ <repositories>
+ <!-- For the BDB JE dependency of the optional bdbstore plugin modules-->
+ <repository>
+ <id>oracle.releases</id>
+ <url>http://download.oracle.com/maven</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <!-- For the CSVJDBC dependency of the optional perftests-visualistion-jfc module-->
+ <repository>
+ <id>csvjdbc.releases</id>
+ <url>http://csvjdbc.sourceforge.net/maven2</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- override the parent pom, set versions etc -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${maven-antrun-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven-assembly-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>${maven-clean-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin-version}</version>
+ <configuration>
+ <source>${java.source}</source>
+ <target>${java.target}</target>
+ <optimize>true</optimize>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>${maven-deploy-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-docck-plugin</artifactId>
+ <version>${maven-docck-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>${maven-enforcer-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-and-surefire-plugins-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>${maven-gpg-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>${maven-install-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>${maven-invoker-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${maven-jar-plugin-version}</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${maven-javadoc-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>${maven-plugin-plugin-version}</version>
+ </plugin>
+ <!-- START SNIPPET: release-plugin-configuration -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>${maven-release-plugin-version}</version>
+ <configuration>
+ <useReleaseProfile>false</useReleaseProfile>
+ <goals>deploy</goals>
+ <arguments>-Papache-release ${arguments}</arguments>
+ </configuration>
+ </plugin>
+ <!-- END SNIPPET: release-plugin-configuration -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>${maven-remote-resources-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${maven-resources-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-scm-plugin</artifactId>
+ <version>${maven-scm-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-scm-publish-plugin</artifactId>
+ <version>${maven-scm-publish-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>${maven-site-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${maven-source-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-failsafe-and-surefire-plugins-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>${apache-rat-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>clirr-maven-plugin</artifactId>
+ <version>${clirr-maven-plugin-version}</version>
+ </plugin>
+
+ <!-- the below are not in the parent pom -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${maven-dependency-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>${javacc-maven-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-rar-plugin</artifactId>
+ <version>${maven-rar-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>${maven-project-info-reports-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <!--version specified in pluginManagement -->
+ <executions>
+ <execution>
+ <id>create-qbtc-output-dir</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <mkdir dir="${qpid.home.qbtc.output}"/>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--version specified in pluginManagement -->
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <argLine>-Xmx512m</argLine>
+ <systemPropertyVariables>
+ <QPID_HOME>${qpid.home}</QPID_HOME>
+ <QPID_WORK>${qpid.work}</QPID_WORK>
+
+ <java.naming.factory.initial>org.apache.qpid.jndi.PropertiesFileInitialContextFactory</java.naming.factory.initial>
+ <java.naming.provider.url>test-profiles${file.separator}test-provider.properties</java.naming.provider.url>
+
+ <broker.config>${qpid.home}/etc/config-systests.json</broker.config>
+ <messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</messagestore.class.name>
+ <broker.protocol.excludes></broker.protocol.excludes>
+ <broker.persistent>false</broker.persistent>
+
+ <max_prefetch>1000</max_prefetch>
+ <qpid.dest_syntax>BURL</qpid.dest_syntax>
+
+ <amqj.logging.level>debug</amqj.logging.level>
+ <amqj.server.logging.level>debug</amqj.server.logging.level>
+ <amqj.protocol.logging.level>debug</amqj.protocol.logging.level>
+ <root.logging.level>warn</root.logging.level>
+
+ <log4j.configuration.file>test-profiles${file.separator}log4j-test.xml</log4j.configuration.file>
+ <log4j.configuration>file://${basedir}${file.separator}..${file.separator}test-profiles${file.separator}log4j-test.xml</log4j.configuration>
+
+ <log4j.debug>false</log4j.debug>
+
+ <test.port>15672</test.port>
+ <test.mport>18999</test.mport>
+ <test.cport>19099</test.cport>
+ <test.hport>18080</test.hport>
+
+ <test.port.ssl>15671</test.port.ssl>
+ <test.port.alt>25672</test.port.alt>
+ <test.port.alt.ssl>25671</test.port.alt.ssl>
+
+ <test.exclude>true</test.exclude>
+ <test.excludes>Excludes JavaExcludes ${profile}.excludes ${profile.excludes}</test.excludes>
+ <test.mem>512M</test.mem>
+
+ <profile.clustered>false</profile.clustered>
+ <broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</broker.virtualhosts-config>
+
+ <!-- Different from the properties files in the Ant build -->
+ <broker.language>java</broker.language>
+ <broker.type>internal</broker.type>
+
+ <broker.version>${broker.version.java-mms.0-10}</broker.version>
+ <qpid.broker_default_amqp_protocol_excludes>${qpid.broker_default_amqp_protocol_excludes.java-mms.0-10}</qpid.broker_default_amqp_protocol_excludes>
+ <broker.stopped>Exception</broker.stopped>
+ <broker.command>${qpid.home}/bin/qpid-server -sp @STORE_PATH -st @STORE_TYPE -l @LOG_CONFIG_FILE</broker.command>
+
+ <broker.ready>BRK-1004</broker.ready>
+ <profile>${profile}</profile>
+
+ <!-- This must be a child of qpid home currently
+ due to the horrible mechanics of QBTC -->
+ <test.output>${qpid.home.qbtc.output}</test.output>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <!--version specified in pluginManagement -->
+ <executions>
+ <execution>
+ <id>enforce-versions-standard-properties</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>${supported-maven-version-range}</version>
+ </requireMavenVersion>
+ <requireProperty>
+ <property>profile</property>
+ <message>You must set a test profile!</message>
+ <regex>${supported-test-profiles-regex}</regex>
+ <regexMessage>You have set an unsupported test profile! Allowed values match: ${supported-test-profiles-regex}</regexMessage>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <!--While the version is specified in pluginManagement, it has to be set here otherwise the
+ version specified within the build.plugins section of the parent pom takes precendece -->
+ <version>${maven-project-info-reports-plugin-version}</version>
+ <configuration>
+ <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <!-- Everything in this profile should already be set above by default in case someone sets an explicit non-test
+ maven profile, which will disable this activeByDefault profile. This is only here for clarity. -->
+ <id>java-mms.0-10</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>profile</name>
+ <value>java-mms.0-10</value>
+ </property>
+ </activation>
+ <properties>
+ <profile>java-mms.0-10</profile>
+ <profile.excludes>${profile.excludes.java-mms.0-10}</profile.excludes>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <broker.version>${broker.version.java-mms.0-10}</broker.version>
+ <qpid.broker_default_amqp_protocol_excludes>${qpid.broker_default_amqp_protocol_excludes.java-mms.0-10}</qpid.broker_default_amqp_protocol_excludes>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>java-mms.0-9-1</id>
+ <activation>
+ <property>
+ <name>profile</name>
+ <value>java-mms.0-9-1</value>
+ </property>
+ </activation>
+ <properties>
+ <profile>java-mms.0-9-1</profile>
+ <profile.excludes>JavaTransientExcludes XAExcludes JavaPre010Excludes</profile.excludes>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <broker.version>v0_9_1</broker.version>
+ <qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</qpid.broker_default_amqp_protocol_excludes>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
+
diff --git a/qpid/java/qpid-test-utils/build.xml b/qpid/java/qpid-test-utils/build.xml
new file mode 100644
index 0000000000..4423c365f8
--- /dev/null
+++ b/qpid/java/qpid-test-utils/build.xml
@@ -0,0 +1,26 @@
+<!--
+ -
+ - 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.
+ -
+ -->
+<project name="QpidTestUtils" default="build">
+ <property name="module.depends" value=""/>
+ <property name="module.test.depends" value="" />
+
+ <import file="../module.xml"/>
+</project>
diff --git a/qpid/java/qpid-test-utils/pom.xml b/qpid/java/qpid-test-utils/pom.xml
new file mode 100644
index 0000000000..4e90eb334c
--- /dev/null
+++ b/qpid/java/qpid-test-utils/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-test-utils</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit-version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+
+</project>
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/PortHelper.java b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/PortHelper.java
index d3586c364f..d3586c364f 100644
--- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/PortHelper.java
+++ b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/PortHelper.java
diff --git a/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
new file mode 100644
index 0000000000..20d5dd5453
--- /dev/null
+++ b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
@@ -0,0 +1,299 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.test.utils;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+
+public class QpidTestCase extends TestCase
+{
+ private static final String TEST_EXCLUDES = "test.excludes";
+ private static final String TEST_EXCLUDELIST = "test.excludelist";
+ private static final String TEST_EXCLUDEFILES = "test.excludefiles";
+ public static final String QPID_HOME = System.getProperty("QPID_HOME");
+ public static final String TEST_RESOURCES_DIR = QPID_HOME + "/../test-profiles/test_resources/";
+ public static final String TEST_PROFILES_DIR = QPID_HOME + "/../test-profiles/";
+ public static final String TMP_FOLDER = System.getProperty("java.io.tmpdir");
+ public static final String LOG4J_CONFIG_FILE_PATH = System.getProperty("log4j.configuration.file");
+
+ private static final Logger _logger = Logger.getLogger(QpidTestCase.class);
+
+ private final Map<Logger, Level> _loggerLevelSetForTest = new HashMap<Logger, Level>();
+ private final Map<String, String> _propertiesSetForTest = new HashMap<String, String>();
+
+ private String _testName;
+
+ /**
+ * Some tests are excluded when the property test.excludes is set to true.
+ * An exclusion list is either a file (prop test.excludesfile) which contains one test name
+ * to be excluded per line or a String (prop test.excludeslist) where tests to be excluded are
+ * separated by " ". Excluded tests are specified following the format:
+ * className#testName where className is the class of the test to be
+ * excluded and testName is the name of the test to be excluded.
+ * className#* excludes all the tests of the specified class.
+ */
+ static
+ {
+ if (Boolean.getBoolean("test.exclude"))
+ {
+ _logger.info("Some tests should be excluded, building the exclude list");
+ String exclusionListURIs = System.getProperty(TEST_EXCLUDEFILES, "");
+ String exclusionListString = System.getProperty(TEST_EXCLUDELIST, "");
+ String testExcludes = System.getProperty(TEST_EXCLUDES);
+
+ //For the maven build, process the test.excludes property
+ if(testExcludes != null && exclusionListURIs == "")
+ {
+ for (String exclude : testExcludes.split("\\s+"))
+ {
+ exclusionListURIs += TEST_PROFILES_DIR + "/" + exclude + ";";
+ }
+ }
+
+ List<String> exclusionList = new ArrayList<String>();
+
+ for (String uri : exclusionListURIs.split(";\\s*"))
+ {
+ File file = new File(uri);
+ if (file.exists())
+ {
+ _logger.info("Using exclude file: " + uri);
+ try
+ {
+ BufferedReader in = new BufferedReader(new FileReader(file));
+ String excludedTest = in.readLine();
+ do
+ {
+ exclusionList.add(excludedTest);
+ excludedTest = in.readLine();
+ }
+ while (excludedTest != null);
+ }
+ catch (IOException e)
+ {
+ _logger.warn("Exception when reading exclusion list", e);
+ }
+ }
+ else
+ {
+ _logger.info("Specified exclude file does not exist: " + uri);
+ }
+ }
+
+ if (!exclusionListString.equals(""))
+ {
+ _logger.info("Using excludeslist: " + exclusionListString);
+ for (String test : exclusionListString.split("\\s+"))
+ {
+ exclusionList.add(test);
+ }
+ }
+
+ _exclusionList = exclusionList;
+ }
+ }
+
+ protected static final String MESSAGE_STORE_CLASS_NAME_KEY = "messagestore.class.name";
+ protected static final String CONFIGURATION_STORE_CLASS_NAME_KEY = "configurationstore.class.name";
+
+ protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
+
+ private static List<String> _exclusionList;
+
+ public QpidTestCase()
+ {
+ super();
+ }
+
+ public void run(TestResult testResult)
+ {
+ if (_exclusionList != null && (_exclusionList.contains(getClass().getPackage().getName() + ".*") ||
+ _exclusionList.contains(getClass().getName() + "#*") ||
+ _exclusionList.contains(getClass().getName() + "#" + getName())))
+ {
+ _logger.info("Test: " + getName() + " is excluded");
+ testResult.endTest(this);
+ }
+ else
+ {
+ super.run(testResult);
+ }
+ }
+
+ public String getTestProfileMessageStoreClassName()
+ {
+ final String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
+ _logger.debug("MESSAGE_STORE_CLASS_NAME_KEY " + storeClass);
+
+ return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
+ }
+
+
+ public static final int MIN_PORT_NUMBER = 1;
+ public static final int MAX_PORT_NUMBER = 49151;
+
+
+ /**
+ * Gets the next available port starting at a port.
+ *
+ * @param fromPort the port to scan for availability
+ * @throws NoSuchElementException if there are no ports available
+ */
+ public int getNextAvailable(int fromPort)
+ {
+ if ((fromPort < MIN_PORT_NUMBER) || (fromPort > MAX_PORT_NUMBER))
+ {
+ throw new IllegalArgumentException("Invalid start port: " + fromPort);
+ }
+
+ PortHelper portHelper = new PortHelper();
+ for (int i = fromPort; i <= MAX_PORT_NUMBER; i++)
+ {
+ if (portHelper.isPortAvailable(i)) {
+ return i;
+ }
+ }
+
+ throw new NoSuchElementException("Could not find an available port above " + fromPort);
+ }
+
+ public int findFreePort()
+ {
+ return getNextAvailable(10000);
+ }
+
+ /**
+ * Set a System property for duration of this test only. The tearDown will
+ * guarantee to reset the property to its previous value after the test
+ * completes.
+ *
+ * @param property The property to set
+ * @param value the value to set it to, if null, the property will be cleared
+ */
+ protected void setTestSystemProperty(final String property, final String value)
+ {
+ if (!_propertiesSetForTest.containsKey(property))
+ {
+ // Record the current value so we can revert it later.
+ _propertiesSetForTest.put(property, System.getProperty(property));
+ }
+
+ if (value == null)
+ {
+ System.clearProperty(property);
+ }
+ else
+ {
+ System.setProperty(property, value);
+ }
+
+ _logger.info("Set system property \"" + property + "\" to: \"" + value + "\"");
+ }
+
+ /**
+ * Restore the System property values that were set by this test run.
+ */
+ protected void revertTestSystemProperties()
+ {
+ if(!_propertiesSetForTest.isEmpty())
+ {
+ _logger.debug("reverting " + _propertiesSetForTest.size() + " test properties");
+ for (String key : _propertiesSetForTest.keySet())
+ {
+ String value = _propertiesSetForTest.get(key);
+ if (value != null)
+ {
+ System.setProperty(key, value);
+ }
+ else
+ {
+ System.clearProperty(key);
+ }
+ }
+
+ _propertiesSetForTest.clear();
+ }
+ }
+
+ /**
+ * Adjust the VMs Log4j Settings just for this test run
+ *
+ * @param logger the logger to change
+ * @param level the level to set
+ */
+ protected void setLoggerLevel(Logger logger, Level level)
+ {
+ assertNotNull("Cannot set level of null logger", logger);
+ assertNotNull("Cannot set Logger("+logger.getName()+") to null level.",level);
+
+ if (!_loggerLevelSetForTest.containsKey(logger))
+ {
+ // Record the current value so we can revert it later.
+ _loggerLevelSetForTest.put(logger, logger.getLevel());
+ }
+
+ logger.setLevel(level);
+ }
+
+ /**
+ * Restore the logging levels defined by this test.
+ */
+ protected void revertLoggingLevels()
+ {
+ for (Logger logger : _loggerLevelSetForTest.keySet())
+ {
+ logger.setLevel(_loggerLevelSetForTest.get(logger));
+ }
+
+ _loggerLevelSetForTest.clear();
+ }
+
+ protected void tearDown() throws java.lang.Exception
+ {
+ _logger.info("========== tearDown " + _testName + " ==========");
+ revertTestSystemProperties();
+ revertLoggingLevels();
+ }
+
+ protected void setUp() throws Exception
+ {
+ _testName = getClass().getSimpleName() + "." + getName();
+ _logger.info("========== start " + _testName + " ==========");
+ }
+
+ protected String getTestName()
+ {
+ return _testName;
+ }
+}
diff --git a/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestFileUtils.java b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestFileUtils.java
new file mode 100644
index 0000000000..26bbe151d2
--- /dev/null
+++ b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestFileUtils.java
@@ -0,0 +1,238 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.test.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import java.io.FileOutputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * Utility methods intended to be used in tests that manipulate files
+ */
+public class TestFileUtils
+{
+ private static final String SYSTEM_TMP_DIR = System.getProperty("java.io.tmpdir");
+ private static final String SUFFIX = "tmp";
+
+ /**
+ * Create and return a temporary directory that will be deleted on exit.
+ */
+ public static File createTestDirectory()
+ {
+ String dirNameStem = TestFileUtils.class.getSimpleName() + "-testDir";
+ return createTestDirectory(dirNameStem, true);
+ }
+
+ /**
+ * Creates an empty directory with a name like /tmp/dirNameStem-12345678
+ */
+ public static File createTestDirectory(String dirNameStem, boolean deleteOnExit)
+ {
+ File testDir = new File(SYSTEM_TMP_DIR, dirNameStem + "-" + System.currentTimeMillis());
+ if (testDir.exists())
+ {
+ delete(testDir, true);
+ }
+
+ testDir.mkdirs();
+
+ if (deleteOnExit)
+ {
+ testDir.deleteOnExit();
+ }
+
+ return testDir;
+ }
+
+ public static File createTempFile(TestCase testcase)
+ {
+ return createTempFile(testcase, SUFFIX);
+ }
+
+ public static File createTempFile(TestCase testcase, String suffix)
+ {
+ String prefix = testcase.getClass().getSimpleName() + "-" + testcase.getName();
+
+ File tmpFile;
+ try
+ {
+ tmpFile = File.createTempFile(prefix, suffix);
+ tmpFile.deleteOnExit();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Cannot create temporary file with prefix " + prefix + " and suffix " + SUFFIX, e);
+ }
+
+ return tmpFile;
+ }
+
+ /**
+ * Creates a temporary file from the resource name given, using the resource name as the file suffix.
+ *
+ * This is required because the tests use the jar files as their class path.
+ */
+ public static File createTempFileFromResource(TestCase testCase, String resourceName)
+ {
+ File dst = createTempFile(testCase, resourceName);
+ InputStream in = testCase.getClass().getResourceAsStream(resourceName);
+ try
+ {
+ copy(in, dst);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Cannot copy resource " + resourceName +
+ " to temp file " + dst.getAbsolutePath(), e);
+ }
+ dst.deleteOnExit();
+ return dst;
+ }
+
+ /**
+ * Creates a temporary file for given test with given suffix in file name.
+ * The given content is stored in the file using UTF-8 encoding.
+ */
+ public static File createTempFile(TestCase testcase, String suffix, String content)
+ {
+ File file = createTempFile(testcase, suffix);
+ if (content != null)
+ {
+ FileOutputStream fos = null;
+ try
+ {
+ fos = new FileOutputStream(file);
+ fos.write(content.getBytes("UTF-8"));
+ fos.flush();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Cannot add the content into temp file " + file.getAbsolutePath(), e);
+ }
+ finally
+ {
+ if (fos != null)
+ {
+ try
+ {
+ fos.close();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Cannot close output stream into temp file " + file.getAbsolutePath(), e);
+ }
+ }
+ }
+ }
+ return file;
+ }
+
+ /**
+ * Delete a given file/directory,
+ * A directory will always require the recursive flag to be set.
+ * if a directory is specified and recursive set then delete the whole tree
+ *
+ * @param file the File object to start at
+ * @param recursive boolean to recurse if a directory is specified.
+ *
+ * @return <code>true</code> if and only if the file or directory is
+ * successfully deleted; <code>false</code> otherwise
+ */
+ public static boolean delete(File file, boolean recursive)
+ {
+ boolean success = true;
+
+ if (file.isDirectory())
+ {
+ if (recursive)
+ {
+ File[] files = file.listFiles();
+
+ // This can occur if the file is deleted outside the JVM
+ if (files == null)
+ {
+ return false;
+ }
+
+ for (int i = 0; i < files.length; i++)
+ {
+ success = delete(files[i], true) && success;
+ }
+
+ return success && file.delete();
+ }
+
+ return false;
+ }
+
+ return file.delete();
+ }
+
+ /**
+ * Copies the specified InputStream to the specified destination file. If the destination file does not exist,
+ * it is created.
+ *
+ * @param in The InputStream
+ * @param dst The destination file name.
+ * @throws IOException
+ */
+ public static void copy(InputStream in, File dst) throws IOException
+ {
+ if(in == null)
+ {
+ throw new IllegalArgumentException("Provided InputStream must not be null");
+ }
+
+ try
+ {
+ if (!dst.exists())
+ {
+ dst.createNewFile();
+ }
+
+ OutputStream out = new FileOutputStream(dst);
+
+ try
+ {
+ // Transfer bytes from in to out
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0)
+ {
+ out.write(buf, 0, len);
+ }
+ }
+ finally
+ {
+ out.close();
+ }
+ }
+ finally
+ {
+ in.close();
+ }
+ }
+}
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestSSLConstants.java b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestSSLConstants.java
index c48f164d98..c48f164d98 100644
--- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/TestSSLConstants.java
+++ b/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/TestSSLConstants.java
diff --git a/qpid/java/systests/build.xml b/qpid/java/systests/build.xml
index 59fcb8bbd2..78bfeaec46 100644
--- a/qpid/java/systests/build.xml
+++ b/qpid/java/systests/build.xml
@@ -34,7 +34,7 @@ nn - or more contributor license agreements. See the NOTICE file
<!-- The jca module is unusual in that it produces a jar with the name ra rather than jca. Unfortunately this means we
need to add both jca (finds jca's jar dependencies) and ra (to find the qpid-ra jar file itself). -->
- <property name="module.depends" value="client management/common broker broker/tests common amqp-1-0-common common/tests jca ra broker-plugins/access-control broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store broker-plugins/derby-store broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 ${systests.optional.depends}"/>
+ <property name="module.depends" value="qpid-test-utils client management/common broker-core broker-core/tests common amqp-1-0-common common/tests jca ra broker-plugins/access-control broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store broker-plugins/derby-store broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 ${systests.optional.depends}"/>
<property name="module.test.src" location="src/main/java"/>
<property name="module.test.excludes"
value="**/DropInTest.java,**/TestClientControlledTest.java"/>
diff --git a/qpid/java/systests/pom.xml b/qpid/java/systests/pom.xml
new file mode 100644
index 0000000000..62f1a89480
--- /dev/null
+++ b/qpid/java/systests/pom.xml
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-systests</artifactId>
+
+ <properties>
+ <broker.home.dir>target/qpid-broker/${project.version}</broker.home.dir>
+ <!-- test properties -->
+ <qpid.home>${basedir}/${broker.home.dir}</qpid.home>
+ <qpid.home.qbtc.output>${qpid.home}/qbtc-output</qpid.home.qbtc.output>
+ </properties>
+
+ <dependencies>
+ <!-- general test deps -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit-version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>${mockito-version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-test-utils</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- client deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- jca deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-jca</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+ <version>2.0.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- broker deps -->
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-core</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-access-control</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-0-10-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-0-10</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-8-to-1-0</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-amqp-msg-conv-0-10-to-1-0</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-derby-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-jdbc-provider-bone</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-jdbc-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-management-http</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-management-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker-plugins-memory-store</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- optional broker plugin modules
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-bdbstore-jmx</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency> -->
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/*.java/</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testSourceDirectory>src/main/java</testSourceDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <workingDirectory>${basedir}/..</workingDirectory>
+ <!-- Skip the default test phase, bind to the
+ integration-test phase below instead -->
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <!-- copy the systests config files into the ${qpid.home}/etc
+ directory where the tests expect them -->
+ <execution>
+ <id>copy-systests-etc-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>etc/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <!-- copy the ../test-profiles directory into ${qpid.home}/..
+ directory where the tests expect it -->
+ <execution>
+ <id>copy-test-profile-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${qpid.home}/..</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/..</directory>
+ <includes>
+ <include>test-profiles/</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <executions>
+ <execution>
+ <id>extract-broker-distribution</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputAbsoluteArtifactFilename>false</outputAbsoluteArtifactFilename>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-broker</artifactId>
+ <version>${project.version}</version>
+ <classifier>bin</classifier>
+ <type>tar.gz</type>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
index 0d4b4ba9f8..c999be634b 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
@@ -22,7 +22,10 @@ package org.apache.qpid.server.protocol;
import static org.mockito.Mockito.when;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
import java.nio.ByteBuffer;
+import java.security.Principal;
import java.util.EnumSet;
import java.util.Set;
@@ -32,7 +35,8 @@ import org.apache.qpid.server.util.BrokerTestHelper;
import org.apache.qpid.server.virtualhost.VirtualHost;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.transport.TestNetworkConnection;
+import org.apache.qpid.transport.Sender;
+import org.apache.qpid.transport.network.NetworkConnection;
public class MultiVersionProtocolEngineFactoryTest extends QpidTestCase
{
@@ -202,4 +206,95 @@ public class MultiVersionProtocolEngineFactoryTest extends QpidTestCase
//expected
}
}
+
+ private static class TestNetworkConnection implements NetworkConnection
+ {
+ private String _remoteHost = "127.0.0.1";
+ private String _localHost = "127.0.0.1";
+ private int _port = 1;
+ private final Sender<ByteBuffer> _sender;
+
+ public TestNetworkConnection()
+ {
+ _sender = new Sender<ByteBuffer>()
+ {
+ public void setIdleTimeout(int i)
+ {
+ }
+
+ public void send(ByteBuffer msg)
+ {
+ }
+
+ public void flush()
+ {
+ }
+
+ public void close()
+ {
+ }
+ };
+ }
+
+ @Override
+ public SocketAddress getLocalAddress()
+ {
+ return new InetSocketAddress(_localHost, _port);
+ }
+
+ @Override
+ public SocketAddress getRemoteAddress()
+ {
+ return new InetSocketAddress(_remoteHost, _port);
+ }
+
+ @Override
+ public void setMaxReadIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void setPeerPrincipal(Principal principal)
+ {
+ }
+
+ @Override
+ public Principal getPeerPrincipal()
+ {
+ return null;
+ }
+
+ @Override
+ public int getMaxReadIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public int getMaxWriteIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public void setMaxWriteIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public Sender<ByteBuffer> getSender()
+ {
+ return _sender;
+ }
+
+ @Override
+ public void start()
+ {
+ }
+ }
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
index 11e1da18b3..d5cee17fa8 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
@@ -110,10 +110,10 @@ public class MessageGroupQueueTest extends QpidBrokerTestCase
private void simpleGroupAssignment(boolean sharedGroups) throws AMQException, JMSException
{
final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("qpid.group_header_key","group");
+ arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
if(sharedGroups)
{
- arguments.put("qpid.shared_msg_group","1");
+ arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
}
((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
queue = (Queue) producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
@@ -200,10 +200,10 @@ public class MessageGroupQueueTest extends QpidBrokerTestCase
private void consumerCloseGroupAssignment(boolean sharedGroups) throws AMQException, JMSException
{
final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("qpid.group_header_key","group");
+ arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
if(sharedGroups)
{
- arguments.put("qpid.shared_msg_group","1");
+ arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
}
((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
queue = (Queue) producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
@@ -299,10 +299,10 @@ public class MessageGroupQueueTest extends QpidBrokerTestCase
private void consumerCloseWithRelease(boolean sharedGroups) throws AMQException, JMSException
{
final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("qpid.group_header_key","group");
+ arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
if(sharedGroups)
{
- arguments.put("qpid.shared_msg_group","1");
+ arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
}
((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
@@ -391,10 +391,10 @@ public class MessageGroupQueueTest extends QpidBrokerTestCase
private void groupAssignmentOnEmpty(boolean sharedGroups) throws AMQException, JMSException
{
final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("qpid.group_header_key","group");
+ arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
if(sharedGroups)
{
- arguments.put("qpid.shared_msg_group","1");
+ arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
}
((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
index 61ca6d9c28..c4b16133f0 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
@@ -106,9 +106,15 @@ public class StoreOverfullTest extends QpidBrokerTestCase
MessageSender sender = sendMessagesAsync(_producer, _producerSession, TEST_SIZE, 50L, sentMessages);
+ long timeoutPoint = System.currentTimeMillis() + 20 * 1000;
+
while(!((AMQSession<?,?>)_producerSession).isFlowBlocked())
{
Thread.sleep(100l);
+ if(System.currentTimeMillis() > timeoutPoint)
+ {
+ throw new RuntimeException("Timed out waiting for session to be blocked");
+ }
}
int sentCount = sentMessages.get();
assertFalse("Did not block before sending all messages", TEST_SIZE == sentCount);
@@ -168,17 +174,28 @@ public class StoreOverfullTest extends QpidBrokerTestCase
sendMessagesAsync(_producer, _producerSession, TEST_SIZE, 50L, sentMessages);
sendMessagesAsync(secondProducer, secondProducerSession, TEST_SIZE, 50L, sentMessages2);
+ long timeoutPoint = System.currentTimeMillis() + 20 * 1000;
+
while(!((AMQSession<?,?>)_producerSession).isFlowBlocked())
{
Thread.sleep(100l);
+ if(System.currentTimeMillis() > timeoutPoint)
+ {
+ throw new RuntimeException("Timed out waiting for session to be blocked");
+ }
}
int sentCount = sentMessages.get();
assertFalse("Did not block before sending all messages", TEST_SIZE == sentCount);
+ timeoutPoint = System.currentTimeMillis() + 20 * 1000;
while(!((AMQSession<?,?>)secondProducerSession).isFlowBlocked())
{
Thread.sleep(100l);
+ if(System.currentTimeMillis() > timeoutPoint)
+ {
+ throw new RuntimeException("Timed out waiting for second session to be blocked");
+ }
}
int sentCount2 = sentMessages2.get();
assertFalse("Did not block before sending all messages", TEST_SIZE == sentCount2);
@@ -220,18 +237,30 @@ public class StoreOverfullTest extends QpidBrokerTestCase
sendMessagesAsync(_producer, _producerSession, TEST_SIZE, 50L, sentMessages);
+ long timeoutPoint = System.currentTimeMillis() + 20 * 1000;
+
while(!((AMQSession<?,?>)_producerSession).isFlowBlocked())
{
Thread.sleep(100l);
+ if(System.currentTimeMillis() > timeoutPoint)
+ {
+ throw new RuntimeException("Timed out waiting for session to be blocked");
+ }
}
int sentCount = sentMessages.get();
assertFalse("Did not block before sending all messages", TEST_SIZE == sentCount);
sendMessagesAsync(secondProducer, secondProducerSession, TEST_SIZE, 50L, sentMessages2);
+ timeoutPoint = System.currentTimeMillis() + 20 * 1000;
+
while(!((AMQSession<?,?>)_producerSession).isFlowBlocked())
{
Thread.sleep(100l);
+ if(System.currentTimeMillis() > timeoutPoint)
+ {
+ throw new RuntimeException("Timed out waiting for session to be blocked");
+ }
}
int sentCount2 = sentMessages2.get();
assertFalse("Did not block before sending all messages", TEST_SIZE == sentCount2);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
index 1d2f6e3427..b5d036c9e4 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
@@ -237,7 +237,7 @@ public class BrokerRestTest extends QpidRestTestCase
assertEquals("Unexpected value of attribute " + Broker.BUILD_VERSION, QpidProperties.getBuildVersion(),
brokerDetails.get(Broker.BUILD_VERSION));
- assertEquals("Unexpected value of attribute " + Broker.OPERATING_SYSTEM, System.getProperty("os.name") + " "
+ assertEquals("Unexpected value of attribute " + Broker.OPERATING_SYSTEM, OS_NAME + " "
+ System.getProperty("os.version") + " " + System.getProperty("os.arch"),
brokerDetails.get(Broker.OPERATING_SYSTEM));
assertEquals(
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/LogViewerTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/LogViewerTest.java
index 6166e8afc1..e00a9889e6 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/LogViewerTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/LogViewerTest.java
@@ -49,11 +49,11 @@ public class LogViewerTest extends QpidRestTestCase
public void testGetLogFiles() throws Exception
{
- List<Map<String, Object>> logFiles = getRestTestHelper().getJsonAsList("/rest/logfiles");
+ List<Map<String, Object>> logFiles = getRestTestHelper().getJsonAsList("/rest/logfilenames");
assertNotNull("Log files data cannot be null", logFiles);
// 1 file appender is configured in QPID default log4j xml:
- assertEquals("Unexpected number of log files", 1, logFiles.size());
+ assertTrue("Unexpected number of log files", logFiles.size() > 0);
Map<String, Object> logFileDetails = logFiles.get(0);
assertEquals("Unexpected log file name", _expectedLogFileName, logFileDetails.get("name"));
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java
index 7c0883ec84..9965587343 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java
@@ -125,6 +125,17 @@ public class UserPreferencesRestTest extends QpidRestTestCase
assertNull("User webadmin is found", findUser("webadmin", users));
}
+ public void testDeleteMultipleUser() throws Exception
+ {
+ int status = getRestTestHelper().submitRequest("/rest/userpreferences?user="
+ + URLEncoder.encode(TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER + "/webadmin", "UTF-8")
+ + "&user=" + URLEncoder.encode(TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER + "/admin", "UTF-8"),
+ "DELETE", null);
+ assertEquals("Unexpected status ", 200, status);
+ List<Map<String, Object>> users = getRestTestHelper().getJsonAsList("/rest/userpreferences");
+ assertEquals("Unexpected number of users", 0, users.size());
+ }
+
private Map<String, Object> findUser(String userName, List<Map<String, Object>> users)
{
for (Map<String, Object> map : users)
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
index 5a2ebe3e8e..96ea5c92b3 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
@@ -69,7 +69,7 @@ public class LogViewerACLTest extends QpidRestTestCase
{
getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
- int responseCode = getRestTestHelper().submitRequest("/rest/logfiles", "GET", null);
+ int responseCode = getRestTestHelper().submitRequest("/rest/logfilenames", "GET", null);
assertEquals("Access to log files should be allowed", 200, responseCode);
}
@@ -77,7 +77,7 @@ public class LogViewerACLTest extends QpidRestTestCase
{
getRestTestHelper().setUsernameAndPassword(DENIED_USER, DENIED_USER);
- int responseCode = getRestTestHelper().submitRequest("/rest/logfiles", "GET", null);
+ int responseCode = getRestTestHelper().submitRequest("/rest/logfilenames", "GET", null);
assertEquals("Access to log files should be denied", 403, responseCode);
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CloseOnNoRouteForMandatoryMessageTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CloseOnNoRouteForMandatoryMessageTest.java
index a8a72c20fc..deb8e4f12b 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CloseOnNoRouteForMandatoryMessageTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CloseOnNoRouteForMandatoryMessageTest.java
@@ -23,12 +23,14 @@ import java.util.Map;
import javax.jms.Connection;
import javax.jms.Destination;
+import javax.jms.IllegalStateException;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.naming.NamingException;
+import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.AMQSession;
@@ -46,6 +48,8 @@ import org.apache.qpid.url.URLSyntaxException;
*/
public class CloseOnNoRouteForMandatoryMessageTest extends QpidBrokerTestCase
{
+ private static final Logger _logger = Logger.getLogger(CloseOnNoRouteForMandatoryMessageTest.class);
+
private Connection _connection;
private UnroutableMessageTestExceptionListener _testExceptionListener = new UnroutableMessageTestExceptionListener();
@@ -73,8 +77,15 @@ public class CloseOnNoRouteForMandatoryMessageTest extends QpidBrokerTestCase
transactedSession.commit();
fail("Expected exception not thrown");
}
+ catch (IllegalStateException ise)
+ {
+ _logger.debug("Caught exception", ise);
+ //The session was marked closed even before we had a chance to call commit on it
+ assertTrue("ISE did not indicate closure", ise.getMessage().contains("closed"));
+ }
catch(JMSException e)
{
+ _logger.debug("Caught exception", e);
_testExceptionListener.assertNoRoute(e, testQueueName);
}
_testExceptionListener.assertReceivedNoRoute(testQueueName);
@@ -106,8 +117,15 @@ public class CloseOnNoRouteForMandatoryMessageTest extends QpidBrokerTestCase
transactedSession.commit();
fail("Expected exception not thrown");
}
+ catch (IllegalStateException ise)
+ {
+ _logger.debug("Caught exception", ise);
+ //The session was marked closed even before we had a chance to call commit on it
+ assertTrue("ISE did not indicate closure", ise.getMessage().contains("closed"));
+ }
catch (JMSException e)
{
+ _logger.debug("Caught exception", e);
AMQException noRouteException = (AMQException) e.getLinkedException();
assertNotNull("AMQException should be linked to JMSException", noRouteException);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
index 1a7e9dfc96..e893a58282 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
@@ -20,17 +20,20 @@
*/
package org.apache.qpid.test.unit.client.protocol;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.ByteBuffer;
+import java.security.Principal;
+
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.protocol.AMQProtocolHandler;
import org.apache.qpid.client.protocol.AMQProtocolSession;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.transport.TestNetworkConnection;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.UnknownHostException;
+import org.apache.qpid.transport.Sender;
+import org.apache.qpid.transport.network.NetworkConnection;
public class AMQProtocolSessionTest extends QpidBrokerTestCase
{
@@ -97,4 +100,104 @@ public class AMQProtocolSessionTest extends QpidBrokerTestCase
_testSession.getNetworkConnection().setLocalAddress(address);
assertEquals("Wrong queue name", queueName, _testSession.genQueueName().asString());
}
+
+ private static class TestNetworkConnection implements NetworkConnection
+ {
+ private String _remoteHost = "127.0.0.1";
+ private String _localHost = "127.0.0.1";
+ private int _port = 1;
+ private SocketAddress _localAddress = null;
+ private final Sender<ByteBuffer> _sender;
+
+ public TestNetworkConnection()
+ {
+ _sender = new Sender<ByteBuffer>()
+ {
+
+ public void setIdleTimeout(int i)
+ {
+
+ }
+
+ public void send(ByteBuffer msg)
+ {
+
+ }
+
+ public void flush()
+ {
+
+ }
+
+ public void close()
+ {
+
+ }
+ };
+ }
+
+ @Override
+ public SocketAddress getLocalAddress()
+ {
+ return (_localAddress != null) ? _localAddress : new InetSocketAddress(_localHost, _port);
+ }
+
+ @Override
+ public SocketAddress getRemoteAddress()
+ {
+ return new InetSocketAddress(_remoteHost, _port);
+ }
+
+ @Override
+ public void setMaxReadIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void setPeerPrincipal(Principal principal)
+ {
+ }
+
+ @Override
+ public Principal getPeerPrincipal()
+ {
+ return null;
+ }
+
+ @Override
+ public int getMaxReadIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public int getMaxWriteIdle()
+ {
+ return 0;
+ }
+
+ @Override
+ public void setMaxWriteIdle(int idleTime)
+ {
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ public void setLocalAddress(SocketAddress address)
+ {
+ _localAddress = address;
+ }
+
+ public Sender<ByteBuffer> getSender()
+ {
+ return _sender;
+ }
+
+ public void start()
+ {
+ }
+ }
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
index e07c0ecbe9..cc95afafa2 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
@@ -30,7 +30,7 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import java.io.BufferedReader;
-import java.io.FileInputStream;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;
@@ -56,9 +56,9 @@ public class UTF8Test extends QpidBrokerTestCase
private void invoke(String name) throws Exception
{
- String path = System.getProperties().getProperty("QPID_HOME");
- path = path + "/../systests/src/main/java/org/apache/qpid/test/unit/message/" + name;
- BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF8"));
+ InputStream stream = getClass().getClassLoader().getResourceAsStream("org/apache/qpid/test/unit/message/" + name);
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(stream, "UTF8"));
runTest(in.readLine(), in.readLine(), in.readLine(), in.readLine());
in.close();
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
index 38a7b90ebd..8248fc9de2 100755
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
@@ -19,6 +19,7 @@ package org.apache.qpid.test.utils;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.net.URISyntaxException;
@@ -157,6 +158,8 @@ public class QpidBrokerTestCase extends QpidTestCase
public static final int FAILING_PORT = Integer.parseInt(System.getProperty("test.port.alt"));
public static final int DEFAULT_MANAGEMENT_PORT = Integer.getInteger("test.mport", DEFAULT_JMXPORT_REGISTRYSERVER);
public static final int DEFAULT_SSL_PORT = Integer.getInteger("test.port.ssl", DEFAULT_SSL_PORT_VALUE);
+ public static final String OS_NAME = System.getProperty("os.name");
+ public static final boolean IS_OS_WINDOWS = String.valueOf(OS_NAME).toLowerCase().contains("windows");
protected String _brokerLanguage = System.getProperty(BROKER_LANGUAGE, JAVA);
protected BrokerType _brokerType = BrokerType.valueOf(System.getProperty(BROKER_TYPE, "").toUpperCase());
@@ -168,7 +171,7 @@ public class QpidBrokerTestCase extends QpidTestCase
protected Boolean _brokerPersistent = Boolean.getBoolean(BROKER_PERSITENT);
protected static String _brokerLogPrefix = System.getProperty(BROKER_LOG_PREFIX,"BROKER: ");
- protected static boolean _interleaveBrokerLog = Boolean.getBoolean(BROKER_LOG_INTERLEAVE);
+ protected static boolean _interleaveBrokerLog = Boolean.valueOf(System.getProperty(BROKER_LOG_INTERLEAVE,"true"));
protected File _outputFile;
@@ -643,7 +646,32 @@ public class QpidBrokerTestCase extends QpidTestCase
{
File configLocation = new File(file);
File workingDirectory = new File(System.getProperty("user.dir"));
- return configLocation.getAbsolutePath().replace(workingDirectory.getAbsolutePath(), "").substring(1);
+
+ _logger.debug("Converting path to be relative to working directory: " + file);
+
+ try
+ {
+ String configPath = configLocation.getAbsolutePath();
+ String workingDirectoryPath = workingDirectory.getCanonicalPath();
+ if (IS_OS_WINDOWS)
+ {
+ configPath = configPath.toLowerCase();
+ workingDirectoryPath = workingDirectoryPath.toLowerCase();
+ }
+ if(!configPath.startsWith(workingDirectoryPath))
+ {
+ throw new RuntimeException("Provided path is not a child of the working directory: " + workingDirectoryPath);
+ }
+
+ String substring = configPath.replace(workingDirectoryPath, "").substring(1);
+ _logger.debug("Converted relative path: " + substring);
+
+ return substring;
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Problem while converting to relative path", e);
+ }
}
protected String saveTestConfiguration(int port, TestBrokerConfiguration testConfiguration)
diff --git a/qpid/java/tools/pom.xml b/qpid/java/tools/pom.xml
new file mode 100644
index 0000000000..edc800a172
--- /dev/null
+++ b/qpid/java/tools/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-project</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>qpid-tools</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py
index ac59bcf0a6..06bbe610b8 100644
--- a/qpid/python/qpid/messaging/driver.py
+++ b/qpid/python/qpid/messaging/driver.py
@@ -259,6 +259,15 @@ class LinkIn:
reliability = link_opts.get("reliability")
cmds = [MessageCancel(_rcv.destination)]
cmds.extend(_rcv.on_unlink)
+ msgs = [] #release back messages for the closing receiver
+ msg = rcv.session._pop(rcv)
+ while msg is not None:
+ msgs.append(msg)
+ msg = rcv.session._pop(rcv)
+ if len(msgs) > 0:
+ ids = RangedSet(*[m._transfer_id for m in msgs])
+ log.debug("releasing back messages: %s, as receiver is closing", ids)
+ cmds.append(MessageRelease(ids, True))
sst.write_cmds(cmds, action)
def del_link(self, sst, rcv, _rcv):
@@ -1283,6 +1292,11 @@ class Engine:
msg = self._decode(xfr)
rcv = sst.destinations[xfr.destination].target
msg._receiver = rcv
+ if rcv.closing or rcv.closed: # release message to a closing receiver
+ ids = RangedSet(*[msg._transfer_id])
+ log.debug("releasing back %s message: %s, as receiver is closing", ids, msg)
+ sst.write_cmd(MessageRelease(ids, True))
+ return
if rcv.impending is not UNLIMITED:
assert rcv.received < rcv.impending, "%s, %s" % (rcv.received, rcv.impending)
rcv.received += 1
diff --git a/qpid/python/qpid/messaging/endpoints.py b/qpid/python/qpid/messaging/endpoints.py
index 3453971a77..6f0e9432dc 100644
--- a/qpid/python/qpid/messaging/endpoints.py
+++ b/qpid/python/qpid/messaging/endpoints.py
@@ -70,8 +70,8 @@ class Connection(Endpoint):
def __init__(self, url=None, **options):
"""
- Creates a connection. A newly created connection must be connected
- with the Connection.connect() method before it can be used.
+ Creates a connection. A newly created connection must be opened
+ with the Connection.open() method before it can be used.
@type url: str
@param url: [ <username> [ / <password> ] @ ] <host> [ : <port> ]
@@ -88,11 +88,6 @@ class Connection(Endpoint):
@param username: the username for authentication (overriden by url)
@type password: str
@param password: the password for authentication (overriden by url)
-
- * - sasl_min_ssf: the minimum acceptable security strength factor
- * - sasl_max_ssf: the minimum acceptable security strength factor
- * - sasl_service: the service name if needed by the SASL mechanism in use
-
@type sasl_mechanisms: str
@param sasl_mechanisms: space separated list of permitted sasl mechanisms
@type sasl_service: str
@@ -100,7 +95,7 @@ class Connection(Endpoint):
@type sasl_min_ssf: int
@param sasl_min_ssf: the minimum acceptable security strength factor
@type sasl_max_ssf: int
- @param sasl_max_ssf: the minimum acceptable security strength factor
+ @param sasl_max_ssf: the maximum acceptable security strength factor
@type reconnect: bool
@param reconnect: enable/disable automatic reconnect
diff --git a/qpid/python/qpid/tests/messaging/implementation.py b/qpid/python/qpid/tests/messaging/implementation.py
index c81fb6c99c..fce60c6f38 100644
--- a/qpid/python/qpid/tests/messaging/implementation.py
+++ b/qpid/python/qpid/tests/messaging/implementation.py
@@ -16,9 +16,13 @@
# specific language governing permissions and limitations
# under the License.
#
-try:
+import os
+if 'QPID_USE_SWIG_CLIENT' in os.environ and os.environ['QPID_USE_SWIG_CLIENT']:
+ try:
from qpid_messaging import *
from qpid.datatypes import uuid4
-except ImportError, e:
- print "Falling back to pure bindings, %s" % e
+ except ImportError, e:
+ print "Swigged client not found. Falling back to pure bindings, %s\n" % e
from qpid.messaging import *
+else:
+ from qpid.messaging import *
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/stats.py b/qpid/tests/src/py/qpid_tests/broker_0_10/stats.py
index 353f3631eb..fb4521528b 100644
--- a/qpid/tests/src/py/qpid_tests/broker_0_10/stats.py
+++ b/qpid/tests/src/py/qpid_tests/broker_0_10/stats.py
@@ -67,34 +67,36 @@ class BrokerStatsTests(Base):
start_broker = agent.getBroker()
agent.addExchange("direct", "stats-test-exchange")
- sess = self.setup_session()
- tx_a = sess.sender("stats-test-exchange/a")
- tx_b = sess.sender("stats-test-exchange/b")
- rx_a = sess.receiver("stats-test-exchange/a")
-
- exchange = agent.getExchange("stats-test-exchange")
- self.failUnless(exchange, "expected a valid exchange object")
- self.assertEqual(exchange.msgReceives, 0, "msgReceives")
- self.assertEqual(exchange.msgDrops, 0, "msgDrops")
- self.assertEqual(exchange.msgRoutes, 0, "msgRoutes")
- self.assertEqual(exchange.byteReceives, 0, "byteReceives")
- self.assertEqual(exchange.byteDrops, 0, "byteDrops")
- self.assertEqual(exchange.byteRoutes, 0, "byteRoutes")
-
- tx_a.send("0123456789")
- tx_b.send("01234567890123456789")
- tx_a.send("012345678901234567890123456789")
- tx_b.send("0123456789012345678901234567890123456789")
-
- exchange.update()
- self.assertEqual(exchange.msgReceives, 4, "msgReceives")
- self.assertEqual(exchange.msgDrops, 2, "msgDrops")
- self.assertEqual(exchange.msgRoutes, 2, "msgRoutes")
- self.assertEqual(exchange.byteReceives, 100, "byteReceives")
- self.assertEqual(exchange.byteDrops, 60, "byteDrops")
- self.assertEqual(exchange.byteRoutes, 40, "byteRoutes")
-
- agent.delExchange("stats-test-exchange")
+ try:
+ sess = self.setup_session()
+ tx_a = sess.sender("stats-test-exchange/a")
+ tx_b = sess.sender("stats-test-exchange/b")
+ rx_a = sess.receiver("stats-test-exchange/a")
+
+ exchange = agent.getExchange("stats-test-exchange")
+ self.failUnless(exchange, "expected a valid exchange object")
+ self.assertEqual(exchange.msgReceives, 0, "msgReceives")
+ self.assertEqual(exchange.msgDrops, 0, "msgDrops")
+ self.assertEqual(exchange.msgRoutes, 0, "msgRoutes")
+ self.assertEqual(exchange.byteReceives, 0, "byteReceives")
+ self.assertEqual(exchange.byteDrops, 0, "byteDrops")
+ self.assertEqual(exchange.byteRoutes, 0, "byteRoutes")
+
+ tx_a.send("0123456789")
+ tx_b.send("01234567890123456789")
+ tx_a.send("012345678901234567890123456789")
+ tx_b.send("0123456789012345678901234567890123456789")
+
+ overhead = 63 #overhead added to message from headers
+ exchange.update()
+ self.assertEqual(exchange.msgReceives, 4, "msgReceives")
+ self.assertEqual(exchange.msgDrops, 2, "msgDrops")
+ self.assertEqual(exchange.msgRoutes, 2, "msgRoutes")
+ self.assertEqual(exchange.byteReceives, 100+(4*overhead), "byteReceives")
+ self.assertEqual(exchange.byteDrops, 60+(2*overhead), "byteDrops")
+ self.assertEqual(exchange.byteRoutes, 40+(2*overhead), "byteRoutes")
+ finally:
+ agent.delExchange("stats-test-exchange")
def test_enqueues_dequeues(self):
agent = self.setup_access()
@@ -117,14 +119,15 @@ class BrokerStatsTests(Base):
tx.send("01234567890123456789")
tx.send("012345678901234567890123456789")
tx.send("0123456789012345678901234567890123456789")
+ overhead = 38 #overhead added to message from headers
queue.update()
self.assertEqual(queue.msgTotalEnqueues, 4, "msgTotalEnqueues")
- self.assertEqual(queue.byteTotalEnqueues, 100, "byteTotalEnqueues")
+ self.assertEqual(queue.byteTotalEnqueues, 100+(4*overhead), "byteTotalEnqueues")
self.assertEqual(queue.msgTotalDequeues, 0, "msgTotalDequeues")
self.assertEqual(queue.byteTotalDequeues, 0, "byteTotalDequeues")
self.assertEqual(queue.msgDepth, 4, "msgDepth")
- self.assertEqual(queue.byteDepth, 100, "byteDepth")
+ self.assertEqual(queue.byteDepth, 100+(4*overhead), "byteDepth")
now_broker = agent.getBroker()
self.failUnless((now_broker.msgTotalEnqueues - start_broker.msgTotalEnqueues) >= 4, "broker msgTotalEnqueues")
@@ -136,11 +139,11 @@ class BrokerStatsTests(Base):
queue.update()
self.assertEqual(queue.msgTotalEnqueues, 4, "msgTotalEnqueues")
- self.assertEqual(queue.byteTotalEnqueues, 100, "byteTotalEnqueues")
+ self.assertEqual(queue.byteTotalEnqueues, 100+(4*overhead), "byteTotalEnqueues")
self.assertEqual(queue.msgTotalDequeues, 2, "msgTotalDequeues")
- self.assertEqual(queue.byteTotalDequeues, 30, "byteTotalDequeues")
+ self.assertEqual(queue.byteTotalDequeues, 30+(2*overhead), "byteTotalDequeues")
self.assertEqual(queue.msgDepth, 2, "msgDepth")
- self.assertEqual(queue.byteDepth, 70, "byteDepth")
+ self.assertEqual(queue.byteDepth, 70+(2*overhead), "byteDepth")
now_broker = agent.getBroker()
self.failUnless((now_broker.msgTotalDequeues - start_broker.msgTotalDequeues) >= 2, "broker msgTotalDequeues")
@@ -165,6 +168,7 @@ class BrokerStatsTests(Base):
tx.send("0123456789")
tx.send("0123456789")
tx.send("0123456789")
+ overhead = 41 #overhead added to message from headers
queue = agent.getQueue("tx_enqueue_test")
self.failUnless(queue, "expected a valid queue object")
@@ -180,9 +184,9 @@ class BrokerStatsTests(Base):
sess.commit()
queue.update()
self.assertEqual(queue.msgTotalEnqueues, 4, "msgTotalEnqueues post-tx-commit")
- self.assertEqual(queue.byteTotalEnqueues, 40, "byteTotalEnqueues post-tx-commit")
+ self.assertEqual(queue.byteTotalEnqueues, 40+(4*overhead), "byteTotalEnqueues post-tx-commit")
self.assertEqual(queue.msgTxnEnqueues, 4, "msgTxnEnqueues post-tx-commit")
- self.assertEqual(queue.byteTxnEnqueues, 40, "byteTxnEnqueues post-tx-commit")
+ self.assertEqual(queue.byteTxnEnqueues, 40+(4*overhead), "byteTxnEnqueues post-tx-commit")
self.assertEqual(queue.msgTotalDequeues, 0, "msgTotalDequeues post-tx-commit")
self.assertEqual(queue.byteTotalDequeues, 0, "byteTotalDequeues post-tx-commit")
self.assertEqual(queue.msgTxnDequeues, 0, "msgTxnDequeues post-tx-commit")
@@ -198,9 +202,9 @@ class BrokerStatsTests(Base):
queue.update()
self.assertEqual(queue.msgTotalEnqueues, 4, "msgTotalEnqueues pre-rx-commit")
- self.assertEqual(queue.byteTotalEnqueues, 40, "byteTotalEnqueues pre-rx-commit")
+ self.assertEqual(queue.byteTotalEnqueues, 40+(4*overhead), "byteTotalEnqueues pre-rx-commit")
self.assertEqual(queue.msgTxnEnqueues, 4, "msgTxnEnqueues pre-rx-commit")
- self.assertEqual(queue.byteTxnEnqueues, 40, "byteTxnEnqueues pre-rx-commit")
+ self.assertEqual(queue.byteTxnEnqueues, 40+(4*overhead), "byteTxnEnqueues pre-rx-commit")
self.assertEqual(queue.msgTotalDequeues, 0, "msgTotalDequeues pre-rx-commit")
self.assertEqual(queue.byteTotalDequeues, 0, "byteTotalDequeues pre-rx-commit")
self.assertEqual(queue.msgTxnDequeues, 0, "msgTxnDequeues pre-rx-commit")
@@ -211,22 +215,22 @@ class BrokerStatsTests(Base):
queue.update()
self.assertEqual(queue.msgTotalEnqueues, 4, "msgTotalEnqueues post-rx-commit")
- self.assertEqual(queue.byteTotalEnqueues, 40, "byteTotalEnqueues post-rx-commit")
+ self.assertEqual(queue.byteTotalEnqueues, 40+(4*overhead), "byteTotalEnqueues post-rx-commit")
self.assertEqual(queue.msgTxnEnqueues, 4, "msgTxnEnqueues post-rx-commit")
- self.assertEqual(queue.byteTxnEnqueues, 40, "byteTxnEnqueues post-rx-commit")
+ self.assertEqual(queue.byteTxnEnqueues, 40+(4*overhead), "byteTxnEnqueues post-rx-commit")
self.assertEqual(queue.msgTotalDequeues, 4, "msgTotalDequeues post-rx-commit")
- self.assertEqual(queue.byteTotalDequeues, 40, "byteTotalDequeues post-rx-commit")
+ self.assertEqual(queue.byteTotalDequeues, 40+(4*overhead), "byteTotalDequeues post-rx-commit")
self.assertEqual(queue.msgTxnDequeues, 4, "msgTxnDequeues post-rx-commit")
- self.assertEqual(queue.byteTxnDequeues, 40, "byteTxnDequeues post-rx-commit")
+ self.assertEqual(queue.byteTxnDequeues, 40+(4*overhead), "byteTxnDequeues post-rx-commit")
sess.close()
sess2.close()
now_broker = agent.getBroker()
self.assertEqual(now_broker.msgTxnEnqueues - start_broker.msgTxnEnqueues, 4, "broker msgTxnEnqueues")
- self.assertEqual(now_broker.byteTxnEnqueues - start_broker.byteTxnEnqueues, 40, "broker byteTxnEnqueues")
+ self.assertEqual(now_broker.byteTxnEnqueues - start_broker.byteTxnEnqueues, 40+(4*overhead), "broker byteTxnEnqueues")
self.assertEqual(now_broker.msgTxnDequeues - start_broker.msgTxnDequeues, 4, "broker msgTxnDequeues")
- self.assertEqual(now_broker.byteTxnDequeues - start_broker.byteTxnDequeues, 40, "broker byteTxnDequeues")
+ self.assertEqual(now_broker.byteTxnDequeues - start_broker.byteTxnDequeues, 40+(4*overhead), "broker byteTxnDequeues")
def test_discards_no_route(self):
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/threshold.py b/qpid/tests/src/py/qpid_tests/broker_0_10/threshold.py
index 444269ef82..fa172c66d2 100644
--- a/qpid/tests/src/py/qpid_tests/broker_0_10/threshold.py
+++ b/qpid/tests/src/py/qpid_tests/broker_0_10/threshold.py
@@ -65,12 +65,13 @@ class ThresholdTests (Base):
rcvBw = self.ssn.receiver("qmf.default.topic/agent.ind.event.org_apache_qpid_broker.queueThresholdExceeded.#")
snd = self.ssn.sender("ttq; {create:always, node: {x-declare:{auto_delete:True,exclusive:True,arguments:{%s}}}}" % astr)
rcv = self.ssn.receiver("ttq")
+ overhead = 29 #additional bytes in broker's view of message size from headers etc
size = 0
count = 0
for m in messages:
snd.send(m)
count = count + 1
- size = size + len(m.content)
+ size = size + len(m.content) + overhead
event = rcvUp.fetch(timeout=1)
schema = event.content[0]["_schema_id"]
assert schema["_class_name"] == "queueThresholdCrossedUpward"
@@ -92,7 +93,7 @@ class ThresholdTests (Base):
m = rcv.fetch(timeout=1)
self.ssn.acknowledge()
count -= 1
- size -= len(m.content)
+ size -= (len(m.content) + overhead)
event = rcvDn.fetch(timeout=1)
schema = event.content[0]["_schema_id"]
assert schema["_class_name"] == "queueThresholdCrossedDownward"
@@ -111,7 +112,7 @@ class ThresholdTests (Base):
self.do_threshold_test(a, [Message("msg-%s" % i) for i in range(5)], 2)
def test_alert_size(self):
- a = {'qpid.alert_size_up':25,'qpid.alert_size_down':15}
+ a = {'qpid.alert_size_up':150,'qpid.alert_size_down':120}
self.do_threshold_test(a, [Message("msg-%s" % i) for i in range(5)], 2)
def test_alert_count_alias(self):
@@ -119,7 +120,7 @@ class ThresholdTests (Base):
self.do_threshold_test(a, [Message("msg-%s" % i) for i in range(10)], 0, True)
def test_alert_size_alias(self):
- a = {'x-qpid-maximum-message-size':15}
+ a = {'x-qpid-maximum-message-size':100}
self.do_threshold_test(a, [Message("msg-%s" % i) for i in range(3)], 0, True)
def test_alert_on_alert_queue(self):
diff --git a/qpid/tools/src/java/bin/qpid-web/web/qmf-ui/scripts/qmf-ui.js b/qpid/tools/src/java/bin/qpid-web/web/qmf-ui/scripts/qmf-ui.js
index 6ec55cbcb2..b59099a797 100644
--- a/qpid/tools/src/java/bin/qpid-web/web/qmf-ui/scripts/qmf-ui.js
+++ b/qpid/tools/src/java/bin/qpid-web/web/qmf-ui/scripts/qmf-ui.js
@@ -1747,10 +1747,6 @@ qmfui.AddQueue = new function() {
} else if (!parseIntegerProperty("#file-count", "qpid.file_count")) {
return;
}
-
- if ($("#queue-cluster-durable")[0].checked) {
- _properties["qpid.persist_last_node"] = 1;
- }
} else {
_properties["durable"] = false;
}
@@ -1831,7 +1827,6 @@ qmfui.AddQueue = new function() {
if (durable) {
setTimeout(function() {
- $("#queue-cluster-durable").parent().appendTo(durableList);
iTablet.renderList(durableList);
setTimeout(function() {
$("#file-size").parent().appendTo(durableList);
@@ -1846,17 +1841,11 @@ qmfui.AddQueue = new function() {
$("#add-queue-additional-journal-note").show();
} else {
- if ($("#queue-cluster-durable").is(":checked")) {
- // Have to use a timeout to call click() within an event handler.
- setTimeout(function() {$("#queue-cluster-durable").click();}, 0);
- }
-
setTimeout(function() {
$("#file-count").parent().appendTo(hiddenList);
setTimeout(function() {
$("#file-size").parent().appendTo(hiddenList);
setTimeout(function() {
- $("#queue-cluster-durable").parent().appendTo(hiddenList);
iTablet.renderList(durableList);
$("#add-queue-additional").trigger("refresh"); // Refresh touch scroller.
}, 30);
diff --git a/qpid/tools/src/java/bin/qpid-web/web/ui/qmf.html b/qpid/tools/src/java/bin/qpid-web/web/ui/qmf.html
index 9709489e3a..4737294c70 100644
--- a/qpid/tools/src/java/bin/qpid-web/web/ui/qmf.html
+++ b/qpid/tools/src/java/bin/qpid-web/web/ui/qmf.html
@@ -976,11 +976,7 @@ these are used to enable a semi-transparent "smoked glass" background behind the
<label for="queue-durable">Durable</label>
<input type="checkbox" id="queue-durable"/>
</li>
- <li>
- <label for="queue-cluster-durable">Cluster Durable</label>
- <input type="checkbox" id="queue-cluster-durable"/>
- </li>
- <li>
+ <li>
<label for="file-size">File Size</label>
<input type="text" id="file-size" placeholder="24"/>
</li>
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionAudit.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionAudit.java
index 0ce903c38b..9912b2c228 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionAudit.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionAudit.java
@@ -76,7 +76,7 @@ import org.apache.qpid.qmf2.util.GetOpt;
* -h, --help show this help message and exit
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* --whitelist=&lt;whitelist XML document&gt;
@@ -131,7 +131,7 @@ public final class ConnectionAudit implements QmfEventListener
" -h, --help show this help message and exit\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n" +
" --whitelist=<whitelist XML document>\n" +
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionLogger.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionLogger.java
index 869d01f40c..6097c4a752 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionLogger.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/ConnectionLogger.java
@@ -69,7 +69,7 @@ import org.apache.qpid.qmf2.util.GetOpt;
* guest/guest@localhost
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* </pre>
@@ -91,7 +91,7 @@ public final class ConnectionLogger implements QmfEventListener
" guest/guest@localhost\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n";
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
index 6c08c471d7..8c9d41e199 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
@@ -120,7 +120,7 @@ import org.apache.qpid.qmf2.util.GetOpt;
* seconds)
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
*
@@ -139,8 +139,6 @@ import org.apache.qpid.qmf2.util.GetOpt;
* --durable The new queue or exchange is durable.
*
* Options for Adding Queues:
- * --cluster-durable The new queue becomes durable if there is only one
- * functioning cluster node
* --file-count=&lt;n&gt; Number of files in queue's persistence journal
* --file-size=&lt;n&gt; File size in pages (64Kib/page)
* --max-queue-size=&lt;n&gt;
@@ -258,7 +256,7 @@ public final class QpidConfig
" seconds)\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n" +
"\n" +
@@ -277,8 +275,6 @@ public final class QpidConfig
" --durable The new queue or exchange is durable.\n" +
"\n" +
" Options for Adding Queues:\n" +
- " --cluster-durable The new queue becomes durable if there is only one\n" +
- " functioning cluster node\n" +
" --file-count=<n> Number of files in queue's persistence journal\n" +
" --file-size=<n> File size in pages (64Kib/page)\n" +
" --max-queue-size=<n>\n" +
@@ -337,7 +333,6 @@ public final class QpidConfig
private String _altExchange = null;
private boolean _passive = false;
private boolean _durable = false;
- private boolean _clusterDurable = false;
private boolean _ifEmpty = true;
private boolean _ifUnused = true;
private long _fileCount = 8;
@@ -364,7 +359,6 @@ public final class QpidConfig
private static final String MAX_QUEUE_SIZE = "qpid.max_size";
private static final String MAX_QUEUE_COUNT = "qpid.max_count";
private static final String POLICY_TYPE = "qpid.policy_type";
- private static final String CLUSTER_DURABLE = "qpid.persist_last_node";
private static final String LVQ = "qpid.last_value_queue";
private static final String LVQNB = "qpid.last_value_queue_no_browse";
private static final String MSG_SEQUENCE = "qpid.msg_sequence";
@@ -388,7 +382,6 @@ public final class QpidConfig
SPECIAL_ARGS.add(MAX_QUEUE_SIZE);
SPECIAL_ARGS.add(MAX_QUEUE_COUNT);
SPECIAL_ARGS.add(POLICY_TYPE);
- SPECIAL_ARGS.add(CLUSTER_DURABLE);
SPECIAL_ARGS.add(LVQ);
SPECIAL_ARGS.add(LVQNB);
SPECIAL_ARGS.add(MSG_SEQUENCE);
@@ -673,11 +666,6 @@ for (Map.Entry<String, Object> entry : args.entrySet()) {
System.out.printf("--durable ");
}
- if (args.containsKey(CLUSTER_DURABLE) && QmfData.getLong(args.get(CLUSTER_DURABLE)) == 1)
- {
- System.out.printf("--cluster-durable ");
- }
-
if (queue.getBooleanValue("autoDelete"))
{
System.out.printf("auto-del ");
@@ -936,11 +924,6 @@ for (Map.Entry<String, Object> entry : args.entrySet()) {
properties.put(POLICY_TYPE, "ring_strict");
}
- if (_clusterDurable)
- {
- properties.put(CLUSTER_DURABLE, 1l);
- }
-
if (_order.equals("lvq"))
{
properties.put(LVQ, 1l);
@@ -1255,7 +1238,7 @@ for (Map.Entry<String, Object> entry : args.entrySet()) {
*/
public QpidConfig(final String[] args)
{
- String[] longOpts = {"help", "durable", "cluster-durable", "bindings", "broker-addr=", "file-count=",
+ String[] longOpts = {"help", "durable", "bindings", "broker-addr=", "file-count=",
"file-size=", "max-queue-size=", "max-queue-count=", "limit-policy=",
"order=", "sequence", "ive", "generate-queue-events=", "force", "force-if-not-empty",
"force-if-used", "alternate-exchange=", "passive", "timeout=", "file=", "flow-stop-size=",
@@ -1313,11 +1296,6 @@ for (Map.Entry<String, Object> entry : args.entrySet()) {
_durable = true;
}
- if (opt[0].equals("--cluster-durable"))
- {
- _clusterDurable = true;
- }
-
if (opt[0].equals("--file-count"))
{
_fileCount = Long.parseLong(opt[1]);
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidCtrl.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidCtrl.java
index d35786cce4..0e945a7ed1 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidCtrl.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidCtrl.java
@@ -78,7 +78,7 @@ import org.apache.qpid.messaging.util.AddressParser;
* (default qpidd)
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* </pre>
@@ -160,7 +160,7 @@ public final class QpidCtrl
" (default qpidd)\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n";
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidPrintEvents.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidPrintEvents.java
index d5912344c7..52c8dcec27 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidPrintEvents.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidPrintEvents.java
@@ -66,7 +66,7 @@ import static org.apache.qpid.qmf2.common.WorkItem.WorkItemType.*;
* --heartbeats Use heartbeats.
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* </pre>
@@ -99,7 +99,7 @@ public final class QpidPrintEvents implements QmfEventListener
" --heartbeats Use heartbeats.\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n";
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidQueueStats.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidQueueStats.java
index 7558da0e28..1d6f1d1bf5 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidQueueStats.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QpidQueueStats.java
@@ -74,7 +74,7 @@ import org.apache.qpid.qmf2.util.GetOpt;
* accepted) to show
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* </pre>
@@ -125,7 +125,7 @@ public final class QpidQueueStats implements QmfEventListener
" accepted) to show\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n";
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QueueFuse.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QueueFuse.java
index 324b9bd1b5..f60dbbf4f3 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QueueFuse.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/tools/QueueFuse.java
@@ -106,7 +106,7 @@ import org.apache.qpid.qmf2.util.GetOpt;
* N.B. if this gets set too low the fuse may not blow.\n" +
* --sasl-mechanism=&lt;mech&gt;
* SASL mechanism for authentication (e.g. EXTERNAL,
- * ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL
+ * ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL
* automatically picks the most secure available
* mechanism - use this option to override.
* </pre>
@@ -149,7 +149,7 @@ public final class QueueFuse implements QmfEventListener
" N.B. if this gets set too low the fuse may not blow.\n" +
" --sasl-mechanism=<mech>\n" +
" SASL mechanism for authentication (e.g. EXTERNAL,\n" +
- " ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL\n" +
+ " ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n" +
" automatically picks the most secure available\n" +
" mechanism - use this option to override.\n";
diff --git a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/util/GetOpt.java b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/util/GetOpt.java
index a99ced9682..a4436b0105 100644
--- a/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/util/GetOpt.java
+++ b/qpid/tools/src/java/src/main/java/org/apache/qpid/qmf2/util/GetOpt.java
@@ -34,7 +34,7 @@ import java.util.ArrayList;
* <p>
* Example usage (paraphrased from QpidConfig):
* <pre>
- * String[] longOpts = {"help", "durable", "cluster-durable", "bindings", "broker-addr=", "file-count=",
+ * String[] longOpts = {"help", "durable", "bindings", "broker-addr=", "file-count=",
* "file-size=", "max-queue-size=", "max-queue-count=", "limit-policy=",
* "order=", "sequence", "ive", "generate-queue-events=", "force", "force-if-not-empty",
* "force-if-used", "alternate-exchange=", "passive", "timeout=", "file=", "flow-stop-size=",
diff --git a/qpid/tools/src/py/qmf-tool b/qpid/tools/src/py/qmf-tool
index db51c96796..407ae74b10 100755
--- a/qpid/tools/src/py/qmf-tool
+++ b/qpid/tools/src/py/qmf-tool
@@ -28,7 +28,7 @@ from shlex import split
from threading import Lock
from time import strftime, gmtime
from qpid.disp import Display
-import cqpid
+import qpid_messaging
import qmf2
class OptsAndArgs(object):
@@ -266,7 +266,7 @@ class QmfData:
self.conn_options = conn_options
self.qmf_options = qmf_options
self.agent_filter = '[]'
- self.connection = cqpid.Connection(self.url, **self.conn_options)
+ self.connection = qpid_messaging.Connection(self.url, **self.conn_options)
self.connection.open()
self.session = qmf2.ConsoleSession(self.connection, self.qmf_options)
self.session.setAgentFilter(self.agent_filter)
diff --git a/qpid/tools/src/py/qpid-config b/qpid/tools/src/py/qpid-config
index 1e995674c4..e4b791ac11 100755
--- a/qpid/tools/src/py/qpid-config
+++ b/qpid/tools/src/py/qpid-config
@@ -86,7 +86,6 @@ class Config:
self._altern_ex = None
self._durable = False
self._replicate = None
- self._clusterDurable = False
self._if_empty = True
self._if_unused = True
self._fileCount = None
@@ -117,7 +116,6 @@ FILESIZE = "qpid.file_size"
MAX_QUEUE_SIZE = "qpid.max_size"
MAX_QUEUE_COUNT = "qpid.max_count"
POLICY_TYPE = "qpid.policy_type"
-CLUSTER_DURABLE = "qpid.persist_last_node"
LVQ_KEY = "qpid.last_value_queue_key"
MSG_SEQUENCE = "qpid.msg_sequence"
IVE = "qpid.ive"
@@ -136,7 +134,7 @@ REPLICATE = "qpid.replicate"
#i.e. the arguments for which there is special processing on add and
#list
SPECIAL_ARGS=[
- FILECOUNT,FILESIZE,MAX_QUEUE_SIZE,MAX_QUEUE_COUNT,POLICY_TYPE,CLUSTER_DURABLE,
+ FILECOUNT,FILESIZE,MAX_QUEUE_SIZE,MAX_QUEUE_COUNT,POLICY_TYPE,
LVQ_KEY,MSG_SEQUENCE,IVE,QUEUE_EVENT_GENERATION,
FLOW_STOP_COUNT,FLOW_RESUME_COUNT,FLOW_STOP_SIZE,FLOW_RESUME_SIZE,
MSG_GROUP_HDR_KEY,SHARED_MSG_GROUP,REPLICATE]
@@ -174,7 +172,7 @@ def OptionsAndArguments(argv):
group1.add_option("-r", "--recursive", action="store_true", help="Show bindings in queue or exchange list")
group1.add_option("-b", "--broker", action="store", type="string", metavar="<address>", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:<port>]")
group1.add_option("-a", "--broker-addr", action="store", type="string", metavar="<address>")
- group1.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ group1.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
group1.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
group1.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
group1.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.")
@@ -191,7 +189,6 @@ def OptionsAndArguments(argv):
parser.add_option_group(group2)
group3 = OptionGroup(parser, "Options for Adding Queues")
- group3.add_option("--cluster-durable", action="store_true", help="The new queue becomes durable if there is only one functioning cluster node")
group3.add_option("--file-count", action="store", type="int", metavar="<n>", help="Number of files in queue's persistence journal")
group3.add_option("--file-size", action="store", type="int", metavar="<n>", help="File size in pages (64KiB/page)")
group3.add_option("--max-queue-size", action="store", type="int", metavar="<n>", help="Maximum in-memory queue size as bytes")
@@ -262,8 +259,6 @@ def OptionsAndArguments(argv):
raise Exception("Invalid replication level '%s', should be one of: %s" % (opts.replicate, ", ".join(REPLICATE_LEVELS)))
config._replicate = opts.replicate
if opts.ha_admin: config._ha_admin = True
- if opts.cluster_durable:
- config._clusterDurable = True
if opts.file:
config._file = opts.file
if opts.file_count is not None:
@@ -441,8 +436,8 @@ class BrokerManager:
if not args: args = {}
if ex.durable: print "--durable",
if REPLICATE in args: print "--replicate=%s" % args[REPLICATE],
- if MSG_SEQUENCE in args and args[MSG_SEQUENCE] == 1: print "--sequence",
- if IVE in args and args[IVE] == 1: print "--ive",
+ if MSG_SEQUENCE in args and args[MSG_SEQUENCE]: print "--sequence",
+ if IVE in args and args[IVE]: print "--ive",
if ex.altExchange:
print "--alternate-exchange=%s" % ex.altExchange,
print
@@ -494,7 +489,6 @@ class BrokerManager:
if not args: args = {}
if q.durable: print "--durable",
if REPLICATE in args: print "--replicate=%s" % args[REPLICATE],
- if CLUSTER_DURABLE in args and args[CLUSTER_DURABLE] == 1: print "--cluster-durable",
if q.autoDelete: print "auto-del",
if q.exclusive: print "excl",
if FILESIZE in args: print "--file-size=%s" % args[FILESIZE],
@@ -598,8 +592,6 @@ class BrokerManager:
elif config._limitPolicy == "ring":
declArgs[POLICY_TYPE] = "ring"
- if config._clusterDurable:
- declArgs[CLUSTER_DURABLE] = 1
if config._lvq_key:
declArgs[LVQ_KEY] = config._lvq_key
if config._eventGeneration:
diff --git a/qpid/tools/src/py/qpid-ha b/qpid/tools/src/py/qpid-ha
index 26029187a3..cf054409d8 100755
--- a/qpid/tools/src/py/qpid-ha
+++ b/qpid/tools/src/py/qpid-ha
@@ -48,7 +48,7 @@ class Command:
usage="%s [options] %s\n\n%s"%(name, " ".join(arg_names), help)
self.help = help
self.op=optparse.OptionParser(usage)
- self.op.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ self.op.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
self.op.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
self.op.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
self.op.add_option("-b", "--broker", action="store", type="string", default="localhost:5672", metavar="<address>", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:<port>]")
diff --git a/qpid/tools/src/py/qpid-printevents b/qpid/tools/src/py/qpid-printevents
index 71b5854f03..1d123fd345 100755
--- a/qpid/tools/src/py/qpid-printevents
+++ b/qpid/tools/src/py/qpid-printevents
@@ -131,7 +131,7 @@ $ %prog guest/guest@broker-host:10000
def main(argv=None):
p = optparse.OptionParser(usage=_usage, description=_description, formatter=JHelpFormatter())
p.add_option("--heartbeats", action="store_true", default=False, help="Use heartbeats.")
- p.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ p.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
p.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
p.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
p.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.")
diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
index 5c5f60a816..9d7d8d9bbf 100755
--- a/qpid/tools/src/py/qpid-queue-stats
+++ b/qpid/tools/src/py/qpid-queue-stats
@@ -125,7 +125,7 @@ def main(argv=None):
p = optparse.OptionParser()
p.add_option('--broker-address','-a', default='localhost' , help='broker-addr is in the form: [username/password@] hostname | ip-address [:<port>] \n ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost')
p.add_option('--filter','-f' ,default=None ,help='a list of comma separated queue names (regex are accepted) to show')
- p.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ p.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
p.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
p.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
diff --git a/qpid/tools/src/py/qpid-route b/qpid/tools/src/py/qpid-route
index 1d688de52c..21e5461664 100755
--- a/qpid/tools/src/py/qpid-route
+++ b/qpid/tools/src/py/qpid-route
@@ -98,7 +98,7 @@ def OptionsAndArguments(argv):
help="Maximum number of messages a sender can have outstanding (0=unlimited)")
parser.add_option("-t", "--transport", action="store", type="string", default="tcp", metavar="<transport>", help="Transport to use for links, defaults to tcp")
- parser.add_option("--client-sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). Used when the client connects to the destination broker (not for authentication between the source and destination brokers - that is specified using the [mechanisms] argument to 'add route'). SASL automatically picks the most secure available mechanism - use this option to override.")
+ parser.add_option("--client-sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). Used when the client connects to the destination broker (not for authentication between the source and destination brokers - that is specified using the [mechanisms] argument to 'add route'). SASL automatically picks the most secure available mechanism - use this option to override.")
parser.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
parser.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
parser.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.")
diff --git a/qpid/tools/src/py/qpid-stat b/qpid/tools/src/py/qpid-stat
index 00227a98b9..d3c2820743 100755
--- a/qpid/tools/src/py/qpid-stat
+++ b/qpid/tools/src/py/qpid-stat
@@ -69,7 +69,7 @@ def OptionsAndArguments(argv):
group1.add_option("-t", "--timeout", action="store", type="int", default=10, metavar="<secs>",
help="Maximum time to wait for broker connection (in seconds)")
group1.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>",
- help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
group1.add_option("--ssl-certificate", action="store", type="string", metavar="<cert>", help="Client SSL certificate (PEM Format)")
group1.add_option("--ssl-key", action="store", type="string", metavar="<key>", help="Client SSL private key (PEM Format)")
group1.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.")
diff --git a/qpid/tools/src/py/qpid-store-chk b/qpid/tools/src/py/qpid-store-chk
new file mode 100755
index 0000000000..f6d70cb3c6
--- /dev/null
+++ b/qpid/tools/src/py/qpid-store-chk
@@ -0,0 +1,332 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+from qpidstore import jerr, jrnl, janal
+import optparse, os, sys
+
+
+#== class StoreChk ============================================================
+
+class StoreChk(object):
+ """
+ This class:
+ 1. Reads a journal jinf file, and from its info:
+ 2. Analyzes the journal data files to determine which is the last to be written, then
+ 3. Reads and analyzes all the records in the journal files.
+ The only public method is run() which kicks off the analysis.
+ """
+
+ def __init__(self):
+ """Constructor"""
+ # params
+ self.opts = None
+
+ self._jdir = None
+
+ # recovery analysis objects
+# self._jrnl_info = None
+# self.jrnl_rdr = None
+
+ self._process_args()
+ self._jrnl_info = jrnl.JrnlInfo(self._jdir, self.opts.bfn)
+ # FIXME: This is a hack... find an elegant way of getting the file size to jrec!
+ jrnl.JRNL_FILE_SIZE = self._jrnl_info.get_jrnl_file_size_bytes()
+ self.jrnl_anal = janal.JrnlAnalyzer(self._jrnl_info)
+ self.jrnl_rdr = janal.JrnlReader(self._jrnl_info, self.jrnl_anal, self.opts.qflag, self.opts.rflag,
+ self.opts.vflag)
+
+ def run(self):
+ """Run the store check"""
+ if not self.opts.qflag:
+ print self._jrnl_info
+ print self.jrnl_anal
+ self.jrnl_rdr.run()
+ self._report()
+
+ def _report(self):
+ """Print the results of the store check"""
+ if not self.opts.qflag:
+ print
+ print " === REPORT ===="
+ print
+ print "Records: %8d non-transactional" % \
+ (self.jrnl_rdr.get_msg_cnt() - self.jrnl_rdr.get_txn_msg_cnt())
+ print " %8d transactional" % self.jrnl_rdr.get_txn_msg_cnt()
+ print " %8d total" % self.jrnl_rdr.get_msg_cnt()
+ print
+ print "Transactions: %8d aborts" % self.jrnl_rdr.get_abort_cnt()
+ print " %8d commits" % self.jrnl_rdr.get_commit_cnt()
+ print " %8d total" % (self.jrnl_rdr.get_abort_cnt() + self.jrnl_rdr.get_commit_cnt())
+ print
+ if self.jrnl_rdr.emap().size() > 0:
+ print "Remaining enqueued records (sorted by rid): "
+ rid_list = self.jrnl_rdr.emap().rids()
+ rid_list.sort()
+ for rid in rid_list:
+ l = self.jrnl_rdr.emap().get(rid)
+ locked = ""
+ if l[2]:
+ locked += " (locked)"
+ print " fid=%d %s%s" % (l[0], l[1], locked)
+ print "WARNING: Enqueue-Dequeue mismatch, %d enqueued records remain." % self.jrnl_rdr.emap().size()
+ else:
+ print "No remaining enqueued records found (emap empty)."
+ print
+ if self.jrnl_rdr.tmap().size() > 0:
+ txn_rec_cnt = 0
+ print "Incomplete transactions: "
+ for xid in self.jrnl_rdr.tmap().xids():
+ jrnl.Utils.format_xid(xid)
+ recs = self.jrnl_rdr.tmap().get(xid)
+ for l in recs:
+ print " fid=%d %s" % (l[0], l[1])
+ print " Total: %d records for %s" % (len(recs), jrnl.Utils.format_xid(xid))
+ print
+ txn_rec_cnt += len(recs)
+ print "WARNING: Incomplete transactions found, %d xids remain containing a total of %d records." % \
+ (self.jrnl_rdr.tmap().size(), txn_rec_cnt)
+ else:
+ print "No incomplete transactions found (tmap empty)."
+ print
+ print "%d enqueues, %d journal records processed." % \
+ (self.jrnl_rdr.get_msg_cnt(), self.jrnl_rdr.get_rec_cnt())
+
+
+ def _process_args(self):
+ """Process the command-line arguments"""
+ opt = optparse.OptionParser(usage="%prog [options] DIR", version="%prog 1.0")
+ opt.add_option("-b", "--base-filename",
+ action="store", dest="bfn", default="JournalData",
+ help="Base filename for old journal files")
+ opt.add_option("-q", "--quiet",
+ action="store_true", dest="qflag",
+ help="Quiet (suppress all non-error output)")
+ opt.add_option("-r", "--records",
+ action="store_true", dest="rflag",
+ help="Print all records and transactions (including consumed/closed)")
+ opt.add_option("-v", "--verbose",
+ action="store_true", dest="vflag",
+ help="Verbose output")
+ (self.opts, args) = opt.parse_args()
+ if len(args) == 0:
+ opt.error("No journal directory argument")
+ elif len(args) > 1:
+ opt.error("Too many positional arguments: %s" % args)
+ if self.opts.qflag and self.opts.rflag:
+ opt.error("Quiet (-q/--quiet) and record (-r/--records) options are mutually exclusive")
+ if self.opts.qflag and self.opts.vflag:
+ opt.error("Quiet (-q/--quiet) and verbose (-v/--verbose) options are mutually exclusive")
+ self._jdir = args[0]
+ if not os.path.exists(self._jdir):
+ opt.error("Journal path \"%s\" does not exist" % self._jdir)
+
+
+#== class CsvStoreChk =========================================================
+
+class CsvStoreChk(StoreChk):
+ """
+ This class, in addition to analyzing a journal, can compare the journal footprint (ie enqueued/dequeued/transaction
+ record counts) to expected values from a CSV file. This can be used for additional automated testing, and is
+ currently in use in the long store tests for journal encode testing.
+ """
+
+ # CSV file cols
+ TEST_NUM_COL = 0
+ NUM_MSGS_COL = 5
+ MIN_MSG_SIZE_COL = 7
+ MAX_MSG_SIZE_COL = 8
+ MIN_XID_SIZE_COL = 9
+ MAX_XID_SIZE_COL = 10
+ AUTO_DEQ_COL = 11
+ TRANSIENT_COL = 12
+ EXTERN_COL = 13
+ COMMENT_COL = 20
+
+ def __init__(self):
+ """Constructor"""
+ StoreChk.__init__(self)
+
+ # csv params
+ self.num_msgs = None
+ self.msg_len = None
+ self.auto_deq = None
+ self.xid_len = None
+ self.transient = None
+ self.extern = None
+
+ self._warning = []
+
+ self.jrnl_rdr.set_callbacks(self, CsvStoreChk._csv_pre_run_chk, CsvStoreChk._csv_enq_chk,
+ CsvStoreChk._csv_deq_chk, CsvStoreChk._csv_txn_chk, CsvStoreChk._csv_post_run_chk)
+ self._get_csv_test()
+
+ def _get_csv_test(self):
+ """Get a test from the CSV reader"""
+ if self.opts.csvfn != None and self.opts.tnum != None:
+ tparams = self._read_csv_file(self.opts.csvfn, self.opts.tnum)
+ if tparams == None:
+ print "ERROR: Test %d not found in CSV file \"%s\"" % (self.opts.tnum, self.opts.csvfn)
+ sys.exit(1)
+ self.num_msgs = tparams["num_msgs"]
+ if tparams["min_size"] == tparams["max_size"]:
+ self.msg_len = tparams["max_size"]
+ else:
+ self.msg_len = 0
+ self.auto_deq = tparams["auto_deq"]
+ if tparams["xid_min_size"] == tparams["xid_max_size"]:
+ self.xid_len = tparams["xid_max_size"]
+ else:
+ self.xid_len = 0
+ self.transient = tparams["transient"]
+ self.extern = tparams["extern"]
+
+ def _read_csv_file(self, filename, tnum):
+ """Read the CSV test parameter file"""
+ try:
+ csvf = open(filename, "r")
+ except IOError:
+ print "ERROR: Unable to open CSV file \"%s\"" % filename
+ sys.exit(1)
+ for line in csvf:
+ str_list = line.strip().split(",")
+ if len(str_list[0]) > 0 and str_list[0][0] != "\"":
+ try:
+ if (int(str_list[self.TEST_NUM_COL]) == tnum):
+ return { "num_msgs": int(str_list[self.NUM_MSGS_COL]),
+ "min_size": int(str_list[self.MIN_MSG_SIZE_COL]),
+ "max_size": int(str_list[self.MAX_MSG_SIZE_COL]),
+ "auto_deq": not (str_list[self.AUTO_DEQ_COL] == "FALSE" or
+ str_list[self.AUTO_DEQ_COL] == "0"),
+ "xid_min_size": int(str_list[self.MIN_XID_SIZE_COL]),
+ "xid_max_size": int(str_list[self.MAX_XID_SIZE_COL]),
+ "transient": not (str_list[self.TRANSIENT_COL] == "FALSE" or
+ str_list[self.TRANSIENT_COL] == "0"),
+ "extern": not (str_list[self.EXTERN_COL] == "FALSE" or
+ str_list[self.EXTERN_COL] == "0"),
+ "comment": str_list[self.COMMENT_COL] }
+ except Exception:
+ pass
+ return None
+
+ def _process_args(self):
+ """Process command-line arguments"""
+ opt = optparse.OptionParser(usage="%prog [options] DIR", version="%prog 1.0")
+ opt.add_option("-b", "--base-filename",
+ action="store", dest="bfn", default="JournalData",
+ help="Base filename for old journal files")
+ opt.add_option("-c", "--csv-filename",
+ action="store", dest="csvfn",
+ help="CSV filename containing test parameters")
+ opt.add_option("-q", "--quiet",
+ action="store_true", dest="qflag",
+ help="Quiet (suppress all non-error output)")
+ opt.add_option("-r", "--records",
+ action="store_true", dest="rflag",
+ help="Print all records and transactions (including consumed/closed)")
+ opt.add_option("-t", "--test-num",
+ action="store", type="int", dest="tnum",
+ help="Test number from CSV file - only valid if CSV file named")
+ opt.add_option("-v", "--verbose",
+ action="store_true", dest="vflag",
+ help="Verbose output")
+ (self.opts, args) = opt.parse_args()
+ if len(args) == 0:
+ opt.error("No journal directory argument")
+ elif len(args) > 1:
+ opt.error("Too many positional arguments: %s" % args)
+ if self.opts.qflag and self.opts.rflag:
+ opt.error("Quiet (-q/--quiet) and record (-r/--records) options are mutually exclusive")
+ if self.opts.qflag and self.opts.vflag:
+ opt.error("Quiet (-q/--quiet) and verbose (-v/--verbose) options are mutually exclusive")
+ self._jdir = args[0]
+ if not os.path.exists(self._jdir):
+ opt.error("Journal path \"%s\" does not exist" % self._jdir)
+
+ # Callbacks for checking against CSV test parameters. Return False if ok, True to raise error.
+
+ #@staticmethod
+ def _csv_pre_run_chk(csv_store_chk):
+ """Check performed before a test runs"""
+ if csv_store_chk.num_msgs == None:
+ return
+ if csv_store_chk.jrnl_anal.is_empty() and csv_store_chk.num_msgs > 0:
+ raise jerr.AllJrnlFilesEmptyCsvError(csv_store_chk.get_opts().tnum, csv_store_chk.num_msgs)
+ return False
+ _csv_pre_run_chk = staticmethod(_csv_pre_run_chk)
+
+ #@staticmethod
+ def _csv_enq_chk(csv_store_chk, hdr):
+ """Check performed before each enqueue operation"""
+ #if csv_store_chk.num_msgs == None: return
+ #
+ if csv_store_chk.extern != None:
+ if csv_store_chk.extern != hdr.extern:
+ raise jerr.ExternFlagCsvError(csv_store_chk.opts.tnum, csv_store_chk.extern)
+ if hdr.extern and hdr.data != None:
+ raise jerr.ExternFlagWithDataCsvError(csv_store_chk.opts.tnum)
+ if csv_store_chk.msg_len != None and csv_store_chk.msg_len > 0 and hdr.data != None and \
+ len(hdr.data) != csv_store_chk.msg_len:
+ raise jerr.MessageLengthCsvError(csv_store_chk.opts.tnum, csv_store_chk.msg_len, len(hdr.data))
+ if csv_store_chk.xid_len != None and csv_store_chk.xid_len > 0 and len(hdr.xid) != csv_store_chk.xid_len:
+ raise jerr.XidLengthCsvError(csv_store_chk.opts.tnum, csv_store_chk.xid_len, len(hdr.xid))
+ if csv_store_chk.transient != None and hdr.transient != csv_store_chk.transient:
+ raise jerr.TransactionCsvError(csv_store_chk.opts.tnum, csv_store_chk.transient)
+ return False
+ _csv_enq_chk = staticmethod(_csv_enq_chk)
+
+ #@staticmethod
+ def _csv_deq_chk(csv_store_chk, hdr):
+ """Check performed before each dequeue operation"""
+ if csv_store_chk.auto_deq != None and not csv_store_chk.auto_deq:
+ raise jerr.JWarning("[CSV %d] WARNING: Dequeue record rid=%d found in non-dequeue test - ignoring." %
+ (csv_store_chk.opts.tnum, hdr.rid))
+ #self._warning.append("[CSV %d] WARNING: Dequeue record rid=%d found in non-dequeue test - ignoring." %
+ # (csv_store_chk.opts.tnum, hdr.rid))
+ return False
+ _csv_deq_chk = staticmethod(_csv_deq_chk)
+
+ #@staticmethod
+ def _csv_txn_chk(csv_store_chk, hdr):
+ """Check performed before each transaction commit/abort"""
+ return False
+ _csv_txn_chk = staticmethod(_csv_txn_chk)
+
+ #@staticmethod
+ def _csv_post_run_chk(csv_store_chk):
+ """Cehck performed after the completion of the test"""
+ # Exclude this check if lastFileFlag is set - the count may be less than the number of msgs sent because
+ # of journal overwriting
+ if csv_store_chk.num_msgs != None and not csv_store_chk.jrnl_rdr.is_last_file() and \
+ csv_store_chk.num_msgs != csv_store_chk.jrnl_rdr.get_msg_cnt():
+ raise jerr.NumMsgsCsvError(csv_store_chk.opts.tnum, csv_store_chk.num_msgs,
+ csv_store_chk.jrnl_rdr.get_msg_cnt())
+ return False
+ _csv_post_run_chk = staticmethod(_csv_post_run_chk)
+
+#==============================================================================
+# main program
+#==============================================================================
+
+if __name__ == "__main__":
+ M = CsvStoreChk()
+ try:
+ M.run()
+ except Exception, e:
+ sys.exit(e)
diff --git a/qpid/tools/src/py/qpid-store-resize b/qpid/tools/src/py/qpid-store-resize
new file mode 100755
index 0000000000..38d8eaf1ad
--- /dev/null
+++ b/qpid/tools/src/py/qpid-store-resize
@@ -0,0 +1,350 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+from qpidstore import jerr, jrnl, janal
+import glob, optparse, os, sys, time
+
+
+#== class Resize ==============================================================
+
+class Resize(object):
+ """
+ Creates a new store journal and copies records from old journal to new. The new journal may be of
+ different size from the old one. The records are packed into the new journal (ie only remaining
+ enqueued records and associated transactions - if any - are copied over without spaces between them).
+
+ The default action is to push the old journal down into a 'bak' sub-directory and then create a
+ new journal of the same size and pack it with the records from the old. However, it is possible to
+ suppress the pushdown (using --no-pushdown), in which case either a new journal id (using
+ --new-base-filename) or an old journal id (usnig --old-base-filename) must be supplied. In the former
+ case,a new journal will be created using the new base file name alongside the old one. In the latter
+ case, the old journal will be renamed to the supplied name, and the new one will take the default.
+ Note that both can be specified together with the --no-pushdown option.
+
+ To resize the journal, use the optional --num-jfiles and/or --jfile-size parameters. These
+ should be large enough to write all the records or an error will result. If the size is large enough
+ to write all records, but too small to keep below the enqueue threshold, a warning will be printed.
+ Note that as any valid size will be accepted, a journal can also be shrunk, as long as it is sufficiently
+ big to accept the transferred records.
+ """
+
+ BAK_DIR = "bak"
+ JFILE_SIZE_PGS_MIN = 1
+ JFILE_SIZE_PGS_MAX = 32768
+ NUM_JFILES_MIN = 4
+ NUM_JFILES_MAX = 64
+
+ def __init__(self):
+ """Constructor"""
+ self._opts = None
+ self._jdir = None
+ self._fname = None
+ self._fnum = None
+ self._file = None
+ self._file_rec_wr_cnt = None
+ self._filler_wr_cnt = None
+ self._last_rec_fid = None
+ self._last_rec_offs = None
+ self._rec_wr_cnt = None
+
+ self._jrnl_info = None
+ self._jrnl_analysis = None
+ self._jrnl_reader = None
+
+ self._process_args()
+ self._jrnl_info = jrnl.JrnlInfo(self._jdir, self._opts.bfn)
+ # FIXME: This is a hack... find an elegant way of getting the file size to jrec!
+ jrnl.JRNL_FILE_SIZE = self._jrnl_info.get_jrnl_file_size_bytes()
+ self._jrnl_analysis = janal.JrnlAnalyzer(self._jrnl_info)
+ self._jrnl_reader = janal.JrnlReader(self._jrnl_info, self._jrnl_analysis, self._opts.qflag, self._opts.rflag,
+ self._opts.vflag)
+
+ def run(self):
+ """Perform the action of resizing the journal"""
+ if not self._opts.qflag:
+ print self._jrnl_analysis
+ self._jrnl_reader.run()
+ if self._opts.vflag:
+ print self._jrnl_info
+ if not self._opts.qflag:
+ print self._jrnl_reader.report(self._opts.vflag, self._opts.rflag)
+ self._handle_old_files()
+ self._create_new_files()
+ if not self._opts.qflag:
+ print "Transferred %d records to new journal." % self._rec_wr_cnt
+ self._chk_free()
+
+ def _chk_free(self):
+ """Check if sufficient space is available in resized journal to be able to enqueue. Raise a warning if not."""
+ if self._last_rec_fid == None or self._last_rec_offs == None:
+ return
+ wr_capacity_bytes = self._last_rec_fid * self._jrnl_info.get_jrnl_data_size_bytes() + self._last_rec_offs
+ tot_capacity_bytes = self._jrnl_info.get_tot_jrnl_data_size_bytes()
+ percent_full = 100.0 * wr_capacity_bytes / tot_capacity_bytes
+ if percent_full > 80.0:
+ raise jerr.JWarning("WARNING: Journal %s is %2.1f%% full and will likely not allow enqueuing of new records"
+ " until some existing records are dequeued." %
+ (self._jrnl_info.get_jrnl_id(), percent_full))
+
+ def _create_new_files(self):
+ """Create new journal files"""
+ # Assemble records to be transfered
+ master_record_list = {}
+ txn_record_list = self._jrnl_reader.txn_obj_list()
+ if self._opts.vflag and self._jrnl_reader.emap().size() > 0:
+ print "* Assembling %d records from emap" % self._jrnl_reader.emap().size()
+ for tup in self._jrnl_reader.emap().get_rec_list():
+ hdr = tup[1]
+ hdr.flags &= ~jrnl.Hdr.OWI_MASK # Turn off owi
+ master_record_list[long(hdr.rid)] = hdr
+ if hdr.xidsize > 0 and hdr.xid in txn_record_list:
+ txn_hdr = txn_record_list[hdr.xid]
+ del(txn_record_list[hdr.xid])
+ txn_hdr.flags &= ~jrnl.Hdr.OWI_MASK # Turn off owi
+ master_record_list[long(txn_hdr.rid)] = txn_hdr
+ if self._opts.vflag and self._jrnl_reader.tmap().size() > 0:
+ print "* Assembling %d records from tmap" % self._jrnl_reader.tmap().size()
+ for xid in self._jrnl_reader.tmap().xids():
+ for l in self._jrnl_reader.tmap().get(xid):
+ hdr = l[1]
+ hdr.flags &= ~jrnl.Hdr.OWI_MASK # Turn off owi
+ master_record_list[hdr.rid] = hdr
+ rid_list = master_record_list.keys()
+ rid_list.sort()
+
+ # get base filename
+ bfn = self._opts.bfn
+ if self._opts.nbfn != None:
+ bfn = self._opts.nbfn
+
+ # write jinf file
+ self._jrnl_info.resize(self._opts.njf, self._opts.jfs)
+ self._jrnl_info.write(self._jdir, bfn)
+
+ # write records
+ if self._opts.vflag:
+ print "* Transferring records to new journal files"
+ fro = self._jrnl_info.get_jrnl_sblk_size_bytes()
+ while len(rid_list) > 0:
+ hdr = master_record_list[rid_list.pop(0)]
+ rec = hdr.encode()
+ pos = 0
+ while pos < len(rec):
+ if self._file == None or self._file.tell() >= self._jrnl_info.get_jrnl_file_size_bytes():
+ if self._file == None:
+ rid = hdr.rid
+ elif len(rid_list) == 0:
+ rid = 0
+ else:
+ rid = rid_list[0]
+ if not self._rotate_file(rid, fro):
+ raise jerr.JournalSpaceExceededError()
+ if len(rec) - pos <= self._jrnl_info.get_jrnl_file_size_bytes() - self._file.tell():
+ self._file.write(rec[pos:])
+ self._fill_file(jrnl.Utils.size_in_bytes_to_blk(self._file.tell(),
+ self._jrnl_info.get_jrnl_dblk_size_bytes()))
+ pos = len(rec)
+ fro = self._jrnl_info.get_jrnl_sblk_size_bytes()
+ else:
+ flen = self._jrnl_info.get_jrnl_file_size_bytes() - self._file.tell()
+ self._file.write(rec[pos:pos + flen])
+ pos += flen
+ rem = len(rec) - pos
+ if rem <= self._jrnl_info.get_jrnl_data_size_bytes():
+ fro = (jrnl.Utils.size_in_bytes_to_blk(self._jrnl_info.get_jrnl_sblk_size_bytes() + rem,
+ self._jrnl_info.get_jrnl_dblk_size_bytes()))
+ else:
+ fro = 0
+ self._rec_wr_cnt += 1
+ self._file_rec_wr_cnt += 1
+ self._fill_file(add_filler_recs = True)
+ while self._rotate_file():
+ pass
+
+ def _fill_file(self, to_posn = None, add_filler_recs = False):
+ """Fill a file to a known offset"""
+ if self._file == None:
+ return
+ if add_filler_recs:
+ nfr = int(jrnl.Utils.rem_bytes_in_blk(self._file, self._jrnl_info.get_jrnl_sblk_size_bytes()) /
+ self._jrnl_info.get_jrnl_dblk_size_bytes())
+ if nfr > 0:
+ self._filler_wr_cnt = nfr
+ for i in range(0, nfr):
+ self._file.write("RHMx")
+ self._fill_file(jrnl.Utils.size_in_bytes_to_blk(self._file.tell(),
+ self._jrnl_info.get_jrnl_dblk_size_bytes()))
+ self._last_rec_fid = self._fnum
+ self._last_rec_offs = self._file.tell()
+ if to_posn == None:
+ to_posn = self._jrnl_info.get_jrnl_file_size_bytes()
+ elif to_posn > self._jrnl_info.get_jrnl_file_size_bytes():
+ raise jerr.FillExceedsFileSizeError(to_posn, self._jrnl_info.get_jrnl_file_size_bytes())
+ diff = to_posn - self._file.tell()
+ self._file.write(str("\0" * diff))
+ #DEBUG
+ if self._file.tell() != to_posn:
+ raise jerr.FillSizeError(self._file.tell(), to_posn)
+
+ def _rotate_file(self, rid = None, fro = None):
+ """Switch to the next logical file"""
+ if self._file != None:
+ self._file.close()
+ if self._opts.vflag:
+ if self._file_rec_wr_cnt == 0:
+ print " (empty)"
+ elif self._filler_wr_cnt == None:
+ print " (%d records)" % self._file_rec_wr_cnt
+ else:
+ print " (%d records + %d filler(s))" % (self._file_rec_wr_cnt, self._filler_wr_cnt)
+ if self._fnum == None:
+ self._fnum = 0
+ self._rec_wr_cnt = 0
+ elif self._fnum == self._jrnl_info.get_num_jrnl_files() - 1:
+ return False
+ else:
+ self._fnum += 1
+ self._file_rec_wr_cnt = 0
+ self._fname = os.path.join(self._jrnl_info.get_jrnl_dir(), "%s.%04x.jdat" %
+ (self._jrnl_info.get_jrnl_base_name(), self._fnum))
+ if self._opts.vflag:
+ print "* Opening file %s" % self._fname,
+ self._file = open(self._fname, "w")
+ if rid == None or fro == None:
+ self._fill_file()
+ else:
+ now = time.time()
+ fhdr = jrnl.FileHdr(0, "RHMf", jrnl.Hdr.HDR_VER, int(jrnl.Hdr.BIG_ENDIAN), 0, rid)
+ fhdr.init(self._file, 0, self._fnum, self._fnum, fro, int(now), 1000000000*(now - int(now)))
+ self._file.write(fhdr.encode())
+ self._fill_file(self._jrnl_info.get_jrnl_sblk_size_bytes())
+ return True
+
+ def _handle_old_files(self):
+ """Push old journal down into a backup directory"""
+ target_dir = self._jdir
+ if not self._opts.npd:
+ target_dir = os.path.join(self._jdir, self.BAK_DIR)
+ if os.path.exists(target_dir):
+ if self._opts.vflag:
+ print "* Pushdown directory %s exists, deleting content" % target_dir
+ for fname in glob.glob(os.path.join(target_dir, "*")):
+ os.unlink(fname)
+ else:
+ if self._opts.vflag:
+ print "* Creating new pushdown directory %s" % target_dir
+ os.mkdir(target_dir)
+
+ if not self._opts.npd or self._opts.obfn != None:
+ if self._opts.obfn != None and self._opts.vflag:
+ print "* Renaming old journal files using base name %s" % self._opts.obfn
+ # .jdat files
+ for fname in glob.glob(os.path.join(self._jdir, "%s.*.jdat" % self._opts.bfn)):
+ tbfn = os.path.basename(fname)
+ if self._opts.obfn != None:
+ per1 = tbfn.rfind(".")
+ if per1 >= 0:
+ per2 = tbfn.rfind(".", 0, per1)
+ if per2 >= 0:
+ tbfn = "%s%s" % (self._opts.obfn, tbfn[per2:])
+ os.rename(fname, os.path.join(target_dir, tbfn))
+ # .jinf file
+ self._jrnl_info.write(target_dir, self._opts.obfn)
+ os.unlink(os.path.join(self._jdir, "%s.jinf" % self._opts.bfn))
+
+ def _print_options(self):
+ """Print program options"""
+ if self._opts.vflag:
+ print "Journal dir: %s" % self._jdir
+ print "Options: Base filename: %s" % self._opts.bfn
+ print " New base filename: %s" % self._opts.nbfn
+ print " Old base filename: %s" % self._opts.obfn
+ print " Pushdown: %s" % self._opts.npd
+ print " No. journal files: %d" % self._opts.njf
+ print " Journal file size: %d 64kiB blocks" % self._opts.jfs
+ print " Show records flag: %s" % self._opts.rflag
+ print " Verbose flag: %s" % True
+ print
+
+ def _process_args(self):
+ """Process the command-line arguments"""
+ opt = optparse.OptionParser(usage="%prog [options] DIR", version="%prog 1.0")
+ opt.add_option("-b", "--base-filename",
+ action="store", dest="bfn", default="JournalData",
+ help="Base filename for old journal files")
+ opt.add_option("-B", "--new-base-filename",
+ action="store", dest="nbfn",
+ help="Base filename for new journal files")
+ opt.add_option("-n", "--no-pushdown",
+ action="store_true", dest="npd",
+ help="Suppress pushdown of old files into \"bak\" dir; old files will remain in existing dir")
+ opt.add_option("-N", "--num-jfiles",
+ action="store", type="int", dest="njf", default=8,
+ help="Number of files for new journal (%d-%d)" % (self.NUM_JFILES_MIN, self.NUM_JFILES_MAX))
+ opt.add_option("-o", "--old-base-filename",
+ action="store", dest="obfn",
+ help="Base filename for old journal files")
+ opt.add_option("-q", "--quiet",
+ action="store_true", dest="qflag",
+ help="Quiet (suppress all non-error output)")
+ opt.add_option("-r", "--records",
+ action="store_true", dest="rflag",
+ help="Print remaining records and transactions")
+ opt.add_option("-s", "--jfile-size-pgs",
+ action="store", type="int", dest="jfs", default=24,
+ help="Size of each new journal file in 64kiB blocks (%d-%d)" %
+ (self.JFILE_SIZE_PGS_MIN, self.JFILE_SIZE_PGS_MAX))
+ opt.add_option("-v", "--verbose",
+ action="store_true", dest="vflag",
+ help="Verbose output")
+ (self._opts, args) = opt.parse_args()
+ if len(args) == 0:
+ opt.error("No journal directory argument")
+ elif len(args) > 1:
+ opt.error("Too many positional arguments: %s" % args)
+ if self._opts.qflag and self._opts.rflag:
+ opt.error("Quiet (-q/--quiet) and record (-r/--records) options are mutually exclusive")
+ if self._opts.qflag and self._opts.vflag:
+ opt.error("Quiet (-q/--quiet) and verbose (-v/--verbose) options are mutually exclusive")
+ if self._opts.njf != None and (self._opts.njf < self.NUM_JFILES_MIN or self._opts.njf > self.NUM_JFILES_MAX):
+ opt.error("Number of files (%d) is out of range (%d-%d)" %
+ (self._opts.njf, self.NUM_JFILES_MIN, self.NUM_JFILES_MAX))
+ if self._opts.jfs != None and (self._opts.jfs < self.JFILE_SIZE_PGS_MIN or
+ self._opts.jfs > self.JFILE_SIZE_PGS_MAX):
+ opt.error("File size (%d) is out of range (%d-%d)" %
+ (self._opts.jfs, self.JFILE_SIZE_PGS_MIN, self.JFILE_SIZE_PGS_MAX))
+ if self._opts.npd != None and (self._opts.nbfn == None and self._opts.obfn == None):
+ opt.error("If (-n/--no-pushdown) is used, then at least one of (-B/--new-base-filename) and"
+ " (-o/--old-base-filename) must be used.")
+ self._jdir = args[0]
+ if not os.path.exists(self._jdir):
+ opt.error("Journal path \"%s\" does not exist" % self._jdir)
+ self._print_options()
+
+#==============================================================================
+# main program
+#==============================================================================
+
+if __name__ == "__main__":
+ R = Resize()
+ try:
+ R.run()
+ except Exception, e:
+ sys.exit(e)
diff --git a/qpid/tools/src/py/qpid-tool b/qpid/tools/src/py/qpid-tool
index 2ccfa58730..efc219c6c6 100755
--- a/qpid/tools/src/py/qpid-tool
+++ b/qpid/tools/src/py/qpid-tool
@@ -711,7 +711,7 @@ def parse_options( argv ):
parser = optparse.OptionParser(usage=_usage)
parser.add_option("-b", "--broker", action="store", type="string", metavar="<address>", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:<port>]")
- parser.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
+ parser.add_option("--sasl-mechanism", action="store", type="string", metavar="<mech>", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.")
parser.add_option("--ssl-certificate",
action="store", type="string", metavar="<path>",
help="SSL certificate for client authentication")
diff --git a/qpid/tools/src/py/qpidstore/__init__.py b/qpid/tools/src/py/qpidstore/__init__.py
new file mode 100644
index 0000000000..d8a500d9d8
--- /dev/null
+++ b/qpid/tools/src/py/qpidstore/__init__.py
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
diff --git a/qpid/tools/src/py/qpidstore/janal.py b/qpid/tools/src/py/qpidstore/janal.py
new file mode 100644
index 0000000000..1f89207b4d
--- /dev/null
+++ b/qpid/tools/src/py/qpidstore/janal.py
@@ -0,0 +1,608 @@
+#
+# 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.
+#
+
+import jerr, jrnl
+import os.path, sys
+
+
+#== class EnqMap ==============================================================
+
+class EnqMap(object):
+ """Class for maintaining a map of enqueued records, indexing the rid against hdr, fid and transaction lock"""
+
+ def __init__(self):
+ """Constructor"""
+ self.__map = {}
+
+ def __str__(self):
+ """Print the contents of the map"""
+ return self.report(True, True)
+
+ def add(self, fid, hdr, lock = False):
+ """Add a new record into the map"""
+ if hdr.rid in self.__map:
+ raise jerr.DuplicateRidError(hdr.rid)
+ self.__map[hdr.rid] = [fid, hdr, lock]
+
+ def contains(self, rid):
+ """Return True if the map contains the given rid"""
+ return rid in self.__map
+
+ def delete(self, rid):
+ """Delete the rid and its associated data from the map"""
+ if rid in self.__map:
+ if self.get_lock(rid):
+ raise jerr.DeleteLockedRecordError(rid)
+ del self.__map[rid]
+ else:
+ raise jerr.JWarning("ERROR: Deleting non-existent rid from EnqMap: rid=0x%x" % rid)
+
+ def get(self, rid):
+ """Return a list [fid, hdr, lock] for the given rid"""
+ if self.contains(rid):
+ return self.__map[rid]
+ return None
+
+ def get_fid(self, rid):
+ """Return the fid for the given rid"""
+ if self.contains(rid):
+ return self.__map[rid][0]
+ return None
+
+ def get_hdr(self, rid):
+ """Return the header record for the given rid"""
+ if self.contains(rid):
+ return self.__map[rid][1]
+ return None
+
+ def get_lock(self, rid):
+ """Return the transaction lock value for the given rid"""
+ if self.contains(rid):
+ return self.__map[rid][2]
+ return None
+
+ def get_rec_list(self):
+ """Return a list of tuples (fid, hdr, lock) for all entries in the map"""
+ return self.__map.values()
+
+ def lock(self, rid):
+ """Set the transaction lock for a given rid to True"""
+ if rid in self.__map:
+ if not self.__map[rid][2]: # locked
+ self.__map[rid][2] = True
+ else:
+ raise jerr.AlreadyLockedError(rid)
+ else:
+ raise jerr.JWarning("ERROR: Locking non-existent rid in EnqMap: rid=0x%x" % rid)
+
+ def report(self, show_stats, show_records):
+ """Return a string containing a text report for all records in the map"""
+ if len(self.__map) == 0:
+ return "No enqueued records found."
+ rstr = "%d enqueued records found" % len(self.__map)
+ if show_records:
+ rstr += ":"
+ rid_list = self.__map.keys()
+ rid_list.sort()
+ for rid in rid_list:
+ if self.__map[rid][2]:
+ lock_str = " [LOCKED]"
+ else:
+ lock_str = ""
+ rstr += "\n lfid=%d %s %s" % (rec[0], rec[1], lock_str)
+ else:
+ rstr += "."
+ return rstr
+
+ def rids(self):
+ """Return a list of rids in the map"""
+ return self.__map.keys()
+
+ def size(self):
+ """Return the number of entries in the map"""
+ return len(self.__map)
+
+ def unlock(self, rid):
+ """Set the transaction lock for a given rid to False"""
+ if rid in self.__map:
+ if self.__map[rid][2]:
+ self.__map[rid][2] = False
+ else:
+ raise jerr.NotLockedError(rid)
+ else:
+ raise jerr.NonExistentRecordError("unlock", rid)
+
+
+#== class TxnMap ==============================================================
+
+class TxnMap(object):
+ """Transaction map, which maps xids to a list of outstanding actions"""
+
+ def __init__(self, emap):
+ """Constructor, requires an existing EnqMap instance"""
+ self.__emap = emap
+ self.__map = {}
+
+ def __str__(self):
+ """Print the contents of the map"""
+ return self.report(True, True)
+
+ def add(self, fid, hdr):
+ """Add a new transactional record into the map"""
+ if isinstance(hdr, jrnl.DeqRec):
+ try:
+ self.__emap.lock(hdr.deq_rid)
+ except jerr.JWarning:
+ # Not in emap, look for rid in tmap
+ l = self.find_rid(hdr.deq_rid, hdr.xid)
+ if l != None:
+ if l[2]:
+ raise jerr.AlreadyLockedError(hdr.deq_rid)
+ l[2] = True
+ if hdr.xid in self.__map:
+ self.__map[hdr.xid].append([fid, hdr, False]) # append to existing list
+ else:
+ self.__map[hdr.xid] = [[fid, hdr, False]] # create new list
+
+ def contains(self, xid):
+ """Return True if the xid exists in the map; False otherwise"""
+ return xid in self.__map
+
+ def delete(self, hdr):
+ """Remove a transaction record from the map using either a commit or abort header"""
+ if hdr.magic[-1] == "c":
+ return self._commit(hdr.xid)
+ if hdr.magic[-1] == "a":
+ self._abort(hdr.xid)
+ else:
+ raise jerr.InvalidRecordTypeError("delete from TxnMap", hdr.magic, hdr.rid)
+
+ def find_rid(self, rid, xid_hint = None):
+ """ Search for and return map list with supplied rid. If xid_hint is supplied, try that xid first"""
+ if xid_hint != None and self.contains(xid_hint):
+ for l in self.__map[xid_hint]:
+ if l[1].rid == rid:
+ return l
+ for xid in self.__map.iterkeys():
+ if xid_hint == None or xid != xid_hint:
+ for l in self.__map[xid]:
+ if l[1].rid == rid:
+ return l
+
+ def get(self, xid):
+ """Return a list of operations for the given xid"""
+ if self.contains(xid):
+ return self.__map[xid]
+
+ def report(self, show_stats, show_records):
+ """Return a string containing a text report for all records in the map"""
+ if len(self.__map) == 0:
+ return "No outstanding transactions found."
+ rstr = "%d outstanding transactions found" % len(self.__map)
+ if show_records:
+ rstr += ":"
+ for xid, tup in self.__map.iteritems():
+ rstr += "\n xid=%s:" % jrnl.Utils.format_xid(xid)
+ for i in tup:
+ rstr += "\n %s" % str(i[1])
+ else:
+ rstr += "."
+ return rstr
+
+ def size(self):
+ """Return the number of xids in the map"""
+ return len(self.__map)
+
+ def xids(self):
+ """Return a list of xids in the map"""
+ return self.__map.keys()
+
+ def _abort(self, xid):
+ """Perform an abort operation for the given xid record"""
+ for fid, hdr, lock in self.__map[xid]:
+ if isinstance(hdr, jrnl.DeqRec):
+ self.__emap.unlock(hdr.deq_rid)
+ del self.__map[xid]
+
+ def _commit(self, xid):
+ """Perform a commit operation for the given xid record"""
+ mismatch_list = []
+ for fid, hdr, lock in self.__map[xid]:
+ if isinstance(hdr, jrnl.EnqRec):
+ self.__emap.add(fid, hdr, lock) # Transfer enq to emap
+ else:
+ if self.__emap.contains(hdr.deq_rid):
+ self.__emap.unlock(hdr.deq_rid)
+ self.__emap.delete(hdr.deq_rid)
+ else:
+ mismatch_list.append("0x%x" % hdr.deq_rid)
+ del self.__map[xid]
+ return mismatch_list
+
+#== class JrnlAnalyzer ========================================================
+
+class JrnlAnalyzer(object):
+ """
+ This class analyzes a set of journal files and determines which is the last to be written
+ (the newest file), and hence which should be the first to be read for recovery (the oldest
+ file).
+
+ The analysis is performed on construction; the contents of the JrnlInfo object passed provide
+ the recovery details.
+ """
+
+ def __init__(self, jinf):
+ """Constructor"""
+ self.__oldest = None
+ self.__jinf = jinf
+ self.__flist = self._analyze()
+
+ def __str__(self):
+ """String representation of this JrnlAnalyzer instance, will print out results of analysis."""
+ ostr = "Journal files analyzed in directory %s (* = earliest full):\n" % self.__jinf.get_current_dir()
+ if self.is_empty():
+ ostr += " <All journal files are empty>\n"
+ else:
+ for tup in self.__flist:
+ tmp = " "
+ if tup[0] == self.__oldest[0]:
+ tmp = "*"
+ ostr += " %s %s: owi=%-5s rid=0x%x, fro=0x%x ts=%s\n" % (tmp, os.path.basename(tup[1]), tup[2],
+ tup[3], tup[4], tup[5])
+ for i in range(self.__flist[-1][0] + 1, self.__jinf.get_num_jrnl_files()):
+ ostr += " %s.%04x.jdat: <empty>\n" % (self.__jinf.get_jrnl_base_name(), i)
+ return ostr
+
+ # Analysis
+
+ def get_oldest_file(self):
+ """Return a tuple (ordnum, jfn, owi, rid, fro, timestamp) for the oldest data file found in the journal"""
+ return self.__oldest
+
+ def get_oldest_file_index(self):
+ """Return the ordinal number of the oldest data file found in the journal"""
+ if self.is_empty():
+ return None
+ return self.__oldest[0]
+
+ def is_empty(self):
+ """Return true if the analysis found that the journal file has never been written to"""
+ return len(self.__flist) == 0
+
+ def _analyze(self):
+ """Perform the journal file analysis by reading and comparing the file headers of each journal data file"""
+ owi_found = False
+ flist = []
+ for i in range(0, self.__jinf.get_num_jrnl_files()):
+ jfn = os.path.join(self.__jinf.get_current_dir(), "%s.%04x.jdat" % (self.__jinf.get_jrnl_base_name(), i))
+ fhandle = open(jfn)
+ fhdr = jrnl.Utils.load(fhandle, jrnl.Hdr)
+ if fhdr.empty():
+ break
+ this_tup = (i, jfn, fhdr.owi(), fhdr.rid, fhdr.fro, fhdr.timestamp_str())
+ flist.append(this_tup)
+ if i == 0:
+ init_owi = fhdr.owi()
+ self.__oldest = this_tup
+ elif fhdr.owi() != init_owi and not owi_found:
+ self.__oldest = this_tup
+ owi_found = True
+ return flist
+
+
+#== class JrnlReader ====================================================
+
+class JrnlReader(object):
+ """
+ This class contains an Enqueue Map (emap), a transaction map (tmap) and a transaction
+ object list (txn_obj_list) which are populated by reading the journals from the oldest
+ to the newest and analyzing each record. The JrnlInfo and JrnlAnalyzer
+ objects supplied on construction provide the information used for the recovery.
+
+ The analysis is performed on construction.
+ """
+
+ def __init__(self, jinfo, jra, qflag = False, rflag = False, vflag = False):
+ """Constructor, which reads all """
+ self._jinfo = jinfo
+ self._jra = jra
+ self._qflag = qflag
+ self._rflag = rflag
+ self._vflag = vflag
+
+ # test callback functions for CSV tests
+ self._csv_store_chk = None
+ self._csv_start_cb = None
+ self._csv_enq_cb = None
+ self._csv_deq_cb = None
+ self._csv_txn_cb = None
+ self._csv_end_cb = None
+
+ self._emap = EnqMap()
+ self._tmap = TxnMap(self._emap)
+ self._txn_obj_list = {}
+
+ self._file = None
+ self._file_hdr = None
+ self._file_num = None
+ self._first_rec_flag = None
+ self._fro = None
+ self._last_file_flag = None
+ self._start_file_num = None
+ self._file_hdr_owi = None
+ self._warning = []
+
+ self._abort_cnt = 0
+ self._commit_cnt = 0
+ self._msg_cnt = 0
+ self._rec_cnt = 0
+ self._txn_msg_cnt = 0
+
+ def __str__(self):
+ """Print out all the undequeued records"""
+ return self.report(True, self._rflag)
+
+ def emap(self):
+ """Get the enqueue map"""
+ return self._emap
+
+ def get_abort_cnt(self):
+ """Get the cumulative number of transactional aborts found"""
+ return self._abort_cnt
+
+ def get_commit_cnt(self):
+ """Get the cumulative number of transactional commits found"""
+ return self._commit_cnt
+
+ def get_msg_cnt(self):
+ """Get the cumulative number of messages found"""
+ return self._msg_cnt
+
+ def get_rec_cnt(self):
+ """Get the cumulative number of journal records (including fillers) found"""
+ return self._rec_cnt
+
+ def is_last_file(self):
+ """Return True if the last file is being read"""
+ return self._last_file_flag
+
+ def report(self, show_stats = True, show_records = False):
+ """Return a string containing a report on the file analysis"""
+ rstr = self._emap.report(show_stats, show_records) + "\n" + self._tmap.report(show_stats, show_records)
+ #TODO - print size analysis here - ie how full, sparse, est. space remaining before enq threshold
+ return rstr
+
+ def run(self):
+ """Perform the read of the journal"""
+ if self._csv_start_cb != None and self._csv_start_cb(self._csv_store_chk):
+ return
+ if self._jra.is_empty():
+ return
+ stop = self._advance_jrnl_file(*self._jra.get_oldest_file())
+ while not stop and not self._get_next_record():
+ pass
+ if self._csv_end_cb != None and self._csv_end_cb(self._csv_store_chk):
+ return
+ if not self._qflag:
+ print
+
+ def set_callbacks(self, csv_store_chk, csv_start_cb = None, csv_enq_cb = None, csv_deq_cb = None, csv_txn_cb = None,
+ csv_end_cb = None):
+ """Set callbacks for checks to be made at various points while reading the journal"""
+ self._csv_store_chk = csv_store_chk
+ self._csv_start_cb = csv_start_cb
+ self._csv_enq_cb = csv_enq_cb
+ self._csv_deq_cb = csv_deq_cb
+ self._csv_txn_cb = csv_txn_cb
+ self._csv_end_cb = csv_end_cb
+
+ def tmap(self):
+ """Return the transaction map"""
+ return self._tmap
+
+ def get_txn_msg_cnt(self):
+ """Get the cumulative transactional message count"""
+ return self._txn_msg_cnt
+
+ def txn_obj_list(self):
+ """Get a cumulative list of transaction objects (commits and aborts)"""
+ return self._txn_obj_list
+
+ def _advance_jrnl_file(self, *oldest_file_info):
+ """Rotate to using the next journal file. Return False if the operation was successful, True if there are no
+ more files to read."""
+ fro_seek_flag = False
+ if len(oldest_file_info) > 0:
+ self._start_file_num = self._file_num = oldest_file_info[0]
+ self._fro = oldest_file_info[4]
+ fro_seek_flag = True # jump to fro to start reading
+ if not self._qflag and not self._rflag:
+ if self._vflag:
+ print "Recovering journals..."
+ else:
+ print "Recovering journals",
+ if self._file != None and self._is_file_full():
+ self._file.close()
+ self._file_num = self._incr_file_num()
+ if self._file_num == self._start_file_num:
+ return True
+ if self._start_file_num == 0:
+ self._last_file_flag = self._file_num == self._jinfo.get_num_jrnl_files() - 1
+ else:
+ self._last_file_flag = self._file_num == self._start_file_num - 1
+ if self._file_num < 0 or self._file_num >= self._jinfo.get_num_jrnl_files():
+ raise jerr.BadFileNumberError(self._file_num)
+ jfn = os.path.join(self._jinfo.get_current_dir(), "%s.%04x.jdat" %
+ (self._jinfo.get_jrnl_base_name(), self._file_num))
+ self._file = open(jfn)
+ self._file_hdr = jrnl.Utils.load(self._file, jrnl.Hdr)
+ if fro_seek_flag and self._file.tell() != self._fro:
+ self._file.seek(self._fro)
+ self._first_rec_flag = True
+ if not self._qflag:
+ if self._rflag:
+ print jfn, ": ", self._file_hdr
+ elif self._vflag:
+ print "* Reading %s" % jfn
+ else:
+ print ".",
+ sys.stdout.flush()
+ return False
+
+ def _check_owi(self, hdr):
+ """Return True if the header's owi indicator matches that of the file header record; False otherwise. This can
+ indicate whether the last record in a file has been read and now older records which have not yet been
+ overwritten are now being read."""
+ return self._file_hdr_owi == hdr.owi()
+
+ def _is_file_full(self):
+ """Return True if the current file is full (no more write space); false otherwise"""
+ return self._file.tell() >= self._jinfo.get_jrnl_file_size_bytes()
+
+ def _get_next_record(self):
+ """Get the next record in the file for analysis"""
+ if self._is_file_full():
+ if self._advance_jrnl_file():
+ return True
+ try:
+ hdr = jrnl.Utils.load(self._file, jrnl.Hdr)
+ except:
+ return True
+ if hdr.empty():
+ return True
+ if hdr.check():
+ return True
+ self._rec_cnt += 1
+ self._file_hdr_owi = self._file_hdr.owi()
+ if self._first_rec_flag:
+ if self._file_hdr.fro != hdr.foffs:
+ raise jerr.FirstRecordOffsetMismatch(self._file_hdr.fro, hdr.foffs)
+ else:
+ if self._rflag:
+ print " * fro ok: 0x%x" % self._file_hdr.fro
+ self._first_rec_flag = False
+ stop = False
+ if isinstance(hdr, jrnl.EnqRec):
+ stop = self._handle_enq_rec(hdr)
+ elif isinstance(hdr, jrnl.DeqRec):
+ stop = self._handle_deq_rec(hdr)
+ elif isinstance(hdr, jrnl.TxnRec):
+ stop = self._handle_txn_rec(hdr)
+ wstr = ""
+ for warn in self._warning:
+ wstr += " (%s)" % warn
+ if self._rflag:
+ print " > %s %s" % (hdr, wstr)
+ self._warning = []
+ return stop
+
+ def _handle_deq_rec(self, hdr):
+ """Process a dequeue ("RHMd") record"""
+ if self._load_rec(hdr):
+ return True
+
+ # Check OWI flag
+ if not self._check_owi(hdr):
+ self._warning.append("WARNING: OWI mismatch - could be overwrite boundary.")
+ return True
+ # Test hook
+ if self._csv_deq_cb != None and self._csv_deq_cb(self._csv_store_chk, hdr):
+ return True
+
+ try:
+ if hdr.xid == None:
+ self._emap.delete(hdr.deq_rid)
+ else:
+ self._tmap.add(self._file_hdr.fid, hdr)
+ except jerr.JWarning, warn:
+ self._warning.append(str(warn))
+ return False
+
+ def _handle_enq_rec(self, hdr):
+ """Process a dequeue ("RHMe") record"""
+ if self._load_rec(hdr):
+ return True
+
+ # Check extern flag
+ if hdr.extern and hdr.data != None:
+ raise jerr.ExternFlagDataError(hdr)
+ # Check OWI flag
+ if not self._check_owi(hdr):
+ self._warning.append("WARNING: OWI mismatch - could be overwrite boundary.")
+ return True
+ # Test hook
+ if self._csv_enq_cb != None and self._csv_enq_cb(self._csv_store_chk, hdr):
+ return True
+
+ if hdr.xid == None:
+ self._emap.add(self._file_hdr.fid, hdr)
+ else:
+ self._txn_msg_cnt += 1
+ self._tmap.add(self._file_hdr.fid, hdr)
+ self._msg_cnt += 1
+ return False
+
+ def _handle_txn_rec(self, hdr):
+ """Process a transaction ("RHMa or RHMc") record"""
+ if self._load_rec(hdr):
+ return True
+
+ # Check OWI flag
+ if not self._check_owi(hdr):
+ self._warning.append("WARNING: OWI mismatch - could be overwrite boundary.")
+ return True
+ # Test hook
+ if self._csv_txn_cb != None and self._csv_txn_cb(self._csv_store_chk, hdr):
+ return True
+
+ if hdr.magic[-1] == "a":
+ self._abort_cnt += 1
+ else:
+ self._commit_cnt += 1
+
+ if self._tmap.contains(hdr.xid):
+ mismatched_rids = self._tmap.delete(hdr)
+ if mismatched_rids != None and len(mismatched_rids) > 0:
+ self._warning.append("WARNING: transactional dequeues not found in enqueue map; rids=%s" %
+ mismatched_rids)
+ else:
+ self._warning.append("WARNING: %s not found in transaction map" % jrnl.Utils.format_xid(hdr.xid))
+ if hdr.magic[-1] == "c": # commits only
+ self._txn_obj_list[hdr.xid] = hdr
+ return False
+
+ def _incr_file_num(self):
+ """Increment the number of files read with wraparound (ie after file n-1, go to 0)"""
+ self._file_num += 1
+ if self._file_num >= self._jinfo.get_num_jrnl_files():
+ self._file_num = 0
+ return self._file_num
+
+ def _load_rec(self, hdr):
+ """Load a single record for the given header. There may be arbitrarily large xids and data components."""
+ while not hdr.complete():
+ if self._advance_jrnl_file():
+ return True
+ hdr.load(self._file)
+ return False
+
+# =============================================================================
+
+if __name__ == "__main__":
+ print "This is a library, and cannot be executed."
diff --git a/qpid/tools/src/py/qpidstore/jerr.py b/qpid/tools/src/py/qpidstore/jerr.py
new file mode 100644
index 0000000000..448f881ce3
--- /dev/null
+++ b/qpid/tools/src/py/qpidstore/jerr.py
@@ -0,0 +1,219 @@
+#
+# 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.
+#
+
+# == Warnings =================================================================
+
+class JWarning(Exception):
+ """Class to convey a warning"""
+ def __init__(self, err):
+ """Constructor"""
+ Exception.__init__(self, err)
+
+# == Errors ===================================================================
+
+class AllJrnlFilesEmptyCsvError(Exception):
+ """All journal files are empty (never been written)"""
+ def __init__(self, tnum, exp_num_msgs):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] All journal files are empty, but test expects %d msg(s)." %
+ (tnum, exp_num_msgs))
+
+class AlreadyLockedError(Exception):
+ """Error class for trying to lock a record that is already locked"""
+ def __init__(self, rid):
+ """Constructor"""
+ Exception.__init__(self, "Locking record which is already locked in EnqMap: rid=0x%x" % rid)
+
+class BadFileNumberError(Exception):
+ """Error class for incorrect or unexpected file number"""
+ def __init__(self, file_num):
+ """Constructor"""
+ Exception.__init__(self, "Bad file number %d" % file_num)
+
+class DataSizeError(Exception):
+ """Error class for data size mismatch"""
+ def __init__(self, exp_size, act_size, data_str):
+ """Constructor"""
+ Exception.__init__(self, "Inconsistent data size: expected:%d; actual:%d; data=\"%s\"" %
+ (exp_size, act_size, data_str))
+
+class DeleteLockedRecordError(Exception):
+ """Error class for deleting a locked record from the enqueue map"""
+ def __init__(self, rid):
+ """Constructor"""
+ Exception.__init__(self, "Deleting locked record from EnqMap: rid=0x%s" % rid)
+
+class DequeueNonExistentEnqueueError(Exception):
+ """Error class for attempting to dequeue a non-existent enqueue record (rid)"""
+ def __init__(self, deq_rid):
+ """Constructor"""
+ Exception.__init__(self, "Dequeuing non-existent enqueue record: rid=0x%s" % deq_rid)
+
+class DuplicateRidError(Exception):
+ """Error class for placing duplicate rid into enqueue map"""
+ def __init__(self, rid):
+ """Constructor"""
+ Exception.__init__(self, "Adding duplicate record to EnqMap: rid=0x%x" % rid)
+
+class EndianMismatchError(Exception):
+ """Error class mismatched record header endian flag"""
+ def __init__(self, exp_endianness):
+ """Constructor"""
+ Exception.__init__(self, "Endian mismatch: expected %s, but current record is %s" %
+ self.endian_str(exp_endianness))
+ #@staticmethod
+ def endian_str(endianness):
+ """Return a string tuple for the endianness error message"""
+ if endianness:
+ return "big", "little"
+ return "little", "big"
+ endian_str = staticmethod(endian_str)
+
+class ExternFlagDataError(Exception):
+ """Error class for the extern flag being set and the internal size > 0"""
+ def __init__(self, hdr):
+ """Constructor"""
+ Exception.__init__(self, "Message data found (msg size > 0) on record with external flag set: hdr=%s" % hdr)
+
+class ExternFlagCsvError(Exception):
+ """External flag mismatch between record and CSV test file"""
+ def __init__(self, tnum, exp_extern_flag):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] External flag mismatch: expected %s" % (tnum, exp_extern_flag))
+
+class ExternFlagWithDataCsvError(Exception):
+ """External flag set and Message data found"""
+ def __init__(self, tnum):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] Message data found on record with external flag set" % tnum)
+
+class FillExceedsFileSizeError(Exception):
+ """Internal error from a fill operation which will exceed the specified file size"""
+ def __init__(self, cur_size, file_size):
+ """Constructor"""
+ Exception.__init__(self, "Filling to size %d > max file size %d" % (cur_size, file_size))
+
+class FillSizeError(Exception):
+ """Internal error from a fill operation that did not match the calculated end point in the file"""
+ def __init__(self, cur_posn, exp_posn):
+ """Constructor"""
+ Exception.__init__(self, "Filled to size %d > expected file posn %d" % (cur_posn, exp_posn))
+
+class FirstRecordOffsetMismatch(Exception):
+ """Error class for file header fro mismatch with actual record"""
+ def __init__(self, fro, actual_offs):
+ """Constructor"""
+ Exception.__init__(self, "File header first record offset mismatch: fro=0x%x; actual offs=0x%x" %
+ (fro, actual_offs))
+
+class InvalidHeaderVersionError(Exception):
+ """Error class for invalid record header version"""
+ def __init__(self, exp_ver, act_ver):
+ """Constructor"""
+ Exception.__init__(self, "Invalid header version: expected:%d, actual:%d." % (exp_ver, act_ver))
+
+class InvalidRecordTypeError(Exception):
+ """Error class for any operation using an invalid record type"""
+ def __init__(self, operation, magic, rid):
+ """Constructor"""
+ Exception.__init__(self, "Invalid record type for operation: operation=%s record magic=%s, rid=0x%x" %
+ (operation, magic, rid))
+
+class InvalidRecordTailError(Exception):
+ """Error class for invalid record tail"""
+ def __init__(self, magic_err, rid_err, rec):
+ """Constructor"""
+ Exception.__init__(self, " > %s *INVALID TAIL RECORD (%s)*" % (rec, self.tail_err_str(magic_err, rid_err)))
+ #@staticmethod
+ def tail_err_str(magic_err, rid_err):
+ """Return a string indicating the tail record error(s)"""
+ estr = ""
+ if magic_err:
+ estr = "magic bad"
+ if rid_err:
+ estr += ", "
+ if rid_err:
+ estr += "rid mismatch"
+ return estr
+ tail_err_str = staticmethod(tail_err_str)
+
+class NonExistentRecordError(Exception):
+ """Error class for any operation on an non-existent record"""
+ def __init__(self, operation, rid):
+ """Constructor"""
+ Exception.__init__(self, "Operation on non-existent record: operation=%s; rid=0x%x" % (operation, rid))
+
+class NotLockedError(Exception):
+ """Error class for unlocking a record which is not locked in the first place"""
+ def __init__(self, rid):
+ """Constructor"""
+ Exception.__init__(self, "Unlocking record which is not locked in EnqMap: rid=0x%x" % rid)
+
+class JournalSpaceExceededError(Exception):
+ """Error class for when journal space of resized journal is too small to contain the transferred records"""
+ def __init__(self):
+ """Constructor"""
+ Exception.__init__(self, "Ran out of journal space while writing records")
+
+class MessageLengthCsvError(Exception):
+ """Message length mismatch between record and CSV test file"""
+ def __init__(self, tnum, exp_msg_len, actual_msg_len):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] Message length mismatch: expected %d; found %d" %
+ (tnum, exp_msg_len, actual_msg_len))
+
+class NumMsgsCsvError(Exception):
+ """Number of messages found mismatched with CSV file"""
+ def __init__(self, tnum, exp_num_msgs, actual_num_msgs):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %s] Incorrect number of messages: expected %d, found %d" %
+ (tnum, exp_num_msgs, actual_num_msgs))
+
+class TransactionCsvError(Exception):
+ """Transaction mismatch between record and CSV file"""
+ def __init__(self, tnum, exp_transactional):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] Transaction mismatch: expected %s" % (tnum, exp_transactional))
+
+class UnexpectedEndOfFileError(Exception):
+ """Error class for unexpected end-of-file during reading"""
+ def __init__(self, exp_size, curr_offs):
+ """Constructor"""
+ Exception.__init__(self, "Unexpected end-of-file: expected file size:%d; current offset:%d" %
+ (exp_size, curr_offs))
+
+class XidLengthCsvError(Exception):
+ """Message Xid length mismatch between record and CSV file"""
+ def __init__(self, tnum, exp_xid_len, actual_msg_len):
+ """Constructor"""
+ Exception.__init__(self, "[CSV %d] Message XID mismatch: expected %d; found %d" %
+ (tnum, exp_xid_len, actual_msg_len))
+
+class XidSizeError(Exception):
+ """Error class for Xid size mismatch"""
+ def __init__(self, exp_size, act_size, xid_str):
+ """Constructor"""
+ Exception.__init__(self, "Inconsistent xid size: expected:%d; actual:%d; xid=\"%s\"" %
+ (exp_size, act_size, xid_str))
+
+# =============================================================================
+
+if __name__ == "__main__":
+ print "This is a library, and cannot be executed."
+
diff --git a/qpid/tools/src/py/qpidstore/jrnl.py b/qpid/tools/src/py/qpidstore/jrnl.py
new file mode 100644
index 0000000000..7c4d6de4a9
--- /dev/null
+++ b/qpid/tools/src/py/qpidstore/jrnl.py
@@ -0,0 +1,794 @@
+#
+# 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.
+#
+
+import jerr
+import os.path, sys, xml.parsers.expat
+from struct import pack, unpack, calcsize
+from time import gmtime, strftime
+
+# TODO: Get rid of these! Use jinf instance instead
+DBLK_SIZE = 128
+SBLK_SIZE = 4 * DBLK_SIZE
+
+# TODO - this is messy - find a better way to handle this
+# This is a global, but is set directly by the calling program
+JRNL_FILE_SIZE = None
+
+#== class Utils ======================================================================
+
+class Utils(object):
+ """Class containing utility functions for dealing with the journal"""
+
+ __printchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{\|}~ "
+
+ # The @staticmethod declarations are not supported in RHEL4 (python 2.3.x)
+ # When RHEL4 support ends, restore these declarations and remove the older
+ # staticmethod() declaration.
+
+ #@staticmethod
+ def format_data(dsize, data):
+ """Format binary data for printing"""
+ if data == None:
+ return ""
+ if Utils._is_printable(data):
+ datastr = Utils._split_str(data)
+ else:
+ datastr = Utils._hex_split_str(data)
+ if dsize != len(data):
+ raise jerr.DataSizeError(dsize, len(data), datastr)
+ return "data(%d)=\"%s\" " % (dsize, datastr)
+ format_data = staticmethod(format_data)
+
+ #@staticmethod
+ def format_xid(xid, xidsize=None):
+ """Format binary XID for printing"""
+ if xid == None and xidsize != None:
+ if xidsize > 0:
+ raise jerr.XidSizeError(xidsize, 0, None)
+ return ""
+ if Utils._is_printable(xid):
+ xidstr = Utils._split_str(xid)
+ else:
+ xidstr = Utils._hex_split_str(xid)
+ if xidsize == None:
+ xidsize = len(xid)
+ elif xidsize != len(xid):
+ raise jerr.XidSizeError(xidsize, len(xid), xidstr)
+ return "xid(%d)=\"%s\" " % (xidsize, xidstr)
+ format_xid = staticmethod(format_xid)
+
+ #@staticmethod
+ def inv_str(string):
+ """Perform a binary 1's compliment (invert all bits) on a binary string"""
+ istr = ""
+ for index in range(0, len(string)):
+ istr += chr(~ord(string[index]) & 0xff)
+ return istr
+ inv_str = staticmethod(inv_str)
+
+ #@staticmethod
+ def load(fhandle, klass):
+ """Load a record of class klass from a file"""
+ args = Utils._load_args(fhandle, klass)
+ subclass = klass.discriminate(args)
+ result = subclass(*args) # create instance of record
+ if subclass != klass:
+ result.init(fhandle, *Utils._load_args(fhandle, subclass))
+ result.skip(fhandle)
+ return result
+ load = staticmethod(load)
+
+ #@staticmethod
+ def load_file_data(fhandle, size, data):
+ """Load the data portion of a message from file"""
+ if size == 0:
+ return (data, True)
+ if data == None:
+ loaded = 0
+ else:
+ loaded = len(data)
+ foverflow = fhandle.tell() + size - loaded > JRNL_FILE_SIZE
+ if foverflow:
+ rsize = JRNL_FILE_SIZE - fhandle.tell()
+ else:
+ rsize = size - loaded
+ fbin = fhandle.read(rsize)
+ if data == None:
+ data = unpack("%ds" % (rsize), fbin)[0]
+ else:
+ data = data + unpack("%ds" % (rsize), fbin)[0]
+ return (data, not foverflow)
+ load_file_data = staticmethod(load_file_data)
+
+ #@staticmethod
+ def rem_bytes_in_blk(fhandle, blk_size):
+ """Return the remaining bytes in a block"""
+ foffs = fhandle.tell()
+ return Utils.size_in_bytes_to_blk(foffs, blk_size) - foffs
+ rem_bytes_in_blk = staticmethod(rem_bytes_in_blk)
+
+ #@staticmethod
+ def size_in_blks(size, blk_size):
+ """Return the size in terms of data blocks"""
+ return int((size + blk_size - 1) / blk_size)
+ size_in_blks = staticmethod(size_in_blks)
+
+ #@staticmethod
+ def size_in_bytes_to_blk(size, blk_size):
+ """Return the bytes remaining until the next block boundary"""
+ return Utils.size_in_blks(size, blk_size) * blk_size
+ size_in_bytes_to_blk = staticmethod(size_in_bytes_to_blk)
+
+ #@staticmethod
+ def _hex_split_str(in_str, split_size = 50):
+ """Split a hex string into two parts separated by an ellipsis"""
+ if len(in_str) <= split_size:
+ return Utils._hex_str(in_str, 0, len(in_str))
+# if len(in_str) > split_size + 25:
+# return Utils._hex_str(in_str, 0, 10) + " ... " + Utils._hex_str(in_str, 55, 65) + " ... " + \
+# Utils._hex_str(in_str, len(in_str)-10, len(in_str))
+ return Utils._hex_str(in_str, 0, 10) + " ... " + Utils._hex_str(in_str, len(in_str)-10, len(in_str))
+ _hex_split_str = staticmethod(_hex_split_str)
+
+ #@staticmethod
+ def _hex_str(in_str, begin, end):
+ """Return a binary string as a hex string"""
+ hstr = ""
+ for index in range(begin, end):
+ if Utils._is_printable(in_str[index]):
+ hstr += in_str[index]
+ else:
+ hstr += "\\%02x" % ord(in_str[index])
+ return hstr
+ _hex_str = staticmethod(_hex_str)
+
+ #@staticmethod
+ def _is_printable(in_str):
+ """Return True if in_str in printable; False otherwise."""
+ return in_str.strip(Utils.__printchars) == ""
+ _is_printable = staticmethod(_is_printable)
+
+ #@staticmethod
+ def _load_args(fhandle, klass):
+ """Load the arguments from class klass"""
+ size = calcsize(klass.FORMAT)
+ foffs = fhandle.tell(),
+ fbin = fhandle.read(size)
+ if len(fbin) != size:
+ raise jerr.UnexpectedEndOfFileError(size, len(fbin))
+ return foffs + unpack(klass.FORMAT, fbin)
+ _load_args = staticmethod(_load_args)
+
+ #@staticmethod
+ def _split_str(in_str, split_size = 50):
+ """Split a string into two parts separated by an ellipsis if it is longer than split_size"""
+ if len(in_str) < split_size:
+ return in_str
+ return in_str[:25] + " ... " + in_str[-25:]
+ _split_str = staticmethod(_split_str)
+
+
+#== class Hdr =================================================================
+
+class Hdr:
+ """Class representing the journal header records"""
+
+ FORMAT = "=4sBBHQ"
+ HDR_VER = 1
+ OWI_MASK = 0x01
+ BIG_ENDIAN = sys.byteorder == "big"
+ REC_BOUNDARY = DBLK_SIZE
+
+ def __init__(self, foffs, magic, ver, endn, flags, rid):
+ """Constructor"""
+# Sizeable.__init__(self)
+ self.foffs = foffs
+ self.magic = magic
+ self.ver = ver
+ self.endn = endn
+ self.flags = flags
+ self.rid = long(rid)
+
+ def __str__(self):
+ """Return string representation of this header"""
+ if self.empty():
+ return "0x%08x: <empty>" % (self.foffs)
+ if self.magic[-1] == "x":
+ return "0x%08x: [\"%s\"]" % (self.foffs, self.magic)
+ if self.magic[-1] in ["a", "c", "d", "e", "f", "x"]:
+ return "0x%08x: [\"%s\" v=%d e=%d f=0x%04x rid=0x%x]" % (self.foffs, self.magic, self.ver, self.endn,
+ self.flags, self.rid)
+ return "0x%08x: <error, unknown magic \"%s\" (possible overwrite boundary?)>" % (self.foffs, self.magic)
+
+ #@staticmethod
+ def discriminate(args):
+ """Use the last char in the header magic to determine the header type"""
+ return _CLASSES.get(args[1][-1], Hdr)
+ discriminate = staticmethod(discriminate)
+
+ def empty(self):
+ """Return True if this record is empty (ie has a magic of 0x0000"""
+ return self.magic == "\x00"*4
+
+ def encode(self):
+ """Encode the header into a binary string"""
+ return pack(Hdr.FORMAT, self.magic, self.ver, self.endn, self.flags, self.rid)
+
+ def owi(self):
+ """Return the OWI (overwrite indicator) for this header"""
+ return self.flags & self.OWI_MASK != 0
+
+ def skip(self, fhandle):
+ """Read and discard the remainder of this record"""
+ fhandle.read(Utils.rem_bytes_in_blk(fhandle, self.REC_BOUNDARY))
+
+ def check(self):
+ """Check that this record is valid"""
+ if self.empty() or self.magic[:3] != "RHM" or self.magic[3] not in ["a", "c", "d", "e", "f", "x"]:
+ return True
+ if self.magic[-1] != "x":
+ if self.ver != self.HDR_VER:
+ raise jerr.InvalidHeaderVersionError(self.HDR_VER, self.ver)
+ if bool(self.endn) != self.BIG_ENDIAN:
+ raise jerr.EndianMismatchError(self.BIG_ENDIAN)
+ return False
+
+
+#== class FileHdr =============================================================
+
+class FileHdr(Hdr):
+ """Class for file headers, found at the beginning of journal files"""
+
+ FORMAT = "=2H4x3Q"
+ REC_BOUNDARY = SBLK_SIZE
+
+ def __str__(self):
+ """Return a string representation of the this FileHdr instance"""
+ return "%s fid=%d lid=%d fro=0x%08x t=%s" % (Hdr.__str__(self), self.fid, self.lid, self.fro,
+ self.timestamp_str())
+
+ def encode(self):
+ """Encode this class into a binary string"""
+ return Hdr.encode(self) + pack(FileHdr.FORMAT, self.fid, self.lid, self.fro, self.time_sec, self.time_ns)
+
+ def init(self, fhandle, foffs, fid, lid, fro, time_sec, time_ns):
+ """Initialize this instance to known values"""
+ self.fid = fid
+ self.lid = lid
+ self.fro = fro
+ self.time_sec = time_sec
+ self.time_ns = time_ns
+
+ def timestamp(self):
+ """Get the timestamp of this record as a tuple (secs, nsecs)"""
+ return (self.time_sec, self.time_ns)
+
+ def timestamp_str(self):
+ """Get the timestamp of this record in string format"""
+ time = gmtime(self.time_sec)
+ fstr = "%%a %%b %%d %%H:%%M:%%S.%09d %%Y" % (self.time_ns)
+ return strftime(fstr, time)
+
+
+#== class DeqRec ==============================================================
+
+class DeqRec(Hdr):
+ """Class for a dequeue record"""
+
+ FORMAT = "=QQ"
+
+ def __str__(self):
+ """Return a string representation of the this DeqRec instance"""
+ return "%s %sdrid=0x%x" % (Hdr.__str__(self), Utils.format_xid(self.xid, self.xidsize), self.deq_rid)
+
+ def init(self, fhandle, foffs, deq_rid, xidsize):
+ """Initialize this instance to known values"""
+ self.deq_rid = deq_rid
+ self.xidsize = xidsize
+ self.xid = None
+ self.deq_tail = None
+ self.xid_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(fhandle)
+
+ def encode(self):
+ """Encode this class into a binary string"""
+ buf = Hdr.encode(self) + pack(DeqRec.FORMAT, self.deq_rid, self.xidsize)
+ if self.xidsize > 0:
+ fmt = "%ds" % (self.xidsize)
+ buf += pack(fmt, self.xid)
+ buf += self.deq_tail.encode()
+ return buf
+
+ def load(self, fhandle):
+ """Load the remainder of this record (after the header has been loaded"""
+ if self.xidsize == 0:
+ self.xid_complete = True
+ self.tail_complete = True
+ else:
+ if not self.xid_complete:
+ (self.xid, self.xid_complete) = Utils.load_file_data(fhandle, self.xidsize, self.xid)
+ if self.xid_complete and not self.tail_complete:
+ ret = Utils.load_file_data(fhandle, calcsize(RecTail.FORMAT), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.deq_tail = RecTail(self.tail_offs, *unpack(RecTail.FORMAT, self.tail_bin))
+ magic_err = self.deq_tail.magic_inv != Utils.inv_str(self.magic)
+ rid_err = self.deq_tail.rid != self.rid
+ if magic_err or rid_err:
+ raise jerr.InvalidRecordTailError(magic_err, rid_err, self)
+ self.skip(fhandle)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ """Returns True if the entire record is loaded, False otherwise"""
+ return self.xid_complete and self.tail_complete
+
+
+#== class TxnRec ==============================================================
+
+class TxnRec(Hdr):
+ """Class for a transaction commit/abort record"""
+
+ FORMAT = "=Q"
+
+ def __str__(self):
+ """Return a string representation of the this TxnRec instance"""
+ return "%s %s" % (Hdr.__str__(self), Utils.format_xid(self.xid, self.xidsize))
+
+ def init(self, fhandle, foffs, xidsize):
+ """Initialize this instance to known values"""
+ self.xidsize = xidsize
+ self.xid = None
+ self.tx_tail = None
+ self.xid_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(fhandle)
+
+ def encode(self):
+ """Encode this class into a binary string"""
+ return Hdr.encode(self) + pack(TxnRec.FORMAT, self.xidsize) + pack("%ds" % self.xidsize, self.xid) + \
+ self.tx_tail.encode()
+
+ def load(self, fhandle):
+ """Load the remainder of this record (after the header has been loaded"""
+ if not self.xid_complete:
+ ret = Utils.load_file_data(fhandle, self.xidsize, self.xid)
+ self.xid = ret[0]
+ self.xid_complete = ret[1]
+ if self.xid_complete and not self.tail_complete:
+ ret = Utils.load_file_data(fhandle, calcsize(RecTail.FORMAT), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.tx_tail = RecTail(self.tail_offs, *unpack(RecTail.FORMAT, self.tail_bin))
+ magic_err = self.tx_tail.magic_inv != Utils.inv_str(self.magic)
+ rid_err = self.tx_tail.rid != self.rid
+ if magic_err or rid_err:
+ raise jerr.InvalidRecordTailError(magic_err, rid_err, self)
+ self.skip(fhandle)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ """Returns True if the entire record is loaded, False otherwise"""
+ return self.xid_complete and self.tail_complete
+
+
+#== class EnqRec ==============================================================
+
+class EnqRec(Hdr):
+ """Class for a enqueue record"""
+
+ FORMAT = "=QQ"
+ TRANSIENT_MASK = 0x10
+ EXTERN_MASK = 0x20
+
+ def __str__(self):
+ """Return a string representation of the this EnqRec instance"""
+ return "%s %s%s %s %s" % (Hdr.__str__(self), Utils.format_xid(self.xid, self.xidsize),
+ Utils.format_data(self.dsize, self.data), self.enq_tail, self.print_flags())
+
+ def encode(self):
+ """Encode this class into a binary string"""
+ buf = Hdr.encode(self) + pack(EnqRec.FORMAT, self.xidsize, self.dsize)
+ if self.xidsize > 0:
+ buf += pack("%ds" % self.xidsize, self.xid)
+ if self.dsize > 0:
+ buf += pack("%ds" % self.dsize, self.data)
+ if self.xidsize > 0 or self.dsize > 0:
+ buf += self.enq_tail.encode()
+ return buf
+
+ def init(self, fhandle, foffs, xidsize, dsize):
+ """Initialize this instance to known values"""
+ self.xidsize = xidsize
+ self.dsize = dsize
+ self.transient = self.flags & self.TRANSIENT_MASK > 0
+ self.extern = self.flags & self.EXTERN_MASK > 0
+ self.xid = None
+ self.data = None
+ self.enq_tail = None
+ self.xid_complete = False
+ self.data_complete = False
+ self.tail_complete = False
+ self.tail_bin = None
+ self.tail_offs = 0
+ self.load(fhandle)
+
+ def load(self, fhandle):
+ """Load the remainder of this record (after the header has been loaded"""
+ if not self.xid_complete:
+ ret = Utils.load_file_data(fhandle, self.xidsize, self.xid)
+ self.xid = ret[0]
+ self.xid_complete = ret[1]
+ if self.xid_complete and not self.data_complete:
+ if self.extern:
+ self.data_complete = True
+ else:
+ ret = Utils.load_file_data(fhandle, self.dsize, self.data)
+ self.data = ret[0]
+ self.data_complete = ret[1]
+ if self.data_complete and not self.tail_complete:
+ ret = Utils.load_file_data(fhandle, calcsize(RecTail.FORMAT), self.tail_bin)
+ self.tail_bin = ret[0]
+ if ret[1]:
+ self.enq_tail = RecTail(self.tail_offs, *unpack(RecTail.FORMAT, self.tail_bin))
+ magic_err = self.enq_tail.magic_inv != Utils.inv_str(self.magic)
+ rid_err = self.enq_tail.rid != self.rid
+ if magic_err or rid_err:
+ raise jerr.InvalidRecordTailError(magic_err, rid_err, self)
+ self.skip(fhandle)
+ self.tail_complete = ret[1]
+ return self.complete()
+
+ def complete(self):
+ """Returns True if the entire record is loaded, False otherwise"""
+ return self.xid_complete and self.data_complete and self.tail_complete
+
+ def print_flags(self):
+ """Utility function to decode the flags field in the header and print a string representation"""
+ fstr = ""
+ if self.transient:
+ fstr = "*TRANSIENT"
+ if self.extern:
+ if len(fstr) > 0:
+ fstr += ",EXTERNAL"
+ else:
+ fstr = "*EXTERNAL"
+ if len(fstr) > 0:
+ fstr += "*"
+ return fstr
+
+
+#== class RecTail =============================================================
+
+class RecTail:
+ """Class for a record tail - for all records where either an XID or data separate the header from the end of the
+ record"""
+
+ FORMAT = "=4sQ"
+
+ def __init__(self, foffs, magic_inv, rid):
+ """Initialize this instance to known values"""
+ self.foffs = foffs
+ self.magic_inv = magic_inv
+ self.rid = long(rid)
+
+ def __str__(self):
+ """Return a string representation of the this RecTail instance"""
+ magic = Utils.inv_str(self.magic_inv)
+ return "[\"%s\" rid=0x%x]" % (magic, self.rid)
+
+ def encode(self):
+ """Encode this class into a binary string"""
+ return pack(RecTail.FORMAT, self.magic_inv, self.rid)
+
+
+#== class JrnlInfo ============================================================
+
+class JrnlInfo(object):
+ """
+ This object reads and writes journal information files (<basename>.jinf). Methods are provided
+ to read a file, query its properties and reset just those properties necessary for normalizing
+ and resizing a journal.
+
+ Normalizing: resetting the directory and/or base filename to different values. This is necessary
+ if a set of journal files is copied from one location to another before being restored, as the
+ value of the path in the file no longer matches the actual path.
+
+ Resizing: If the journal geometry parameters (size and number of journal files) changes, then the
+ .jinf file must reflect these changes, as this file is the source of information for journal
+ recovery.
+
+ NOTE: Data size vs File size: There are methods which return the data size and file size of the
+ journal files.
+
+ +-------------+--------------------/ /----------+
+ | File header | File data |
+ +-------------+--------------------/ /----------+
+ | | |
+ | |<---------- Data size ---------->|
+ |<------------------ File Size ---------------->|
+
+ Data size: The size of the data content of the journal, ie that part which stores the data records.
+
+ File size: The actual disk size of the journal including data and the file header which precedes the
+ data.
+
+ The file header is fixed to 1 sblk, so file size = jrnl size + sblk size.
+ """
+
+ def __init__(self, jdir, bfn = "JournalData"):
+ """Constructor"""
+ self.__jdir = jdir
+ self.__bfn = bfn
+ self.__jinf_dict = {}
+ self._read_jinf()
+
+ def __str__(self):
+ """Create a string containing all of the journal info contained in the jinf file"""
+ ostr = "Journal info file %s:\n" % os.path.join(self.__jdir, "%s.jinf" % self.__bfn)
+ for key, val in self.__jinf_dict.iteritems():
+ ostr += " %s = %s\n" % (key, val)
+ return ostr
+
+ def normalize(self, jdir = None, bfn = None):
+ """Normalize the directory (ie reset the directory path to match the actual current location) for this
+ jinf file"""
+ if jdir == None:
+ self.__jinf_dict["directory"] = self.__jdir
+ else:
+ self.__jdir = jdir
+ self.__jinf_dict["directory"] = jdir
+ if bfn != None:
+ self.__bfn = bfn
+ self.__jinf_dict["base_filename"] = bfn
+
+ def resize(self, num_jrnl_files = None, jrnl_file_size = None):
+ """Reset the journal size information to allow for resizing the journal"""
+ if num_jrnl_files != None:
+ self.__jinf_dict["number_jrnl_files"] = num_jrnl_files
+ if jrnl_file_size != None:
+ self.__jinf_dict["jrnl_file_size_sblks"] = jrnl_file_size * self.get_jrnl_dblk_size_bytes()
+
+ def write(self, jdir = None, bfn = None):
+ """Write the .jinf file"""
+ self.normalize(jdir, bfn)
+ if not os.path.exists(self.get_jrnl_dir()):
+ os.makedirs(self.get_jrnl_dir())
+ fhandle = open(os.path.join(self.get_jrnl_dir(), "%s.jinf" % self.get_jrnl_base_name()), "w")
+ fhandle.write("<?xml version=\"1.0\" ?>\n")
+ fhandle.write("<jrnl>\n")
+ fhandle.write(" <journal_version value=\"%d\" />\n" % self.get_jrnl_version())
+ fhandle.write(" <journal_id>\n")
+ fhandle.write(" <id_string value=\"%s\" />\n" % self.get_jrnl_id())
+ fhandle.write(" <directory value=\"%s\" />\n" % self.get_jrnl_dir())
+ fhandle.write(" <base_filename value=\"%s\" />\n" % self.get_jrnl_base_name())
+ fhandle.write(" </journal_id>\n")
+ fhandle.write(" <creation_time>\n")
+ fhandle.write(" <seconds value=\"%d\" />\n" % self.get_creation_time()[0])
+ fhandle.write(" <nanoseconds value=\"%d\" />\n" % self.get_creation_time()[1])
+ fhandle.write(" <string value=\"%s\" />\n" % self.get_creation_time_str())
+ fhandle.write(" </creation_time>\n")
+ fhandle.write(" <journal_file_geometry>\n")
+ fhandle.write(" <number_jrnl_files value=\"%d\" />\n" % self.get_num_jrnl_files())
+ fhandle.write(" <auto_expand value=\"%s\" />\n" % str.lower(str(self.get_auto_expand())))
+ fhandle.write(" <jrnl_file_size_sblks value=\"%d\" />\n" % self.get_jrnl_data_size_sblks())
+ fhandle.write(" <JRNL_SBLK_SIZE value=\"%d\" />\n" % self.get_jrnl_sblk_size_dblks())
+ fhandle.write(" <JRNL_DBLK_SIZE value=\"%d\" />\n" % self.get_jrnl_dblk_size_bytes())
+ fhandle.write(" </journal_file_geometry>\n")
+ fhandle.write(" <cache_geometry>\n")
+ fhandle.write(" <wcache_pgsize_sblks value=\"%d\" />\n" % self.get_wr_buf_pg_size_sblks())
+ fhandle.write(" <wcache_num_pages value=\"%d\" />\n" % self.get_num_wr_buf_pgs())
+ fhandle.write(" <JRNL_RMGR_PAGE_SIZE value=\"%d\" />\n" % self.get_rd_buf_pg_size_sblks())
+ fhandle.write(" <JRNL_RMGR_PAGES value=\"%d\" />\n" % self.get_num_rd_buf_pgs())
+ fhandle.write(" </cache_geometry>\n")
+ fhandle.write("</jrnl>\n")
+ fhandle.close()
+
+ # Journal ID
+
+ def get_jrnl_version(self):
+ """Get the journal version"""
+ return self.__jinf_dict["journal_version"]
+
+ def get_jrnl_id(self):
+ """Get the journal id"""
+ return self.__jinf_dict["id_string"]
+
+ def get_current_dir(self):
+ """Get the current directory of the store (as opposed to that value saved in the .jinf file)"""
+ return self.__jdir
+
+ def get_jrnl_dir(self):
+ """Get the journal directory stored in the .jinf file"""
+ return self.__jinf_dict["directory"]
+
+ def get_jrnl_base_name(self):
+ """Get the base filename - that string used to name the journal files <basefilename>-nnnn.jdat and
+ <basefilename>.jinf"""
+ return self.__jinf_dict["base_filename"]
+
+ # Journal creation time
+
+ def get_creation_time(self):
+ """Get journal creation time as a tuple (secs, nsecs)"""
+ return (self.__jinf_dict["seconds"], self.__jinf_dict["nanoseconds"])
+
+ def get_creation_time_str(self):
+ """Get journal creation time as a string"""
+ return self.__jinf_dict["string"]
+
+ # --- Files and geometry ---
+
+ def get_num_jrnl_files(self):
+ """Get number of data files in the journal"""
+ return self.__jinf_dict["number_jrnl_files"]
+
+ def get_auto_expand(self):
+ """Return True if auto-expand is enabled; False otherwise"""
+ return self.__jinf_dict["auto_expand"]
+
+ def get_jrnl_sblk_size_dblks(self):
+ """Get the journal softblock size in dblks"""
+ return self.__jinf_dict["JRNL_SBLK_SIZE"]
+
+ def get_jrnl_sblk_size_bytes(self):
+ """Get the journal softblock size in bytes"""
+ return self.get_jrnl_sblk_size_dblks() * self.get_jrnl_dblk_size_bytes()
+
+ def get_jrnl_dblk_size_bytes(self):
+ """Get the journal datablock size in bytes"""
+ return self.__jinf_dict["JRNL_DBLK_SIZE"]
+
+ def get_jrnl_data_size_sblks(self):
+ """Get the data capacity (excluding the file headers) for one journal file in softblocks"""
+ return self.__jinf_dict["jrnl_file_size_sblks"]
+
+ def get_jrnl_data_size_dblks(self):
+ """Get the data capacity (excluding the file headers) for one journal file in datablocks"""
+ return self.get_jrnl_data_size_sblks() * self.get_jrnl_sblk_size_dblks()
+
+ def get_jrnl_data_size_bytes(self):
+ """Get the data capacity (excluding the file headers) for one journal file in bytes"""
+ return self.get_jrnl_data_size_dblks() * self.get_jrnl_dblk_size_bytes()
+
+ def get_jrnl_file_size_sblks(self):
+ """Get the size of one journal file on disk (including the file headers) in softblocks"""
+ return self.get_jrnl_data_size_sblks() + 1
+
+ def get_jrnl_file_size_dblks(self):
+ """Get the size of one journal file on disk (including the file headers) in datablocks"""
+ return self.get_jrnl_file_size_sblks() * self.get_jrnl_sblk_size_dblks()
+
+ def get_jrnl_file_size_bytes(self):
+ """Get the size of one journal file on disk (including the file headers) in bytes"""
+ return self.get_jrnl_file_size_dblks() * self.get_jrnl_dblk_size_bytes()
+
+ def get_tot_jrnl_data_size_sblks(self):
+ """Get the size of the entire jouranl's data capacity (excluding the file headers) for all files together in
+ softblocks"""
+ return self.get_num_jrnl_files() * self.get_jrnl_data_size_bytes()
+
+ def get_tot_jrnl_data_size_dblks(self):
+ """Get the size of the entire jouranl's data capacity (excluding the file headers) for all files together in
+ datablocks"""
+ return self.get_num_jrnl_files() * self.get_jrnl_data_size_dblks()
+
+ def get_tot_jrnl_data_size_bytes(self):
+ """Get the size of the entire jouranl's data capacity (excluding the file headers) for all files together in
+ bytes"""
+ return self.get_num_jrnl_files() * self.get_jrnl_data_size_bytes()
+
+ # Read and write buffers
+
+ def get_wr_buf_pg_size_sblks(self):
+ """Get the size of the write buffer pages in softblocks"""
+ return self.__jinf_dict["wcache_pgsize_sblks"]
+
+ def get_wr_buf_pg_size_dblks(self):
+ """Get the size of the write buffer pages in datablocks"""
+ return self.get_wr_buf_pg_size_sblks() * self.get_jrnl_sblk_size_dblks()
+
+ def get_wr_buf_pg_size_bytes(self):
+ """Get the size of the write buffer pages in bytes"""
+ return self.get_wr_buf_pg_size_dblks() * self.get_jrnl_dblk_size_bytes()
+
+ def get_num_wr_buf_pgs(self):
+ """Get the number of write buffer pages"""
+ return self.__jinf_dict["wcache_num_pages"]
+
+ def get_rd_buf_pg_size_sblks(self):
+ """Get the size of the read buffer pages in softblocks"""
+ return self.__jinf_dict["JRNL_RMGR_PAGE_SIZE"]
+
+ def get_rd_buf_pg_size_dblks(self):
+ """Get the size of the read buffer pages in datablocks"""
+ return self.get_rd_buf_pg_size_sblks * self.get_jrnl_sblk_size_dblks()
+
+ def get_rd_buf_pg_size_bytes(self):
+ """Get the size of the read buffer pages in bytes"""
+ return self.get_rd_buf_pg_size_dblks * self.get_jrnl_dblk_size_bytes()
+
+ def get_num_rd_buf_pgs(self):
+ """Get the number of read buffer pages"""
+ return self.__jinf_dict["JRNL_RMGR_PAGES"]
+
+ def _read_jinf(self):
+ """Read and initialize this instance from an existing jinf file located at the directory named in the
+ constructor - called by the constructor"""
+ fhandle = open(os.path.join(self.__jdir, "%s.jinf" % self.__bfn), "r")
+ parser = xml.parsers.expat.ParserCreate()
+ parser.StartElementHandler = self._handle_xml_start_elt
+ parser.CharacterDataHandler = self._handle_xml_char_data
+ parser.EndElementHandler = self._handle_xml_end_elt
+ parser.ParseFile(fhandle)
+ fhandle.close()
+
+ def _handle_xml_start_elt(self, name, attrs):
+ """Callback for handling XML start elements. Used by the XML parser."""
+ # bool values
+ if name == "auto_expand":
+ self.__jinf_dict[name] = attrs["value"] == "true"
+ # long values
+ elif name == "seconds" or \
+ name == "nanoseconds":
+ self.__jinf_dict[name] = long(attrs["value"])
+ # int values
+ elif name == "journal_version" or \
+ name == "number_jrnl_files" or \
+ name == "jrnl_file_size_sblks" or \
+ name == "JRNL_SBLK_SIZE" or \
+ name == "JRNL_DBLK_SIZE" or \
+ name == "wcache_pgsize_sblks" or \
+ name == "wcache_num_pages" or \
+ name == "JRNL_RMGR_PAGE_SIZE" or \
+ name == "JRNL_RMGR_PAGES":
+ self.__jinf_dict[name] = int(attrs["value"])
+ # strings
+ elif "value" in attrs:
+ self.__jinf_dict[name] = attrs["value"]
+
+ def _handle_xml_char_data(self, data):
+ """Callback for handling character data (ie within <elt>...</elt>). The jinf file does not use this in its
+ data. Used by the XML parser."""
+ pass
+
+ def _handle_xml_end_elt(self, name):
+ """Callback for handling XML end elements. Used by XML parser."""
+ pass
+
+
+#==============================================================================
+
+_CLASSES = {
+ "a": TxnRec,
+ "c": TxnRec,
+ "d": DeqRec,
+ "e": EnqRec,
+ "f": FileHdr
+}
+
+if __name__ == "__main__":
+ print "This is a library, and cannot be executed."