From 7cd4f1bfa95cd3c85f225dbf91beff60f51f0d0b Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 14 Jul 2011 08:53:37 +0000 Subject: NO-JIRA: Removed ruby and dotnet sub-directories; merge of r1146598 onto 0.12 release branch. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.12@1146605 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/LICENSE | 2 - qpid/NOTICE | 2 - qpid/README.txt | 14 +- qpid/dotnet/Consumer/Program.cs | 30 - qpid/dotnet/Consumer/default.build | 47 - qpid/dotnet/LICENSE.txt | 757 - qpid/dotnet/NOTICE.txt | 32 - qpid/dotnet/Producer/Program.cs | 30 - qpid/dotnet/Producer/default.build | 47 - qpid/dotnet/Program.cs | 30 - .../Qpid.Buffer.Tests/Properties/AssemblyInfo.cs | 56 - .../Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj | 83 - .../Qpid.Buffer.Tests/SimpleByteBufferTests.cs | 333 - .../Qpid.Buffer.Tests/SlicedByteBufferTests.cs | 133 - qpid/dotnet/Qpid.Buffer.Tests/default.build | 48 - qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs | 41 - .../dotnet/Qpid.Buffer/BufferUnderflowException.cs | 42 - qpid/dotnet/Qpid.Buffer/ByteBuffer.cs | 982 - qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs | 79 - qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs | 50 - qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs | 53 - qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj | 77 - qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs | 120 - .../Qpid.Buffer/SimpleByteBufferAllocator.cs | 58 - qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs | 86 - qpid/dotnet/Qpid.Buffer/default.build | 46 - qpid/dotnet/Qpid.Client.Tests/App.config | 34 - .../BrokerDetails/BrokerDetailsTest.cs | 65 - .../Channel/ChannelMessageCreationTests.cs | 79 - .../Messages/MessageFactoryRegistryTests.cs | 114 - .../Qpid.Client.Tests/Properties/AssemblyInfo.cs | 53 - .../Qpid.Client.Tests/Qpid.Client.Tests.csproj | 158 - .../Security/CallbackHandlerRegistryTests.cs | 66 - qpid/dotnet/Qpid.Client.Tests/default.build | 64 - qpid/dotnet/Qpid.Client.Tests/interop/Consumer.cs | 56 - qpid/dotnet/Qpid.Client.Tests/interop/Producer.cs | 55 - .../Qpid.Client.Tests/interop/TopicListener.cs | 229 - .../Qpid.Client.Tests/interop/TopicPublisher.cs | 208 - .../Qpid.Client.Tests/lib/nunit/nunit-licence.txt | 23 - .../lib/nunit/nunit.framework.dll | Bin 45056 -> 0 bytes qpid/dotnet/Qpid.Client.Tests/log4net.config | 68 - .../Qpid.Client.Tests/url/ConnectionUrlTest.cs | 446 - .../BlockingSocketProcessor.cs | 135 - .../BlockingSocketTransport.cs | 121 - .../ByteChannel.cs | 63 - .../Properties/AssemblyInfo.cs | 53 - .../Qpid.Client.Transport.Socket.Blocking.csproj | 92 - .../Qpid.Client.Transport.Socket.Blocking.mdp | 50 - .../Client/AMQAuthenticationException.cs | 39 - qpid/dotnet/Qpid.Client/Client/AMQConnection.cs | 873 - .../Qpid.Client/Client/AMQConnectionException.cs | 38 - qpid/dotnet/Qpid.Client/Client/AMQDestination.cs | 234 - .../Qpid.Client/Client/AMQNoConsumersException.cs | 45 - .../Qpid.Client/Client/AMQNoRouteException.cs | 46 - qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs | 322 - qpid/dotnet/Qpid.Client/Client/AmqChannel.cs | 1241 - .../Qpid.Client/Client/BasicMessageConsumer.cs | 485 - .../Qpid.Client/Client/BasicMessageProducer.cs | 405 - qpid/dotnet/Qpid.Client/Client/Closeable.cs | 83 - .../AuthenticationConfigurationSectionHandler.cs | 84 - .../Qpid.Client/Client/ConnectionTuneParameters.cs | 83 - .../Client/Failover/FailoverException.cs | 42 - .../Qpid.Client/Client/Failover/FailoverHandler.cs | 175 - .../Qpid.Client/Client/Failover/FailoverState.cs | 31 - .../Qpid.Client/Client/Failover/FailoverSupport.cs | 55 - .../Client/Handler/BasicDeliverMethodHandler.cs | 42 - .../Client/Handler/BasicReturnMethodHandler.cs | 44 - .../Client/Handler/ChannelCloseMethodHandler.cs | 68 - .../Client/Handler/ConnectionCloseMethodHandler.cs | 68 - .../Client/Handler/ConnectionCloseOkHandler.cs | 41 - .../Handler/ConnectionOpenOkMethodHandler.cs | 35 - .../Handler/ConnectionRedirectMethodHandler.cs | 68 - .../Handler/ConnectionSecureMethodHandler.cs | 60 - .../Client/Handler/ConnectionStartMethodHandler.cs | 144 - .../Client/Handler/ConnectionTuneMethodHandler.cs | 63 - .../Client/Handler/QueueDeleteOkMethodHandler.cs | 44 - .../Client/Handler/QueuePurgeOkMethodHandler.cs | 44 - .../Qpid.Client/Client/Message/AMQMessage.cs | 58 - .../Client/Message/AMQMessageFactory.cs | 73 - .../Client/Message/AbstractQmsMessage.cs | 694 - .../Qpid.Client/Client/Message/IMessageFactory.cs | 52 - .../Client/Message/MessageFactoryRegistry.cs | 129 - .../Qpid.Client/Client/Message/QpidBytesMessage.cs | 353 - .../Client/Message/QpidBytesMessageFactory.cs | 75 - .../Qpid.Client/Client/Message/QpidHeaders.cs | 233 - .../Qpid.Client/Client/Message/QpidTextMessage.cs | 115 - .../Client/Message/QpidTextMessageFactory.cs | 40 - .../Message/UnexpectedBodyReceivedException.cs | 57 - .../Client/Message/UnprocessedMessage.cs | 57 - .../Qpid.Client/Client/Protocol/AMQMethodEvent.cs | 76 - .../Client/Protocol/AMQProtocolListener.cs | 318 - .../Client/Protocol/AMQProtocolSession.cs | 267 - .../Qpid.Client/Client/Protocol/DefaultTimeouts.cs | 47 - .../Client/Protocol/IConnectionCloser.cs | 27 - .../Client/Protocol/IProtocolListener.cs | 36 - .../Listener/BlockingMethodFrameListener.cs | 110 - .../Client/Protocol/Listener/IAMQMethodListener.cs | 46 - .../Listener/SpecificMethodFrameListener.cs | 42 - .../Qpid.Client/Client/Protocol/ProtocolWriter.cs | 107 - .../Qpid.Client/Client/QpidConnectionInfo.cs | 504 - .../Client/Security/CallbackHandlerRegistry.cs | 129 - .../Client/Security/IAMQCallbackHandler.cs | 35 - .../Security/UsernamePasswordCallbackHandler.cs | 56 - qpid/dotnet/Qpid.Client/Client/SslOptions.cs | 81 - qpid/dotnet/Qpid.Client/Client/State/AMQState.cs | 35 - .../Client/State/AMQStateChangedEvent.cs | 52 - .../Qpid.Client/Client/State/AMQStateManager.cs | 251 - .../Qpid.Client/Client/State/IAMQStateListener.cs | 29 - .../Client/State/IStateAwareMethodListener.cs | 31 - .../Qpid.Client/Client/State/IStateListener.cs | 33 - .../State/IllegalStateTransitionException.cs | 74 - .../dotnet/Qpid.Client/Client/State/StateWaiter.cs | 121 - .../Client/Transport/AMQProtocolProvider.cs | 47 - .../Qpid.Client/Client/Transport/AmqpChannel.cs | 111 - .../Qpid.Client/Client/Transport/IByteChannel.cs | 71 - .../Client/Transport/IProtocolChannel.cs | 32 - .../Client/Transport/IProtocolWriter.cs | 29 - .../Qpid.Client/Client/Transport/IStreamFilter.cs | 38 - .../Qpid.Client/Client/Transport/ITransport.cs | 32 - .../Qpid.Client/Client/Transport/IoHandler.cs | 322 - .../Client/Transport/ProtocolDecoderOutput.cs | 60 - .../Transport/SingleProtocolEncoderOutput.cs | 40 - .../Socket/Blocking/BlockingSocketTransport.cs | 150 - .../Transport/Socket/Blocking/ByteChannel.cs | 92 - .../Transport/Socket/Blocking/ISocketConnector.cs | 34 - .../Transport/Socket/Blocking/SocketConnector.cs | 71 - .../Socket/Blocking/SslSocketConnector.cs | 107 - .../Qpid.Client/Client/Util/FlowControlQueue.cs | 98 - qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs | 52 - qpid/dotnet/Qpid.Client/Qpid.Client.csproj | 102 - qpid/dotnet/Qpid.Client/default.build | 52 - qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs | 55 - qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs | 63 - qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs | 315 - qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs | 134 - .../Qpid.Client/qms/failover/FailoverMethod.cs | 78 - .../Qpid.Client/qms/failover/FailoverRoundRobin.cs | 255 - .../qms/failover/FailoverSingleServer.cs | 147 - .../dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs | 152 - .../Demux/DemuxingProtocolCodecFactory.cs | 387 - qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs | 56 - .../Qpid.Codec/Demux/IMessageDecoderFactory.cs | 32 - qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs | 48 - .../Qpid.Codec/Demux/IMessageEncoderFactory.cs | 32 - .../Qpid.Codec/Demux/MessageDecoderResult.cs | 29 - qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.cs | 37 - qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs | 41 - qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs | 35 - qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs | 41 - qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs | 37 - qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs | 53 - qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs | 49 - qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs | 70 - qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs | 49 - qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj | 82 - .../Support/SimpleProtocolDecoderOutput.cs | 44 - .../Support/SimpleProtocolEncoderOutput.cs | 43 - qpid/dotnet/Qpid.Codec/default.build | 47 - .../Qpid.Common.Tests/Properties/AssemblyInfo.cs | 54 - .../Qpid.Common.Tests/Qpid.Common.Tests.csproj | 87 - .../Qpid/Collections/TestConsumerProducerQueue.cs | 85 - .../Qpid/Collections/TestLinkedHashtable.cs | 83 - .../Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs | 270 - .../Qpid/Framing/TestEncodingUtils.cs | 60 - qpid/dotnet/Qpid.Common.Tests/default.build | 52 - .../Qpid.Common/AMQChannelClosedException.cs | 40 - .../Qpid.Common/AMQConnectionClosedException.cs | 51 - .../dotnet/Qpid.Common/AMQDisconnectedException.cs | 45 - qpid/dotnet/Qpid.Common/AMQException.cs | 149 - .../Qpid.Common/AMQInvalidArgumentException.cs | 46 - .../Qpid.Common/AMQInvalidRoutingKeyException.cs | 46 - qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs | 59 - qpid/dotnet/Qpid.Common/AssemblySettings.cs | 160 - .../Qpid.Common/Collections/BlockingQueue.cs | 95 - .../Collections/ConsumerProducerQueue.cs | 113 - .../Qpid.Common/Collections/LinkedBlockingQueue.cs | 384 - .../Qpid.Common/Collections/LinkedHashtable.cs | 327 - .../Qpid.Common/Collections/SynchronousQueue.cs | 375 - .../Qpid.Common/Framing/AMQDataBlockDecoder.cs | 155 - .../Qpid.Common/Framing/AMQDataBlockEncoder.cs | 65 - qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs | 107 - .../Framing/AMQFrameDecodingException.cs | 59 - qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs | 93 - .../Qpid.Common/Framing/AMQMethodBodyFactory.cs | 45 - .../Framing/AMQProtocolHeaderException.cs | 39 - qpid/dotnet/Qpid.Common/Framing/AMQType.cs | 700 - qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.cs | 75 - qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs | 76 - .../Framing/BasicContentHeaderProperties.cs | 290 - .../Qpid.Common/Framing/CompositeAMQDataBlock.cs | 85 - qpid/dotnet/Qpid.Common/Framing/ContentBody.cs | 100 - .../Qpid.Common/Framing/ContentBodyFactory.cs | 53 - .../Qpid.Common/Framing/ContentHeaderBody.cs | 118 - .../Framing/ContentHeaderBodyFactory.cs | 53 - .../Framing/ContentHeaderPropertiesFactory.cs | 63 - qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs | 460 - qpid/dotnet/Qpid.Common/Framing/FieldTable.cs | 633 - qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs | 64 - .../Qpid.Common/Framing/HeartbeatBodyFactory.cs | 32 - qpid/dotnet/Qpid.Common/Framing/IBody.cs | 63 - qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs | 38 - .../Framing/IContentHeaderProperties.cs | 65 - qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs | 47 - .../Qpid.Common/Framing/IEncodableAMQDataBlock.cs | 31 - .../Qpid.Common/Framing/ProtocolInitiation.cs | 158 - qpid/dotnet/Qpid.Common/Properties/AssemblyInfo.cs | 52 - qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs | 100 - qpid/dotnet/Qpid.Common/Qpid.Common.csproj | 104 - qpid/dotnet/Qpid.Common/amqp.xml | 3929 --- qpid/dotnet/Qpid.Common/build.xml | 95 - qpid/dotnet/Qpid.Common/default.build | 49 - .../Qpid.Common/lib/log4net/log4net-licence.txt | 201 - qpid/dotnet/Qpid.Common/lib/log4net/log4net.dll | Bin 266240 -> 0 bytes qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml | 28676 ------------------- .../dotnet/Qpid.Common/lib/saxon/saxon-licence.txt | 471 - qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jar | Bin 3118502 -> 0 bytes .../lib/seclib-1.0.0/Org.Mentalis.Security.dll | Bin 184320 -> 0 bytes .../lib/seclib-1.0.0/seclib-license.txt | 13 - .../dotnet/Qpid.Common/resources/registry.template | 24 - qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl | 251 - qpid/dotnet/Qpid.Common/stylesheets/framing.xsl | 65 - qpid/dotnet/Qpid.Common/stylesheets/java.xsl | 230 - qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl | 109 - qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl | 68 - qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl | 64 - qpid/dotnet/Qpid.Common/stylesheets/readme.txt | 52 - qpid/dotnet/Qpid.Common/stylesheets/registry.xsl | 33 - qpid/dotnet/Qpid.Common/stylesheets/utils.xsl | 185 - .../Properties/AssemblyInfo.cs | 53 - .../Qpid.Integration.Tests.csproj | 124 - qpid/dotnet/Qpid.Integration.Tests/README.txt | 3 - qpid/dotnet/Qpid.Integration.Tests/default.build | 69 - .../Qpid.Integration.Tests/framework/Assertion.cs | 39 - .../Qpid.Integration.Tests/framework/Assertion.csx | 39 - .../framework/AssertionBase.csx | 65 - .../framework/BrokerLifecycleAware.csx | 67 - .../framework/CauseFailure.csx | 41 - .../framework/CauseFailureUserPrompt.csx | 63 - .../Qpid.Integration.Tests/framework/Circuit.cs | 102 - .../Qpid.Integration.Tests/framework/Circuit.csx | 103 - .../framework/CircuitEnd.csx | 86 - .../framework/CircuitEndBase.csx | 146 - .../framework/ExceptionMonitor.csx | 184 - .../framework/FrameworkBaseCase.cs | 282 - .../framework/FrameworkBaseCase.csx | 272 - .../framework/LocalCircuitFactory.csx | 301 - .../framework/MessageMonitor.csx | 102 - .../framework/MessagingTestConfigProperties.csx | 652 - .../framework/NotApplicableAssertion.csx | 111 - .../Qpid.Integration.Tests/framework/Publisher.cs | 65 - .../Qpid.Integration.Tests/framework/Publisher.csx | 72 - .../Qpid.Integration.Tests/framework/README.txt | 3 - .../Qpid.Integration.Tests/framework/Receiver.cs | 80 - .../Qpid.Integration.Tests/framework/Receiver.csx | 88 - .../framework/TestClientDetails.cs | 84 - .../framework/TestClientDetails.csx | 82 - .../Qpid.Integration.Tests/framework/TestModel.cs | 657 - .../Qpid.Integration.Tests/framework/TestUtils.csx | 188 - .../Qpid.Integration.Tests/framework/alljava.csx | 7851 ----- .../clocksynch/ClockSynchFailureException.csx | 45 - .../framework/clocksynch/ClockSynchThread.csx | 117 - .../framework/clocksynch/ClockSynchronizer.csx | 66 - .../clocksynch/LocalClockSynchronizer.csx | 70 - .../framework/clocksynch/UDPClockSynchronizer.csx | 453 - .../framework/distributedcircuit/TestClient.csx | 493 - .../distributedcircuit/TestClientCircuitEnd.csx | 312 - .../TestClientControlledTest.csx | 104 - .../framework/localcircuit/LocalCircuitImpl.csx | 290 - .../framework/localcircuit/LocalPublisherImpl.csx | 164 - .../framework/localcircuit/LocalReceiverImpl.csx | 137 - .../framework/sequencers/BaseCircuitFactory.csx | 128 - .../framework/sequencers/CircuitFactory.cs | 85 - .../framework/sequencers/CircuitFactory.csx | 99 - .../interactive/FailoverTest.cs | 397 - .../interactive/SendReceiveTest.cs | 181 - .../interop/InteropClientTestCase.cs | 87 - .../interop/TestCases/TestCase1DummyRun.cs | 89 - .../interop/TestCases/TestCase2BasicP2P.cs | 205 - .../interop/TestCases/TestCase3BasicPubSub.cs | 244 - .../interop/TestCases/TestCase4P2PMessageSize.cs | 244 - .../TestCases/TestCase5PubSubMessageSize.cs | 252 - .../Qpid.Integration.Tests/interop/TestClient.cs | 381 - qpid/dotnet/Qpid.Integration.Tests/log4net.config | 69 - .../old/ServiceProvidingClient.tmp | 150 - .../old/ServiceRequestingClient.tmp | 182 - .../testcases/BaseMessagingTestFixture.cs | 280 - .../testcases/ChannelQueueTest.cs | 237 - .../testcases/CommitRollbackTest.cs | 261 - .../testcases/ConnectionTest.cs | 73 - .../testcases/DurableSubscriptionTest.cs | 166 - .../testcases/HeadersExchangeTest.cs | 282 - .../testcases/MandatoryMessageTest.cs | 149 - .../testcases/ProducerMultiConsumerTest.cs | 167 - .../testcases/Qpid.Integration.Tests.csproj | 64 - .../testcases/QueueBrowsingTest.cs | 121 - .../testcases/SslConnectionTest.cs | 64 - .../testcases/SustainedTest.cs | 109 - qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs | 42 - .../Qpid.Messaging/ChannelLimitReachedException.cs | 60 - qpid/dotnet/Qpid.Messaging/DeliveryMode.cs | 28 - .../Qpid.Messaging/ExchangeClassConstants.cs | 29 - qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs | 42 - qpid/dotnet/Qpid.Messaging/IBytesMessage.cs | 63 - qpid/dotnet/Qpid.Messaging/IChannel.cs | 280 - qpid/dotnet/Qpid.Messaging/ICloseable.cs | 38 - qpid/dotnet/Qpid.Messaging/IConnection.cs | 55 - qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs | 28 - qpid/dotnet/Qpid.Messaging/IConnectionListener.cs | 59 - qpid/dotnet/Qpid.Messaging/IFieldTable.cs | 42 - qpid/dotnet/Qpid.Messaging/IHeaders.cs | 67 - qpid/dotnet/Qpid.Messaging/IMessage.cs | 97 - qpid/dotnet/Qpid.Messaging/IMessageConsumer.cs | 79 - qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs | 92 - qpid/dotnet/Qpid.Messaging/ITextMessage.cs | 27 - .../Qpid.Messaging/MessageConsumerBuilder.cs | 113 - .../Qpid.Messaging/MessageNotReadableException.cs | 39 - .../Qpid.Messaging/MessageNotWritableException.cs | 38 - .../Qpid.Messaging/MessagePublisherBuilder.cs | 91 - .../Qpid.Messaging/Properties/AssemblyInfo.cs | 56 - qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj | 115 - qpid/dotnet/Qpid.Messaging/QpidException.cs | 43 - .../Qpid.Messaging/ResourceAllocationException.cs | 39 - qpid/dotnet/Qpid.Messaging/default.build | 45 - qpid/dotnet/Qpid.NET.FxCop | 16775 ----------- qpid/dotnet/Qpid.NET.sln | 116 - qpid/dotnet/Qpid.Sasl.Tests/App.config | 33 - .../Mechanisms/AnonymousSaslClientTests.cs | 72 - .../Mechanisms/CramMD5SaslClientTests.cs | 90 - .../Mechanisms/DigestSaslClientTests.cs | 249 - .../Mechanisms/ExternalSaslClientTests.cs | 71 - .../Mechanisms/PlainSaslClientTests.cs | 88 - .../Qpid.Sasl.Tests/Properties/AssemblyInfo.cs | 56 - qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj | 86 - qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs | 133 - qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs | 75 - qpid/dotnet/Qpid.Sasl.Tests/default.build | 52 - qpid/dotnet/Qpid.Sasl/Callbacks.cs | 139 - .../Qpid.Sasl/Configuration/SaslConfiguration.cs | 90 - .../SaslConfigurationSectionHandler.cs | 84 - qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs | 99 - qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs | 35 - qpid/dotnet/Qpid.Sasl/ISaslClient.cs | 42 - qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs | 40 - qpid/dotnet/Qpid.Sasl/MD5HMAC.cs | 115 - .../Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs | 69 - .../Qpid.Sasl/Mechanisms/CramMD5HexSaslClient.cs | 93 - .../Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs | 91 - .../Qpid.Sasl/Mechanisms/DigestSaslClient.cs | 576 - .../Qpid.Sasl/Mechanisms/ExternalSaslClient.cs | 69 - .../dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs | 81 - qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs | 57 - qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj | 73 - qpid/dotnet/Qpid.Sasl/Sasl.cs | 115 - qpid/dotnet/Qpid.Sasl/SaslClient.cs | 145 - qpid/dotnet/Qpid.Sasl/SaslException.cs | 56 - qpid/dotnet/Qpid.Sasl/SaslProperties.cs | 42 - qpid/dotnet/Qpid.Sasl/default.build | 45 - qpid/dotnet/README.txt | 90 - qpid/dotnet/RELEASE_NOTES.txt | 11 - qpid/dotnet/TestClient/Program.cs | 30 - qpid/dotnet/TestClient/Properties/AssemblyInfo.cs | 53 - qpid/dotnet/TestClient/TestClient.csproj | 115 - qpid/dotnet/TestClient/default.build | 47 - qpid/dotnet/TopicListener/Program.cs | 30 - .../TopicListener/Properties/AssemblyInfo.cs | 53 - qpid/dotnet/TopicListener/TopicListener.csproj | 115 - qpid/dotnet/TopicListener/default.build | 47 - qpid/dotnet/TopicPublisher/Program.cs | 30 - .../TopicPublisher/Properties/AssemblyInfo.cs | 53 - qpid/dotnet/TopicPublisher/TopicPublisher.csproj | 111 - qpid/dotnet/TopicPublisher/default.build | 47 - qpid/dotnet/build-framing.bat | 23 - qpid/dotnet/build-mono | 21 - qpid/dotnet/build-msbuild.bat | 22 - qpid/dotnet/build-nant-release | 34 - qpid/dotnet/build-nant.bat | 22 - qpid/dotnet/client-010/App.config | 34 - qpid/dotnet/client-010/LICENSE.txt | 757 - qpid/dotnet/client-010/NOTICE.txt | 32 - qpid/dotnet/client-010/README.txt | 69 - .../client-010/addins/ExcelAddIn/Excel.exe.config | 12 - .../client-010/addins/ExcelAddIn/ExcelAddIn.cs | 290 - .../client-010/addins/ExcelAddIn/ExcelAddIn.csproj | 89 - .../addins/ExcelAddIn/Properties/AssemblyInfo.cs | 56 - .../ExcelAddInMessageProcessor.csproj | 86 - .../addins/ExcelAddInMessageProcessor/Processor.cs | 44 - .../Properties/AssemblyInfo.cs | 56 - .../ExcelAddInProducer/ExcelAddInProducer.csproj | 83 - .../addins/ExcelAddInProducer/Program.cs | 62 - .../ExcelAddInProducer/Properties/AssemblyInfo.cs | 54 - qpid/dotnet/client-010/addins/README.txt | 29 - qpid/dotnet/client-010/client/Client.csproj | 242 - .../client-010/client/Properties/AssemblyInfo.cs | 56 - qpid/dotnet/client-010/client/client.sln | 129 - qpid/dotnet/client-010/client/client.suo | Bin 572415 -> 0 bytes qpid/dotnet/client-010/client/client/Client.cs | 195 - .../client/client/ClientConnectionDelegate.cs | 128 - .../client-010/client/client/ClientInterface.cs | 59 - .../client-010/client/client/ClientSession.cs | 109 - .../client/client/ClientSessionDelegate.cs | 55 - .../client/client/ClosedListenerInterface.cs | 29 - qpid/dotnet/client-010/client/client/ErrorCode.cs | 140 - qpid/dotnet/client-010/client/client/IClient.cs | 82 - .../client-010/client/client/IClientSession.cs | 39 - .../client-010/client/client/IClosedListener.cs | 29 - qpid/dotnet/client-010/client/client/IMessage.cs | 48 - .../client-010/client/client/IMessageListener.cs | 31 - qpid/dotnet/client-010/client/client/Message.cs | 131 - qpid/dotnet/client-010/client/default.build | 46 - qpid/dotnet/client-010/client/transport/Binary.cs | 129 - qpid/dotnet/client-010/client/transport/Binding.cs | 34 - qpid/dotnet/client-010/client/transport/Channel.cs | 174 - .../client-010/client/transport/ChannelDelegate.cs | 41 - .../client-010/client/transport/ClientDelegate.cs | 35 - .../client-010/client/transport/Connection.cs | 168 - .../client/transport/ConnectionDelegate.cs | 108 - qpid/dotnet/client-010/client/transport/Field.cs | 74 - qpid/dotnet/client-010/client/transport/Future.cs | 38 - qpid/dotnet/client-010/client/transport/Header.cs | 83 - .../dotnet/client-010/client/transport/IBinding.cs | 34 - qpid/dotnet/client-010/client/transport/IFuture.cs | 38 - .../client/transport/IProtocolDelegate.cs | 37 - .../client-010/client/transport/IProtocolEvent.cs | 42 - .../client-010/client/transport/IReceiver.cs | 38 - qpid/dotnet/client-010/client/transport/ISender.cs | 32 - .../dotnet/client-010/client/transport/ISession.cs | 73 - qpid/dotnet/client-010/client/transport/Method.cs | 150 - .../client/transport/ProtocolDelegate.cs | 37 - .../client-010/client/transport/ProtocolError.cs | 85 - .../client-010/client/transport/ProtocolEvent.cs | 42 - .../client-010/client/transport/ProtocolHeader.cs | 124 - qpid/dotnet/client-010/client/transport/Range.cs | 117 - .../dotnet/client-010/client/transport/RangeSet.cs | 150 - .../client-010/client/transport/ReceivedPayload.cs | 43 - .../dotnet/client-010/client/transport/Receiver.cs | 38 - qpid/dotnet/client-010/client/transport/Sender.cs | 32 - qpid/dotnet/client-010/client/transport/Session.cs | 522 - .../client-010/client/transport/SessionDelegate.cs | 126 - qpid/dotnet/client-010/client/transport/Struct.cs | 121 - .../client/transport/codec/AbstractDecoder.cs | 399 - .../client/transport/codec/AbstractEncoder.cs | 590 - .../client-010/client/transport/codec/Decoder.cs | 72 - .../client-010/client/transport/codec/Encodable.cs | 37 - .../client-010/client/transport/codec/Encoder.cs | 70 - .../client-010/client/transport/codec/IDecoder.cs | 72 - .../client/transport/codec/IEncodable.cs | 37 - .../client-010/client/transport/codec/IEncoder.cs | 70 - .../client-010/client/transport/codec/MSDecoder.cs | 110 - .../client-010/client/transport/codec/MSEncoder.cs | 172 - .../transport/exception/ConnectionException.cs | 49 - .../client/transport/exception/ExceptionArgs.cs | 41 - .../exception/ProtocolVersionException.cs | 59 - .../transport/exception/SessionClosedException.cs | 38 - .../client/transport/exception/SessionException.cs | 45 - .../transport/exception/TransportException.cs | 46 - .../client/transport/network/Assembler.cs | 254 - .../client/transport/network/Disassembler.cs | 222 - .../client-010/client/transport/network/Frame.cs | 143 - .../client/transport/network/IIoSender.cs | 28 - .../client/transport/network/INetworkDelegate.cs | 40 - .../client/transport/network/INetworkEvent.cs | 32 - .../client/transport/network/InputHandler.cs | 266 - .../client/transport/network/NetworkDelegate.cs | 40 - .../client/transport/network/NetworkEvent.cs | 32 - .../client/transport/network/io/IIoSender.cs | 28 - .../client/transport/network/io/IIoTransport.cs | 57 - .../client/transport/network/io/IoReceiver.cs | 185 - .../client/transport/network/io/IoSSLTransport.cs | 227 - .../client/transport/network/io/IoSender.cs | 137 - .../client/transport/network/io/IoTransport.cs | 141 - .../client/transport/util/ByteEncoder.cs | 218 - .../client/transport/util/CircularBuffer.cs | 132 - .../client-010/client/transport/util/Functions.cs | 41 - .../client-010/client/transport/util/Logger.cs | 114 - .../client/transport/util/ResultFuture.cs | 80 - .../client-010/client/transport/util/Serial.cs | 94 - .../client-010/client/transport/util/UUID.cs | 129 - qpid/dotnet/client-010/default.build | 275 - qpid/dotnet/client-010/demo/Demo.csproj | 110 - qpid/dotnet/client-010/demo/Program.cs | 126 - .../client-010/demo/Properties/AssemblyInfo.cs | 54 - .../demo/Properties/Resources.Designer.cs | 84 - .../client-010/demo/Properties/Resources.resx | 137 - .../demo/Properties/Settings.Designer.cs | 47 - .../client-010/demo/Properties/Settings.settings | 27 - qpid/dotnet/client-010/demo/default.build | 48 - .../direct/example-direct-Listener/Listener.cs | 117 - .../Properties/AssemblyInfo.cs | 54 - .../direct/example-direct-Listener/default.build | 48 - .../example-direct-Listener.csproj | 85 - .../direct/example-direct-producer/Producer.cs | 92 - .../Properties/AssemblyInfo.cs | 54 - .../direct/example-direct-producer/default.build | 48 - .../example-direct-producer.csproj | 85 - qpid/dotnet/client-010/examples/direct/verify | 37 - qpid/dotnet/client-010/examples/direct/verify.in | 14 - .../client-010/examples/direct/verify_cpp_dotnet | 29 - .../examples/direct/verify_cpp_dotnet.in | 14 - .../client-010/examples/direct/verify_dotnet_cpp | 29 - .../examples/direct/verify_dotnet_cpp.in | 15 - .../fanout/example-fanout-Listener/Listener.cs | 126 - .../Properties/AssemblyInfo.cs | 54 - .../fanout/example-fanout-Listener/default.build | 48 - .../example-fanout-Listener.csproj | 85 - .../fanout/example-fanout-Producer/Producer.cs | 89 - .../Properties/AssemblyInfo.cs | 54 - .../fanout/example-fanout-Producer/default.build | 48 - .../example-fanout-Producer.csproj | 85 - qpid/dotnet/client-010/examples/fanout/verify | 36 - qpid/dotnet/client-010/examples/fanout/verify.in | 14 - .../client-010/examples/fanout/verify_cpp_dotnet | 30 - .../examples/fanout/verify_cpp_dotnet.in | 14 - .../client-010/examples/fanout/verify_dotnet_cpp | 31 - .../examples/fanout/verify_dotnet_cpp.in | 15 - .../pub-sub/example-pub-sub-Listener/Listener.cs | 143 - .../Properties/AssemblyInfo.cs | 54 - .../pub-sub/example-pub-sub-Listener/default.build | 48 - .../example-pub-sub-Listener.csproj | 85 - .../Properties/AssemblyInfo.cs | 54 - .../pub-sub/example-pub-sub-Publisher/Publisher.cs | 98 - .../example-pub-sub-Publisher/default.build | 48 - .../example-pub-sub-Publisher.csproj | 85 - qpid/dotnet/client-010/examples/pub-sub/verify | 36 - qpid/dotnet/client-010/examples/pub-sub/verify.in | 95 - .../client-010/examples/pub-sub/verify_cpp_dotnet | 31 - .../examples/pub-sub/verify_cpp_dotnet.in | 55 - .../client-010/examples/pub-sub/verify_dotnet_cpp | 30 - .../examples/pub-sub/verify_dotnet_cpp.in | 99 - .../Properties/AssemblyInfo.cs | 54 - .../RequestResponseClient.cs | 142 - .../example-request-response-Client/default.build | 48 - .../example-request-response-Client.csproj | 85 - .../Properties/AssemblyInfo.cs | 54 - .../example-request-response-Server/Server.cs | 141 - .../example-request-response-Server/default.build | 48 - .../example-request-response-Server.csproj | 85 - .../client-010/examples/request-response/verify | 36 - .../client-010/examples/request-response/verify.in | 16 - .../examples/request-response/verify_cpp_dotnet | 31 - .../examples/request-response/verify_cpp_dotnet.in | 17 - .../examples/request-response/verify_dotnet_cpp | 31 - .../examples/request-response/verify_dotnet_cpp.in | 18 - qpid/dotnet/client-010/gentool/Composite.tpl | 291 - qpid/dotnet/client-010/gentool/Constant.tpl | 37 - qpid/dotnet/client-010/gentool/Enum.tpl | 59 - qpid/dotnet/client-010/gentool/IInvoker.tpl | 57 - qpid/dotnet/client-010/gentool/Invoker.tpl | 67 - qpid/dotnet/client-010/gentool/MethodDelegate.tpl | 35 - qpid/dotnet/client-010/gentool/Option.tpl | 42 - qpid/dotnet/client-010/gentool/StructFactory.tpl | 64 - qpid/dotnet/client-010/gentool/Type.tpl | 103 - qpid/dotnet/client-010/gentool/build.xml | 52 - qpid/dotnet/client-010/gentool/codegen | 86 - qpid/dotnet/client-010/gentool/dotnetgenutil.py | 271 - .../client-010/lib/log4net/log4net-licence.txt | 201 - qpid/dotnet/client-010/lib/log4net/log4net.dll | Bin 266240 -> 0 bytes qpid/dotnet/client-010/lib/log4net/log4net.xml | 28676 ------------------- qpid/dotnet/client-010/lib/nunit/nunit-licence.txt | 23 - .../client-010/lib/nunit/nunit.framework.dll | Bin 45056 -> 0 bytes qpid/dotnet/client-010/lib/plossum/C5-License.txt | 27 - qpid/dotnet/client-010/lib/plossum/C5.dll | Bin 274432 -> 0 bytes .../client-010/lib/plossum/Plossum CommandLine.dll | Bin 98304 -> 0 bytes qpid/dotnet/client-010/lib/plossum/license.txt | 28 - qpid/dotnet/client-010/log.xml | 46 - .../management/console/AbstractConsole.cs | 45 - qpid/dotnet/client-010/management/console/Agent.cs | 75 - .../dotnet/client-010/management/console/Broker.cs | 351 - .../client-010/management/console/BrokerURL.cs | 71 - .../client-010/management/console/ClassKey.cs | 107 - .../client-010/management/console/Console.cs | 46 - .../client-010/management/console/MethodResult.cs | 67 - .../client-010/management/console/ObjectID.cs | 88 - .../client-010/management/console/QMFEvent.cs | 74 - .../client-010/management/console/QMFObject.cs | 294 - .../management/console/SchemaArgument.cs | 59 - .../client-010/management/console/SchemaClass.cs | 141 - .../client-010/management/console/SchemaMethod.cs | 66 - .../management/console/SchemaProperty.cs | 59 - .../management/console/SchemaStatistic.cs | 54 - .../management/console/SchemaVariable.cs | 84 - .../management/console/SequenceManager.cs | 62 - .../client-010/management/console/Session.cs | 796 - qpid/dotnet/client-010/management/console/Util.cs | 150 - .../client-010/management/console/XMLUtil.cs | 127 - .../client-010/management/console/console.csproj | 101 - .../client-010/management/console/console.sln | 46 - .../client-010/management/console/default.build | 54 - qpid/dotnet/client-010/perftest/PerfTest.cs | 715 - .../client-010/perftest/Properties/AssemblyInfo.cs | 54 - qpid/dotnet/client-010/perftest/README.txt | 38 - qpid/dotnet/client-010/perftest/default.build | 50 - qpid/dotnet/client-010/perftest/perftest.csproj | 92 - .../client-010/test/Helpers/ConfigHelpers.cs | 65 - .../client-010/test/Properties/AssemblyInfo.cs | 56 - qpid/dotnet/client-010/test/Qpid Test.dll.config | 31 - qpid/dotnet/client-010/test/Test.csproj | 102 - qpid/dotnet/client-010/test/default.build | 55 - qpid/dotnet/client-010/test/interop/Admin.cs | 90 - .../client-010/test/interop/ApplicationHeaders.cs | 83 - .../client-010/test/interop/ConnectionTests.cs | 80 - qpid/dotnet/client-010/test/interop/Message.cs | 180 - qpid/dotnet/client-010/test/interop/TestCase.cs | 96 - .../test/transport/util/ByteEncoderTest.cs | 106 - .../test/transport/util/CircularBufferTest.cs | 89 - .../test/transport/util/ResultFutureTest.cs | 103 - .../client-010/test/transport/util/SerialTest.cs | 75 - .../client-010/test/transport/util/UUIDTest.cs | 64 - .../client-010/wcf/Properties/AssemblyInfo.cs | 57 - qpid/dotnet/client-010/wcf/demo/ConfigDemo.suo | Bin 23552 -> 0 bytes qpid/dotnet/client-010/wcf/demo/Demo.suo | Bin 33280 -> 0 bytes .../wcf/demo/wcfBookingClient/Form1.Designer.cs | 185 - .../client-010/wcf/demo/wcfBookingClient/Form1.cs | 96 - .../wcf/demo/wcfBookingClient/Form1.resx | 143 - .../wcf/demo/wcfBookingClient/Program.cs | 41 - .../wcfBookingClient/Properties/AssemblyInfo.cs | 57 - .../Properties/Resources.Designer.cs | 92 - .../wcfBookingClient/Properties/Resources.resx | 137 - .../Properties/Settings.Designer.cs | 51 - .../wcfBookingClient/Properties/Settings.settings | 27 - .../demo/wcfBookingClient/wcBookingClient.csproj | 123 - .../wcf/demo/wcfBookingServer/Booking.cs | 62 - .../wcf/demo/wcfBookingServer/IBooking.cs | 43 - .../client-010/wcf/demo/wcfBookingServer/Order.cs | 45 - .../wcf/demo/wcfBookingServer/Program.cs | 98 - .../wcfBookingServer/Properties/AssemblyInfo.cs | 57 - .../wcf/demo/wcfBookingServer/Receipt.cs | 46 - .../demo/wcfBookingServer/wcfBookingServer.csproj | 97 - .../client-010/wcf/demo/wcfHelloClient/App.config | 56 - .../wcf/demo/wcfHelloClient/HelloClient.cs | 36 - .../wcf/demo/wcfHelloClient/IHelloService.cs | 33 - .../client-010/wcf/demo/wcfHelloClient/Program.cs | 48 - .../demo/wcfHelloClient/Properties/AssemblyInfo.cs | 57 - .../wcf/demo/wcfHelloClient/wcfHelloClient.csproj | 85 - .../client-010/wcf/demo/wcfHelloServer/App.config | 64 - .../wcf/demo/wcfHelloServer/HelloService.cs | 34 - .../wcf/demo/wcfHelloServer/IHelloService.cs | 32 - .../client-010/wcf/demo/wcfHelloServer/Program.cs | 47 - .../demo/wcfHelloServer/Properties/AssemblyInfo.cs | 57 - .../wcf/demo/wcfHelloServer/wcfHelloServer.csproj | 87 - .../client-010/wcf/demo/wcfRPC/IUpperCase.cs | 31 - qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.cs | 113 - .../wcf/demo/wcfRPC/Properties/AssemblyInfo.cs | 57 - .../demo/wcfRPC/QpidBindingConfigurationElement.cs | 205 - .../dotnet/client-010/wcf/demo/wcfRPC/UpperCase.cs | 33 - .../client-010/wcf/demo/wcfRPC/wcfRPC.csproj | 93 - .../client-010/wcf/model/CommunicationOperation.cs | 31 - qpid/dotnet/client-010/wcf/model/QpidBinding.cs | 185 - .../dotnet/client-010/wcf/model/QpidChannelBase.cs | 167 - .../client-010/wcf/model/QpidChannelFactory.cs | 74 - .../client-010/wcf/model/QpidChannelListener.cs | 79 - .../wcf/model/QpidChannelListenerBase.cs | 111 - .../client-010/wcf/model/QpidInputChannel.cs | 218 - .../client-010/wcf/model/QpidInputChannelBase.cs | 101 - .../client-010/wcf/model/QpidOutputChannel.cs | 89 - .../client-010/wcf/model/QpidOutputChannelBase.cs | 77 - .../wcf/model/QpidTransportBindingElement.cs | 186 - .../client-010/wcf/model/QpidTransportElement.cs | 183 - qpid/dotnet/client-010/wcf/wcf.csproj | 79 - qpid/dotnet/client-010/wcf/wcf.sln | 70 - qpid/dotnet/client-010/wcf/wcf.suo | Bin 105984 -> 0 bytes qpid/dotnet/default.build | 255 - qpid/ruby/LICENSE.txt | 203 - qpid/ruby/Makefile | 47 - qpid/ruby/NOTICE.txt | 19 - qpid/ruby/README.txt | 26 - qpid/ruby/RELEASE_NOTES | 10 - qpid/ruby/Rakefile | 116 - qpid/ruby/examples/hello-world.rb | 61 - qpid/ruby/examples/qmf-libvirt.rb | 80 - qpid/ruby/ext/sasl/extconf.rb | 28 - qpid/ruby/ext/sasl/sasl.c | 472 - qpid/ruby/lib/qpid.rb | 41 - qpid/ruby/lib/qpid/assembler.rb | 148 - qpid/ruby/lib/qpid/client.rb | 136 - qpid/ruby/lib/qpid/codec.rb | 457 - qpid/ruby/lib/qpid/codec08.rb | 265 - qpid/ruby/lib/qpid/config.rb | 32 - qpid/ruby/lib/qpid/connection.rb | 222 - qpid/ruby/lib/qpid/connection08.rb | 252 - qpid/ruby/lib/qpid/datatypes.rb | 353 - qpid/ruby/lib/qpid/delegates.rb | 237 - qpid/ruby/lib/qpid/fields.rb | 49 - qpid/ruby/lib/qpid/framer.rb | 212 - qpid/ruby/lib/qpid/invoker.rb | 65 - qpid/ruby/lib/qpid/packer.rb | 33 - qpid/ruby/lib/qpid/peer.rb | 289 - qpid/ruby/lib/qpid/qmf.rb | 1957 -- qpid/ruby/lib/qpid/queue.rb | 101 - qpid/ruby/lib/qpid/session.rb | 458 - qpid/ruby/lib/qpid/spec.rb | 183 - qpid/ruby/lib/qpid/spec010.rb | 485 - qpid/ruby/lib/qpid/spec08.rb | 190 - qpid/ruby/lib/qpid/specs/amqp.0-10-qpid-errata.xml | 6654 ----- qpid/ruby/lib/qpid/specs/amqp.0-10.dtd | 246 - qpid/ruby/lib/qpid/test.rb | 35 - qpid/ruby/lib/qpid/traverse.rb | 64 - qpid/ruby/lib/qpid/util.rb | 75 - qpid/ruby/tests/assembler.rb | 78 - qpid/ruby/tests/codec010.rb | 122 - qpid/ruby/tests/connection.rb | 246 - qpid/ruby/tests/datatypes.rb | 224 - qpid/ruby/tests/framer.rb | 99 - qpid/ruby/tests/qmf.rb | 248 - qpid/ruby/tests/queue.rb | 80 - qpid/ruby/tests/spec010.rb | 80 - qpid/ruby/tests/util.rb | 72 - qpid/ruby/tests_0-8/basic.rb | 69 - qpid/ruby/tests_0-8/channel.rb | 48 - 708 files changed, 1 insertion(+), 172169 deletions(-) delete mode 100644 qpid/dotnet/Consumer/Program.cs delete mode 100644 qpid/dotnet/Consumer/default.build delete mode 100644 qpid/dotnet/LICENSE.txt delete mode 100644 qpid/dotnet/NOTICE.txt delete mode 100644 qpid/dotnet/Producer/Program.cs delete mode 100644 qpid/dotnet/Producer/default.build delete mode 100644 qpid/dotnet/Program.cs delete mode 100644 qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs delete mode 100644 qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs delete mode 100644 qpid/dotnet/Qpid.Buffer.Tests/default.build delete mode 100644 qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/ByteBuffer.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj delete mode 100644 qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs delete mode 100644 qpid/dotnet/Qpid.Buffer/default.build delete mode 100644 qpid/dotnet/Qpid.Client.Tests/App.config delete mode 100644 qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/default.build delete mode 100644 qpid/dotnet/Qpid.Client.Tests/interop/Consumer.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/interop/Producer.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs delete mode 100644 qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt delete mode 100644 qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll delete mode 100644 qpid/dotnet/Qpid.Client.Tests/log4net.config delete mode 100644 qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj delete mode 100644 qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQConnection.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQDestination.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/AmqChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Closeable.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/SslOptions.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/AMQState.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs delete mode 100644 qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs delete mode 100644 qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client/Qpid.Client.csproj delete mode 100644 qpid/dotnet/Qpid.Client/default.build delete mode 100644 qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs delete mode 100644 qpid/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs delete mode 100644 qpid/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs delete mode 100644 qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.cs delete mode 100644 qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs delete mode 100644 qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs delete mode 100644 qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs delete mode 100644 qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs delete mode 100644 qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj delete mode 100644 qpid/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs delete mode 100644 qpid/dotnet/Qpid.Codec/default.build delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs delete mode 100644 qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs delete mode 100644 qpid/dotnet/Qpid.Common.Tests/default.build delete mode 100644 qpid/dotnet/Qpid.Common/AMQChannelClosedException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQConnectionClosedException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQDisconnectedException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQInvalidArgumentException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs delete mode 100644 qpid/dotnet/Qpid.Common/AssemblySettings.cs delete mode 100644 qpid/dotnet/Qpid.Common/Collections/BlockingQueue.cs delete mode 100644 qpid/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs delete mode 100644 qpid/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs delete mode 100644 qpid/dotnet/Qpid.Common/Collections/LinkedHashtable.cs delete mode 100644 qpid/dotnet/Qpid.Common/Collections/SynchronousQueue.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQType.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ContentBody.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/FieldTable.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/IBody.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs delete mode 100644 qpid/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs delete mode 100644 qpid/dotnet/Qpid.Common/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs delete mode 100644 qpid/dotnet/Qpid.Common/Qpid.Common.csproj delete mode 100644 qpid/dotnet/Qpid.Common/amqp.xml delete mode 100644 qpid/dotnet/Qpid.Common/build.xml delete mode 100644 qpid/dotnet/Qpid.Common/default.build delete mode 100644 qpid/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt delete mode 100644 qpid/dotnet/Qpid.Common/lib/log4net/log4net.dll delete mode 100644 qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml delete mode 100644 qpid/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt delete mode 100644 qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jar delete mode 100644 qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll delete mode 100644 qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt delete mode 100644 qpid/dotnet/Qpid.Common/resources/registry.template delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/framing.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/java.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/readme.txt delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/registry.xsl delete mode 100644 qpid/dotnet/Qpid.Common/stylesheets/utils.xsl delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/Properties/AssemblyInfo.cs delete mode 100755 qpid/dotnet/Qpid.Integration.Tests/Qpid.Integration.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/README.txt delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/default.build delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/AssertionBase.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/BrokerLifecycleAware.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailure.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailureUserPrompt.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEnd.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEndBase.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/ExceptionMonitor.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/LocalCircuitFactory.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/MessageMonitor.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/MessagingTestConfigProperties.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/NotApplicableAssertion.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/README.txt delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/TestUtils.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/alljava.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchFailureException.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchThread.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchronizer.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/LocalClockSynchronizer.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/UDPClockSynchronizer.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClient.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientCircuitEnd.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientControlledTest.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalCircuitImpl.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalPublisherImpl.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalReceiverImpl.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/BaseCircuitFactory.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.csx delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interactive/FailoverTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interactive/SendReceiveTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/InteropClientTestCase.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase1DummyRun.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase2BasicP2P.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase3BasicPubSub.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase4P2PMessageSize.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase5PubSubMessageSize.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/interop/TestClient.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/log4net.config delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/old/ServiceProvidingClient.tmp delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/old/ServiceRequestingClient.tmp delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/ConnectionTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/MandatoryMessageTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs delete mode 100755 qpid/dotnet/Qpid.Integration.Tests/testcases/Qpid.Integration.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/QueueBrowsingTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs delete mode 100644 qpid/dotnet/Qpid.Integration.Tests/testcases/SustainedTest.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/DeliveryMode.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ExchangeClassConstants.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IBytesMessage.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IChannel.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ICloseable.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IConnection.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IConnectionListener.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IFieldTable.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IHeaders.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IMessage.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IMessageConsumer.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ITextMessage.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/MessageNotReadableException.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/MessageNotWritableException.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj delete mode 100644 qpid/dotnet/Qpid.Messaging/QpidException.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/ResourceAllocationException.cs delete mode 100644 qpid/dotnet/Qpid.Messaging/default.build delete mode 100644 qpid/dotnet/Qpid.NET.FxCop delete mode 100644 qpid/dotnet/Qpid.NET.sln delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/App.config delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs delete mode 100644 qpid/dotnet/Qpid.Sasl.Tests/default.build delete mode 100644 qpid/dotnet/Qpid.Sasl/Callbacks.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/ISaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/MD5HMAC.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5HexSaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj delete mode 100644 qpid/dotnet/Qpid.Sasl/Sasl.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/SaslClient.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/SaslException.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/SaslProperties.cs delete mode 100644 qpid/dotnet/Qpid.Sasl/default.build delete mode 100644 qpid/dotnet/README.txt delete mode 100644 qpid/dotnet/RELEASE_NOTES.txt delete mode 100644 qpid/dotnet/TestClient/Program.cs delete mode 100644 qpid/dotnet/TestClient/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/TestClient/TestClient.csproj delete mode 100644 qpid/dotnet/TestClient/default.build delete mode 100644 qpid/dotnet/TopicListener/Program.cs delete mode 100644 qpid/dotnet/TopicListener/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/TopicListener/TopicListener.csproj delete mode 100644 qpid/dotnet/TopicListener/default.build delete mode 100644 qpid/dotnet/TopicPublisher/Program.cs delete mode 100644 qpid/dotnet/TopicPublisher/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/TopicPublisher/TopicPublisher.csproj delete mode 100644 qpid/dotnet/TopicPublisher/default.build delete mode 100644 qpid/dotnet/build-framing.bat delete mode 100755 qpid/dotnet/build-mono delete mode 100644 qpid/dotnet/build-msbuild.bat delete mode 100755 qpid/dotnet/build-nant-release delete mode 100644 qpid/dotnet/build-nant.bat delete mode 100644 qpid/dotnet/client-010/App.config delete mode 100644 qpid/dotnet/client-010/LICENSE.txt delete mode 100644 qpid/dotnet/client-010/NOTICE.txt delete mode 100644 qpid/dotnet/client-010/README.txt delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs delete mode 100644 qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/addins/README.txt delete mode 100644 qpid/dotnet/client-010/client/Client.csproj delete mode 100644 qpid/dotnet/client-010/client/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/client/client.sln delete mode 100644 qpid/dotnet/client-010/client/client.suo delete mode 100644 qpid/dotnet/client-010/client/client/Client.cs delete mode 100644 qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/client/ClientInterface.cs delete mode 100644 qpid/dotnet/client-010/client/client/ClientSession.cs delete mode 100644 qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/client/ClosedListenerInterface.cs delete mode 100644 qpid/dotnet/client-010/client/client/ErrorCode.cs delete mode 100644 qpid/dotnet/client-010/client/client/IClient.cs delete mode 100644 qpid/dotnet/client-010/client/client/IClientSession.cs delete mode 100644 qpid/dotnet/client-010/client/client/IClosedListener.cs delete mode 100644 qpid/dotnet/client-010/client/client/IMessage.cs delete mode 100644 qpid/dotnet/client-010/client/client/IMessageListener.cs delete mode 100644 qpid/dotnet/client-010/client/client/Message.cs delete mode 100644 qpid/dotnet/client-010/client/default.build delete mode 100644 qpid/dotnet/client-010/client/transport/Binary.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Binding.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Channel.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ChannelDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ClientDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Connection.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Field.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Future.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Header.cs delete mode 100644 qpid/dotnet/client-010/client/transport/IBinding.cs delete mode 100644 qpid/dotnet/client-010/client/transport/IFuture.cs delete mode 100644 qpid/dotnet/client-010/client/transport/IProtocolDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/IProtocolEvent.cs delete mode 100644 qpid/dotnet/client-010/client/transport/IReceiver.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ISender.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ISession.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Method.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ProtocolDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ProtocolError.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ProtocolEvent.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ProtocolHeader.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Range.cs delete mode 100644 qpid/dotnet/client-010/client/transport/RangeSet.cs delete mode 100644 qpid/dotnet/client-010/client/transport/ReceivedPayload.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Receiver.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Sender.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Session.cs delete mode 100644 qpid/dotnet/client-010/client/transport/SessionDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/Struct.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/Decoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/Encodable.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/Encoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/IDecoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/IEncodable.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/IEncoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/SessionClosedException.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/SessionException.cs delete mode 100644 qpid/dotnet/client-010/client/transport/exception/TransportException.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/Assembler.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/Disassembler.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/Frame.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/IIoSender.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/INetworkDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/INetworkEvent.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/InputHandler.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/NetworkDelegate.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/NetworkEvent.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IIoSender.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IIoTransport.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IoSender.cs delete mode 100644 qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/Functions.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/Logger.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/ResultFuture.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/Serial.cs delete mode 100644 qpid/dotnet/client-010/client/transport/util/UUID.cs delete mode 100644 qpid/dotnet/client-010/default.build delete mode 100644 qpid/dotnet/client-010/demo/Demo.csproj delete mode 100644 qpid/dotnet/client-010/demo/Program.cs delete mode 100644 qpid/dotnet/client-010/demo/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/demo/Properties/Resources.Designer.cs delete mode 100644 qpid/dotnet/client-010/demo/Properties/Resources.resx delete mode 100644 qpid/dotnet/client-010/demo/Properties/Settings.Designer.cs delete mode 100644 qpid/dotnet/client-010/demo/Properties/Settings.settings delete mode 100644 qpid/dotnet/client-010/demo/default.build delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-Listener/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build delete mode 100644 qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj delete mode 100644 qpid/dotnet/client-010/examples/direct/verify delete mode 100644 qpid/dotnet/client-010/examples/direct/verify.in delete mode 100644 qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet delete mode 100644 qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet.in delete mode 100644 qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp delete mode 100644 qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp.in delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build delete mode 100644 qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify.in delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet.in delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp delete mode 100644 qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp.in delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.cs delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify.in delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet.in delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp delete mode 100644 qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp.in delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Client/RequestResponseClient.cs delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build delete mode 100644 qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify.in delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet.in delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp delete mode 100644 qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp.in delete mode 100644 qpid/dotnet/client-010/gentool/Composite.tpl delete mode 100644 qpid/dotnet/client-010/gentool/Constant.tpl delete mode 100644 qpid/dotnet/client-010/gentool/Enum.tpl delete mode 100644 qpid/dotnet/client-010/gentool/IInvoker.tpl delete mode 100644 qpid/dotnet/client-010/gentool/Invoker.tpl delete mode 100644 qpid/dotnet/client-010/gentool/MethodDelegate.tpl delete mode 100644 qpid/dotnet/client-010/gentool/Option.tpl delete mode 100644 qpid/dotnet/client-010/gentool/StructFactory.tpl delete mode 100644 qpid/dotnet/client-010/gentool/Type.tpl delete mode 100644 qpid/dotnet/client-010/gentool/build.xml delete mode 100644 qpid/dotnet/client-010/gentool/codegen delete mode 100644 qpid/dotnet/client-010/gentool/dotnetgenutil.py delete mode 100644 qpid/dotnet/client-010/lib/log4net/log4net-licence.txt delete mode 100644 qpid/dotnet/client-010/lib/log4net/log4net.dll delete mode 100644 qpid/dotnet/client-010/lib/log4net/log4net.xml delete mode 100644 qpid/dotnet/client-010/lib/nunit/nunit-licence.txt delete mode 100644 qpid/dotnet/client-010/lib/nunit/nunit.framework.dll delete mode 100644 qpid/dotnet/client-010/lib/plossum/C5-License.txt delete mode 100644 qpid/dotnet/client-010/lib/plossum/C5.dll delete mode 100644 qpid/dotnet/client-010/lib/plossum/Plossum CommandLine.dll delete mode 100644 qpid/dotnet/client-010/lib/plossum/license.txt delete mode 100644 qpid/dotnet/client-010/log.xml delete mode 100644 qpid/dotnet/client-010/management/console/AbstractConsole.cs delete mode 100644 qpid/dotnet/client-010/management/console/Agent.cs delete mode 100644 qpid/dotnet/client-010/management/console/Broker.cs delete mode 100644 qpid/dotnet/client-010/management/console/BrokerURL.cs delete mode 100644 qpid/dotnet/client-010/management/console/ClassKey.cs delete mode 100644 qpid/dotnet/client-010/management/console/Console.cs delete mode 100644 qpid/dotnet/client-010/management/console/MethodResult.cs delete mode 100644 qpid/dotnet/client-010/management/console/ObjectID.cs delete mode 100644 qpid/dotnet/client-010/management/console/QMFEvent.cs delete mode 100644 qpid/dotnet/client-010/management/console/QMFObject.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaArgument.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaClass.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaMethod.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaProperty.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaStatistic.cs delete mode 100644 qpid/dotnet/client-010/management/console/SchemaVariable.cs delete mode 100644 qpid/dotnet/client-010/management/console/SequenceManager.cs delete mode 100644 qpid/dotnet/client-010/management/console/Session.cs delete mode 100644 qpid/dotnet/client-010/management/console/Util.cs delete mode 100644 qpid/dotnet/client-010/management/console/XMLUtil.cs delete mode 100644 qpid/dotnet/client-010/management/console/console.csproj delete mode 100644 qpid/dotnet/client-010/management/console/console.sln delete mode 100644 qpid/dotnet/client-010/management/console/default.build delete mode 100644 qpid/dotnet/client-010/perftest/PerfTest.cs delete mode 100644 qpid/dotnet/client-010/perftest/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/perftest/README.txt delete mode 100644 qpid/dotnet/client-010/perftest/default.build delete mode 100644 qpid/dotnet/client-010/perftest/perftest.csproj delete mode 100644 qpid/dotnet/client-010/test/Helpers/ConfigHelpers.cs delete mode 100644 qpid/dotnet/client-010/test/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/test/Qpid Test.dll.config delete mode 100644 qpid/dotnet/client-010/test/Test.csproj delete mode 100644 qpid/dotnet/client-010/test/default.build delete mode 100644 qpid/dotnet/client-010/test/interop/Admin.cs delete mode 100644 qpid/dotnet/client-010/test/interop/ApplicationHeaders.cs delete mode 100644 qpid/dotnet/client-010/test/interop/ConnectionTests.cs delete mode 100644 qpid/dotnet/client-010/test/interop/Message.cs delete mode 100644 qpid/dotnet/client-010/test/interop/TestCase.cs delete mode 100644 qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs delete mode 100644 qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs delete mode 100644 qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs delete mode 100644 qpid/dotnet/client-010/test/transport/util/SerialTest.cs delete mode 100644 qpid/dotnet/client-010/test/transport/util/UUIDTest.cs delete mode 100644 qpid/dotnet/client-010/wcf/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/ConfigDemo.suo delete mode 100644 qpid/dotnet/client-010/wcf/demo/Demo.suo delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.Designer.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.resx delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Program.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.Designer.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.resx delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.Designer.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.settings delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingClient/wcBookingClient.csproj delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Booking.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/IBooking.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Order.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Program.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Receipt.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfBookingServer/wcfBookingServer.csproj delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/App.config delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/HelloService.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/IHelloService.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Program.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfHelloServer/wcfHelloServer.csproj delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/IUpperCase.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/Properties/AssemblyInfo.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/QpidBindingConfigurationElement.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/UpperCase.cs delete mode 100644 qpid/dotnet/client-010/wcf/demo/wcfRPC/wcfRPC.csproj delete mode 100644 qpid/dotnet/client-010/wcf/model/CommunicationOperation.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidBinding.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidChannelBase.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidChannelFactory.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidChannelListener.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidChannelListenerBase.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidInputChannel.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidInputChannelBase.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidOutputChannel.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidOutputChannelBase.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidTransportBindingElement.cs delete mode 100644 qpid/dotnet/client-010/wcf/model/QpidTransportElement.cs delete mode 100644 qpid/dotnet/client-010/wcf/wcf.csproj delete mode 100644 qpid/dotnet/client-010/wcf/wcf.sln delete mode 100644 qpid/dotnet/client-010/wcf/wcf.suo delete mode 100644 qpid/dotnet/default.build delete mode 100755 qpid/ruby/LICENSE.txt delete mode 100644 qpid/ruby/Makefile delete mode 100644 qpid/ruby/NOTICE.txt delete mode 100644 qpid/ruby/README.txt delete mode 100644 qpid/ruby/RELEASE_NOTES delete mode 100644 qpid/ruby/Rakefile delete mode 100755 qpid/ruby/examples/hello-world.rb delete mode 100644 qpid/ruby/examples/qmf-libvirt.rb delete mode 100644 qpid/ruby/ext/sasl/extconf.rb delete mode 100644 qpid/ruby/ext/sasl/sasl.c delete mode 100644 qpid/ruby/lib/qpid.rb delete mode 100644 qpid/ruby/lib/qpid/assembler.rb delete mode 100644 qpid/ruby/lib/qpid/client.rb delete mode 100644 qpid/ruby/lib/qpid/codec.rb delete mode 100644 qpid/ruby/lib/qpid/codec08.rb delete mode 100644 qpid/ruby/lib/qpid/config.rb delete mode 100644 qpid/ruby/lib/qpid/connection.rb delete mode 100644 qpid/ruby/lib/qpid/connection08.rb delete mode 100644 qpid/ruby/lib/qpid/datatypes.rb delete mode 100644 qpid/ruby/lib/qpid/delegates.rb delete mode 100644 qpid/ruby/lib/qpid/fields.rb delete mode 100644 qpid/ruby/lib/qpid/framer.rb delete mode 100644 qpid/ruby/lib/qpid/invoker.rb delete mode 100644 qpid/ruby/lib/qpid/packer.rb delete mode 100644 qpid/ruby/lib/qpid/peer.rb delete mode 100644 qpid/ruby/lib/qpid/qmf.rb delete mode 100644 qpid/ruby/lib/qpid/queue.rb delete mode 100644 qpid/ruby/lib/qpid/session.rb delete mode 100644 qpid/ruby/lib/qpid/spec.rb delete mode 100644 qpid/ruby/lib/qpid/spec010.rb delete mode 100644 qpid/ruby/lib/qpid/spec08.rb delete mode 100644 qpid/ruby/lib/qpid/specs/amqp.0-10-qpid-errata.xml delete mode 100644 qpid/ruby/lib/qpid/specs/amqp.0-10.dtd delete mode 100644 qpid/ruby/lib/qpid/test.rb delete mode 100644 qpid/ruby/lib/qpid/traverse.rb delete mode 100644 qpid/ruby/lib/qpid/util.rb delete mode 100644 qpid/ruby/tests/assembler.rb delete mode 100644 qpid/ruby/tests/codec010.rb delete mode 100644 qpid/ruby/tests/connection.rb delete mode 100644 qpid/ruby/tests/datatypes.rb delete mode 100644 qpid/ruby/tests/framer.rb delete mode 100644 qpid/ruby/tests/qmf.rb delete mode 100644 qpid/ruby/tests/queue.rb delete mode 100644 qpid/ruby/tests/spec010.rb delete mode 100644 qpid/ruby/tests/util.rb delete mode 100644 qpid/ruby/tests_0-8/basic.rb delete mode 100644 qpid/ruby/tests_0-8/channel.rb diff --git a/qpid/LICENSE b/qpid/LICENSE index 5f84a6564b..cd0c8d0a8b 100644 --- a/qpid/LICENSE +++ b/qpid/LICENSE @@ -1,7 +1,5 @@ Please see the individual LICENSE files for each language cpp/LICENSE -dotnet/LICENSE.txt gentools/lib/LICENSE java/resources/LICENSE python/LICENSE.txt -ruby/LICENSE.txt diff --git a/qpid/NOTICE b/qpid/NOTICE index ff65d299a9..5691e0e1ac 100644 --- a/qpid/NOTICE +++ b/qpid/NOTICE @@ -1,8 +1,6 @@ Please see the individual NOTICE files for each language: cpp/NOTICE -dotnet/NOTICE.txt gentools/lib/NOTICE java/resources/NOTICE python/NOTICE.txt -ruby/NOTICE.txt diff --git a/qpid/README.txt b/qpid/README.txt index 00a56bdc3d..ccd92c757b 100644 --- a/qpid/README.txt +++ b/qpid/README.txt @@ -36,22 +36,10 @@ Python Client Libraries ./python -Ruby Client Libraries - - ./ruby - -.NET Client Libraries - - ./dotnet - WCF Support ./wcf -Messaging Client (implemented in Ruby): - - ./ruby - Management Tools (implemented in Python): ./tools @@ -66,4 +54,4 @@ Documentation: Further information about the organization of Qpid source components may -be found in ./doc/dev-readme/QPID-0.8-Component-README.pdf. +be found in ./doc/dev-readme/QPID-Component-README.pdf. diff --git a/qpid/dotnet/Consumer/Program.cs b/qpid/dotnet/Consumer/Program.cs deleted file mode 100644 index d9a6224a42..0000000000 --- a/qpid/dotnet/Consumer/Program.cs +++ /dev/null @@ -1,30 +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. - * - */ -namespace Consumer -{ - class Program - { - static void Main(string[] args) - { - Apache.Qpid.Client.Tests.interop.Consumer.Main(args); - } - } -} diff --git a/qpid/dotnet/Consumer/default.build b/qpid/dotnet/Consumer/default.build deleted file mode 100644 index 5b1e3166c5..0000000000 --- a/qpid/dotnet/Consumer/default.build +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/LICENSE.txt b/qpid/dotnet/LICENSE.txt deleted file mode 100644 index 981d2f83c3..0000000000 --- a/qpid/dotnet/LICENSE.txt +++ /dev/null @@ -1,757 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -========================================================================= -== Saxon XSLT License == -========================================================================= - -Mozilla Public License Version 1.0 - -1. Definitions. - - 1.1. "Contributor" means each entity that creates or contributes - to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Code, prior Modifications used by a Contributor, and the - Modifications made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications - or the combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism - generally accepted in the software development community for the - electronic transfer of data. - - 1.5. "Executable" means Covered Code in any form other than - Source Code. - - 1.6. "Initial Developer" means the individual or entity - identified as the Initial Developer in the Source Code notice required by - Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code - or portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.9. "Modifications" means any addition to or deletion from - the substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original - Code or previous Modifications. - - 1.10. "Original Code" means Source Code of computer software - code which is described in the Source Code notice required by Exhibit - A as Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.11. "Source Code" means the preferred form of the Covered - Code for making modifications to it, including all modules it contains, - plus any associated interface definition files, scripts used to control - compilation and installation of an Executable, or a list of source code - differential comparisons against either the Original Code or another well - known, available Covered Code of the Contributor's choice. The Source - Code can be in a compressed or archival form, provided the appropriate - decompression or de-archiving software is widely available for no charge. - - 1.12. "You" means an individual or a legal entity exercising - rights under, and complying with all of the terms of, this License or a - future version of this License issued under Section 6.1. For legal - entities, "You" includes any entity which controls, is controlled by, - or is under common control with You. For purposes of this definition, - "control" means (a) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or otherwise, - or (b) ownership of fifty percent (50%) or more of the outstanding shares - or beneficial ownership of such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - - - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - - (a) to use, reproduce, modify, display, perform, sublicense - and distribute the Original Code (or portions thereof) with or - without Modifications, or as part of a Larger Work; and - - (b) under patents now or hereafter owned or controlled by - Initial Developer, to make, have made, use and sell ("Utilize") the - Original Code (or portions thereof), but solely to the extent that - any such patent is reasonably necessary to enable You to Utilize the - Original Code (or portions thereof) and not to any greater extent - that may be necessary to Utilize further Modifications or - combinations. - - 2.2. Contributor Grant. - - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - - (a) to use, reproduce, modify, display, perform, sublicense and - distribute the Modifications created by such Contributor (or portions - thereof) either on an unmodified basis, with other Modifications, as - Covered Code or as part of a Larger Work; and - - (b) under patents now or hereafter owned or controlled by - Contributor, to Utilize the Contributor Version (or portions thereof), - but solely to the extent that any such patent is reasonably necessary to - enable You to Utilize the Contributor Version (or portions thereof), and - not to any greater extent that may be necessary to Utilize further - Modifications or combinations. - -3. Distribution Obligations. - - 3.1. Application of License. - - - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version of - this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this License - or the recipients' rights hereunder. However, You may include an - additional document offering the additional rights described in Section - 3.5. - - 3.2. Availability of Source Code. - - - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License either - on the same media as an Executable version or via an accepted Electronic - Distribution Mechanism to anyone to whom you made an Executable version - available; and if made available via Electronic Distribution Mechanism, - must remain available for at least twelve (12) months after the date it - initially became available, or at least six (6) months after a subsequent - version of that particular Modification has been made available to such - recipients. You are responsible for ensuring that the Source Code version - remains available even if the Electronic Distribution Mechanism is - maintained by a third party. - - 3.3. Description of Modifications. - - - You must cause all Covered Code to which you contribute to contain a - file documenting the changes You made to create that Covered Code and the - date of any change. You must include a prominent statement that the - Modification is derived, directly or indirectly, from Original Code - provided by the Initial Developer and including the name of the Initial - Developer in (a) the Source Code, and (b) in any notice in an Executable - version or related documentation in which You describe the origin or - ownership of the Covered Code. - - 3.4. Intellectual Property Matters - - (a) Third Party Claims. - - - If You have knowledge that a party claims an intellectual - property right in particular functionality or code (or its - utilization under this License), you must include a text file with - the source code distribution titled "LEGAL" which describes the - claim and the party making the claim in sufficient detail that a - recipient will know whom to contact. If you obtain such knowledge - after You make Your Modification available as described in Section - 3.2, You shall promptly modify the LEGAL file in all copies - You make available thereafter and shall take other steps (such as - notifying appropriate mailing lists or newsgroups) reasonably - calculated to inform those who received the Covered Code that new - knowledge has been obtained. - - (b) Contributor APIs. - - - If Your Modification is an application programming interface and - You own or control patents which are reasonably necessary to - implement that API, you must also include this information in the - LEGAL file. - - 3.5. Required Notices. - - - You must duplicate the notice in Exhibit A in each file of the - Source Code, and this License in any documentation for the Source Code, - where You describe recipients' rights relating to Covered Code. If You - created one or more Modification(s), You may add your name as a - Contributor to the notice described in Exhibit A. If it is not - possible to put such notice in a particular Source Code file due to its - structure, then you must include such notice in a location (such as a - relevant directory file) where a user would be likely to look for such a - notice. You may choose to offer, and to charge a fee for, warranty, - support, indemnity or liability obligations to one or more recipients of - Covered Code. However, You may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You must make it - absolutely clear than any such warranty, support, indemnity or liability - obligation is offered by You alone, and You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, support, - indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - - - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered - Code, and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, including - a description of how and where You have fulfilled the obligations of - Section 3.2. The notice must be conspicuously included in any - notice in an Executable version, related documentation or collateral in - which You describe recipients' rights relating to the Covered Code. You - may distribute the Executable version of Covered Code under a license of - Your choice, which may contain terms different from this License, - provided that You are in compliance with the terms of this License and - that the license for the Executable version does not attempt to limit or - alter the recipient's rights in the Source Code version from the rights - set forth in this License. If You distribute the Executable version under - a different license You must make it absolutely clear that any terms - which differ from this License are offered by You alone, not by the - Initial Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of any such terms You - offer. - - 3.7. Larger Works. - - - You may create a Larger Work by combining Covered Code with other - code not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to statute or - regulation then You must: (a) comply with the terms of this License to - the maximum extent possible; and (b) describe the limitations and the - code they affect. Such description must be included in the LEGAL file - described in Section 3.4 and must be included with all - distributions of the Source Code. Except to the extent prohibited by - statute or regulation, such description must be sufficiently detailed for - a recipient of ordinary skill - to be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached - the notice in Exhibit A, and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - - - Netscape Communications Corporation ("Netscape") may publish - revised and/or new versions of the License from time to time. Each - version will be given a distinguishing version number. - - 6.2. Effect of New Versions. - - - Once Covered Code has been published under a particular version of - the License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms of - any subsequent version of the License published by Netscape. No one other - than Netscape has the right to modify the terms applicable to Covered - Code created under this License. - - 6.3. Derivative Works. - - - If you create or use a modified version of this License (which you - may only do in order to apply it to code which is not already Covered - Code governed by this License), you must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "NPL" - or any confusingly similar phrase do not appear anywhere in your license - and (b) otherwise make it clear that your version of the license contains - terms which differ from the Mozilla Public License and Netscape Public - License. (Filling in the name of the Initial Developer, Original Code or - Contributor in the notice described in Exhibit A shall not of - themselves be deemed to be modifications of this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, - MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE - RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH - YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY - NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY - CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE - IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall survive - any termination of this License. Provisions which, by their nature, must - remain in effect beyond the termination of this License shall survive. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING - NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY - OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF - ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY - INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER - INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED - OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL - NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH - PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH - LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION - OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION - MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 - C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" - and "commercial computer software documentation," as such terms are - used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 - and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all - U.S. Government End Users acquire Covered Code with only those rights set - forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter - hereof. If any provision of this License is held to be unenforceable, - such provision shall be reformed only to the extent necessary to make it - enforceable. This License shall be governed by California law provisions - (except to the extent applicable law, if any, provides otherwise), - excluding its conflict-of-law provisions. With respect to disputes in - which at least one party is a citizen of, or an entity chartered or - registered to do business in, the United States of America: (a) unless - otherwise agreed in writing, all disputes relating to this License - (excepting any dispute relating to intellectual property rights) shall be - subject to final and binding arbitration, with the losing party paying - all costs of arbitration; (b) any arbitration relating to this Agreement - shall be held in Santa Clara County, California, under the auspices of - JAMS/EndDispute; and (c) any litigation relating to this Agreement shall - be subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys fees and - expenses. The application of the United Nations Convention on Contracts - for the International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall be - construed against the drafter shall not apply to this License. - -12. RESPONSIBILITY FOR CLAIMS. - - Except in cases where another Contributor has failed to comply with - Section 3.4, You are responsible for damages arising, directly or - indirectly, out of Your utilization of rights under this License, based - on the number of copies of Covered Code you made available, the revenues - you received from utilizing such rights, and other relevant factors. You - agree to work with affected parties to distribute responsibility on an - equitable basis. - -EXHIBIT A. - - "The contents of this file are subject to the Mozilla Public License - Version 1.0 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations under - the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is - ________________________. Portions created by ______________________ are - Copyright (C) ______ _______________________. All Rights Reserved. - - Contributor(s): ______________________________________." - - -========================================================================= -== Nunit License == -========================================================================= -Copyright (c) 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright (c) 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - -========================================================================= -== Mentalis Security LibraryLicense == -========================================================================= - -Source Code License - -Copyright © 2002-2007, The Mentalis.org Team -All rights reserved. -http://www.mentalis.org/ - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -- Neither the name of the Mentalis.org Team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -========================================================================= -== AMQP License == -========================================================================= - - Copyright Notice - ================ - (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., - iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc., - TWIST Process Innovations, and 29West Inc. 2006. All rights reserved. - - License - ======= - JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix - Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and - 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide, - perpetual, royalty-free, nontransferable, nonexclusive license to - (i) copy, display, and implement the Advanced Messaging Queue Protocol - ("AMQP") Specification and (ii) the Licensed Claims that are held by - the Authors, all for the purpose of implementing the Advanced Messaging - Queue Protocol Specification. Your license and any rights under this - Agreement will terminate immediately without notice from - any Author if you bring any claim, suit, demand, or action related to - the Advanced Messaging Queue Protocol Specification against any Author. - Upon termination, you shall destroy all copies of the Advanced Messaging - Queue Protocol Specification in your possession or control. - - As used hereunder, "Licensed Claims" means those claims of a patent or - patent application, throughout the world, excluding design patents and - design registrations, owned or controlled, or that can be sublicensed - without fee and in compliance with the requirements of this - Agreement, by an Author or its affiliates now or at any - future time and which would necessarily be infringed by implementation - of the Advanced Messaging Queue Protocol Specification. A claim is - necessarily infringed hereunder only when it is not possible to avoid - infringing it because there is no plausible non-infringing alternative - for implementing the required portions of the Advanced Messaging Queue - Protocol Specification. Notwithstanding the foregoing, Licensed Claims - shall not include any claims other than as set forth above even if - contained in the same patent as Licensed Claims; or that read solely - on any implementations of any portion of the Advanced Messaging Queue - Protocol Specification that are not required by the Advanced Messaging - Queue Protocol Specification, or that, if licensed, would require a - payment of royalties by the licensor to unaffiliated third parties. - Moreover, Licensed Claims shall not include (i) any enabling technologies - that may be necessary to make or use any Licensed Product but are not - themselves expressly set forth in the Advanced Messaging Queue Protocol - Specification (e.g., semiconductor manufacturing technology, compiler - technology, object oriented technology, networking technology, operating - system technology, and the like); or (ii) the implementation of other - published standards developed elsewhere and merely referred to in the - body of the Advanced Messaging Queue Protocol Specification, or - (iii) any Licensed Product and any combinations thereof the purpose or - function of which is not required for compliance with the Advanced - Messaging Queue Protocol Specification. For purposes of this definition, - the Advanced Messaging Queue Protocol Specification shall be deemed to - include both architectural and interconnection requirements essential - for interoperability and may also include supporting source code artifacts - where such architectural, interconnection requirements and source code - artifacts are expressly identified as being required or documentation to - achieve compliance with the Advanced Messaging Queue Protocol Specification. - - As used hereunder, "Licensed Products" means only those specific portions - of products (hardware, software or combinations thereof) that implement - and are compliant with all relevant portions of the Advanced Messaging - Queue Protocol Specification. - - The following disclaimers, which you hereby also acknowledge as to any - use you may make of the Advanced Messaging Queue Protocol Specification: - - THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS," - AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE - CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE - SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED - MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY - PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - - THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, - INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY - USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE - PROTOCOL SPECIFICATION. - - The name and trademarks of the Authors may NOT be used in any manner, - including advertising or publicity pertaining to the Advanced Messaging - Queue Protocol Specification or its contents without specific, written - prior permission. Title to copyright in the Advanced Messaging Queue - Protocol Specification will at all times remain with the Authors. - - No other rights are granted by implication, estoppel or otherwise. - - Upon termination of your license or rights under this Agreement, you - shall destroy all copies of the Advanced Messaging Queue Protocol - Specification in your possession or control. - - Trademarks - ========== - "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the - Octagon Symbol are trademarks of JPMorgan Chase & Co. - - IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl. - - IONA, IONA Technologies, and the IONA logos are trademarks of IONA - Technologies PLC and/or its subsidiaries. - - LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered - trademarks of Red Hat, Inc. in the US and other countries. - - Java, all Java-based trademarks and OpenOffice.org are trademarks of - Sun Microsystems, Inc. in the United States, other countries, or both. - - Other company, product, or service names may be trademarks or service - marks of others. - - Links to full AMQP specification: - ================================= - http://www.envoytech.org/spec/amq/ - http://www.iona.com/opensource/amqp/ - http://www.redhat.com/solutions/specifications/amqp/ - http://www.twiststandards.org/tiki-index.php?page=AMQ - http://www.imatix.com/amqp diff --git a/qpid/dotnet/NOTICE.txt b/qpid/dotnet/NOTICE.txt deleted file mode 100644 index 0b22ed3ab2..0000000000 --- a/qpid/dotnet/NOTICE.txt +++ /dev/null @@ -1,32 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Ant distribution. == -========================================================================= - -Apache Qpid.NET -Copyright 2006 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - -This product also includes software developed by: - - - The SAXON XSLT Processor from Michael Kay distributed under the Mozilla - Public License v1.0, which is available for download at - http://saxon.sourceforge.net/ - - - The nunit library, Copyright © 2002 James W. Newkirk, Michael C. Two, - Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig. Available - under terms based on the zlib/libpng licence. Available from - http://www.nunit.org/ - - - The Mentalis Security Library, Copyright © 2002-2006, , The Mentalis.org Team - under tterms based on the BSD license (http://www.mentalis.org/site/license.qpx). - Available from http://www.mentalis.org/soft/projects/seclib/ - -This product includes software, Apache Log4Net -(http://logging.apache.org/log4net) -License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0) - - diff --git a/qpid/dotnet/Producer/Program.cs b/qpid/dotnet/Producer/Program.cs deleted file mode 100644 index 83dbf597ed..0000000000 --- a/qpid/dotnet/Producer/Program.cs +++ /dev/null @@ -1,30 +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. - * - */ -namespace Producer -{ - class Program - { - static void Main(string[] args) - { - Apache.Qpid.Client.Tests.interop.Producer.Main(args); - } - } -} diff --git a/qpid/dotnet/Producer/default.build b/qpid/dotnet/Producer/default.build deleted file mode 100644 index 72d2a3fa8d..0000000000 --- a/qpid/dotnet/Producer/default.build +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Program.cs b/qpid/dotnet/Program.cs deleted file mode 100644 index d9a6224a42..0000000000 --- a/qpid/dotnet/Program.cs +++ /dev/null @@ -1,30 +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. - * - */ -namespace Consumer -{ - class Program - { - static void Main(string[] args) - { - Apache.Qpid.Client.Tests.interop.Consumer.Main(args); - } - } -} diff --git a/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs b/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 2f49033c2d..0000000000 --- a/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,56 +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. - * - */ - - using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.Buffer.Tests")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("Apache.Qpid.Buffer.Tests")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9d967d0b-9454-4f00-8f53-fa86fd62b696")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj b/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj deleted file mode 100644 index 72d3ccc82f..0000000000 --- a/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {74640962-99D0-4D06-B57A-9CD66517CF52} - Library - Properties - Apache.Qpid.Buffer.Tests - Apache.Qpid.Buffer.Tests - - - 2.0 - - - - - true - full - false - ..\bin\net-2.0\debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - ..\bin\net-2.0\release\ - TRACE - prompt - 4 - - - - False - ..\Qpid.Client.Tests\lib\nunit\nunit.framework.dll - - - - - - - - - - - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Qpid.Buffer - - - - - diff --git a/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs b/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs deleted file mode 100644 index b028bdb1ee..0000000000 --- a/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs +++ /dev/null @@ -1,333 +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. - * - */ - -using NUnit.Framework; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Buffer.Tests -{ - /// - /// Tests for the SimpleByteBuffer class - /// - [TestFixture] - public class SimpleByteBufferTests - { - [Test] - public void CanCreateNewBuffer() - { - const int size = 10; - ByteBuffer buffer = ByteBuffer.Allocate(size); - Assert.AreEqual(size, buffer.Capacity); - Assert.AreEqual(0, buffer.Position); - Assert.AreEqual(size, buffer.Remaining); - Assert.AreEqual(true, buffer.HasRemaining); - } - - [Test] - public void CanWrapArray() - { - byte[] array = new byte[10]; - for ( int i=0; i < array.Length; i++ ) - { - array[i] = (byte) i; - } - ByteBuffer buffer = ByteBuffer.Wrap(array); - // the buffer should be the same size, - // and positioned at the end - Assert.AreEqual(array.Length, buffer.Capacity); - Assert.AreEqual(array.Length, buffer.Position); - Assert.AreEqual(array.Length, buffer.Limit); - } - - #region Base Read/Write tests - // - // Base Read/Write tests - // - [Test] - public void CanReadWriteBytes() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Rewind(); - Assert.AreEqual(0x01, buffer.GetByte()); - Assert.AreEqual(0x02, buffer.GetByte()); - Assert.AreEqual(0x03, buffer.GetByte()); - } - - [Test] - [ExpectedException(typeof(BufferUnderflowException))] - public void ThrowOnReadByteWithNoSpace() - { - ByteBuffer buffer = ByteBuffer.Allocate(1); - buffer.Put((byte)0x01); - buffer.GetByte(); - } - - [Test] - [ExpectedException(typeof(BufferOverflowException))] - public void ThrowOnWriteByteWithNoSpace() - { - ByteBuffer buffer = ByteBuffer.Allocate(1); - buffer.Put((byte)0x01).Put((byte)0x02); - } - - #endregion Base Read/Write tests - - #region Other Buffer Operations - // - // Other Buffer Operations - // - - [Test] - public void CanFlipBuffer() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Flip(); - Assert.AreEqual(10, buffer.Capacity); - Assert.AreEqual(3, buffer.Limit); - Assert.AreEqual(0, buffer.Position); - Assert.AreEqual(3, buffer.Remaining); - } - - [Test] - public void CanCompactBuffer() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Flip(); - buffer.Position = 1; - buffer.Compact(); - Assert.AreEqual(10, buffer.Capacity); - Assert.AreEqual(10, buffer.Limit); - Assert.AreEqual(2, buffer.Position); - Assert.AreEqual(8, buffer.Remaining); - buffer.Rewind(); - Assert.AreEqual((byte)0x02, buffer.GetByte()); - Assert.AreEqual((byte)0x03, buffer.GetByte()); - } - - [Test] - public void CanClearBuffer() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Flip(); - buffer.Position = 2; - buffer.Clear(); - Assert.AreEqual(10, buffer.Capacity); - Assert.AreEqual(10, buffer.Limit); - Assert.AreEqual(0, buffer.Position); - Assert.AreEqual(10, buffer.Remaining); - } - - [Test] - public void CanExpandBuffer() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Flip(); - buffer.Position = 2; - int pos = buffer.Position; - buffer.Expand(20); - - Assert.AreEqual(pos, buffer.Position); - Assert.IsTrue(buffer.Remaining >= 20); - buffer.Rewind(); - Assert.AreEqual(0x01, buffer.GetByte()); - } - - [Test] - public void CanAutoExpand() - { - ByteBuffer buffer = ByteBuffer.Allocate(2); - buffer.IsAutoExpand = true; - // should cause autoexpand - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - Assert.IsTrue(buffer.Capacity > 2); - } - - [Test] - public void CanGetArray() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer.Flip(); - - byte[] array = buffer.Array; - for ( int i=0; i < buffer.Limit; i++ ) - { - Assert.AreEqual(buffer.GetByte(), array[i]); - } - } - - [Test] - public void CanSkip() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Skip(4); - Assert.AreEqual(4, buffer.Position); - } - - #endregion // Base Read/Write tests - - #region Typed Accessors - // - // Typed Accessors - // - [Test] - public void CanReadWriteSByte() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - sbyte value = -12; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetSByte()); - } - [Test] - public void CanReadWriteUInt16() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - ushort value = 41233; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetUInt16()); - } - [Test] - public void CanReadWriteInt16() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - short value = -21233; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetInt16()); - } - [Test] - public void CanReadWriteUInt32() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - uint value = 41233211; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetUInt32()); - } - [Test] - public void CanReadWriteInt32() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - int value = -22221233; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetInt32()); - } - [Test] - public void CanReadWriteUInt64() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - ulong value = 41233218871; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetUInt64()); - } - [Test] - public void CanReadWriteInt64() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - long value = -9887335411; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetInt64()); - } - [Test] - public void CanReadWriteFloat() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - float value = -1.2331f; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetFloat()); - } - - [Test] - public void CanReadWriteDouble() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - double value = -1.2331E12; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetDouble()); - } - - [Test] - public void CanReadWriteChar() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - char value = 'H'; - buffer.Put(value); - buffer.Flip(); - Assert.AreEqual(value, buffer.GetChar()); - } - - [Test] - public void CanReadWriteByteArray() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put(new byte[] { 0x01, 0x02, 0x03}); - buffer.Flip(); - byte[] data = new byte[3]; - buffer.GetBytes(data); - Assert.AreEqual(0x01, data[0]); - Assert.AreEqual(0x02, data[1]); - Assert.AreEqual(0x03, data[2]); - } - - [Test] - public void CanReadWriteByteArrayWithOffset() - { - ByteBuffer buffer = ByteBuffer.Allocate(10); - buffer.Put(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }, 1, 4); - buffer.Flip(); - byte[] data = new byte[3]; - buffer.GetBytes(data, 2, 1); - Assert.AreEqual(0x00, data[0]); - Assert.AreEqual(0x00, data[1]); - Assert.AreEqual(0x02, data[2]); - } - - [Test] - public void CanWriteByteBuffer() - { - ByteBuffer buffer1 = ByteBuffer.Allocate(10); - buffer1.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03); - buffer1.Flip(); - - ByteBuffer buffer2 = ByteBuffer.Allocate(10); - buffer2.Put(buffer1); - buffer2.Flip(); - Assert.AreEqual(buffer1.Limit, buffer2.Limit); - Assert.AreEqual(0x01, buffer2.GetByte()); - } - #endregion // Typed Accessors - - } // class SimpleByteBufferTests -} - - diff --git a/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs b/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs deleted file mode 100644 index 7dec7c390f..0000000000 --- a/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs +++ /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. - * - */ - -using System; -using NUnit.Framework; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Buffer.Tests -{ - /// - /// Tests for the SlicedByteBuffer class - /// - [TestFixture] - public class SlicedByteBufferTests - { - private ByteBuffer _baseBuffer; - - [SetUp] - public void Setup() - { - const int size = 50; - _baseBuffer = ByteBuffer.Allocate(size); - for ( byte b = 0; b < 10; b++ ) - { - _baseBuffer.Put(b); - } - _baseBuffer.Flip(); - } - - [Test] - public void CanSliceBuffer() - { - _baseBuffer.Position = 5; - - ByteBuffer slice = _baseBuffer.Slice(); - Assert.AreEqual(5, slice.Capacity); - Assert.AreEqual(0, slice.Position); - Assert.AreEqual(5, slice.Remaining); - Assert.AreEqual(5, slice.Limit); - } - - [Test] - public void CanReadWriteSlice() - { - _baseBuffer.Position = 5; - - ByteBuffer slice = _baseBuffer.Slice(); - slice.Put((byte) 0xFF).Put((byte) 0xF0).Put((byte) 0xA0); - slice.Flip(); - - Assert.AreEqual(3, slice.Limit); - Assert.AreEqual(0xFF, slice.GetByte()); - Assert.AreEqual(0xF0, slice.GetByte()); - Assert.AreEqual(0xA0, slice.GetByte()); - } - - [Test] - public void WriteModifiesBaseBufferOnCorrectPosition() - { - _baseBuffer.Position = 5; - - ByteBuffer slice = _baseBuffer.Slice(); - slice.Put((byte) 0xFF); - slice.Flip(); - // reading the _baseBuffer at position 5 should yield 0xFF - _baseBuffer.Position = 5; - Assert.AreEqual(0xFF, _baseBuffer.GetByte()); - - } - - [Test] - public void CanReadWriteByteArray() - { - _baseBuffer.Position = 5; - - ByteBuffer slice = _baseBuffer.Slice(); - byte[] data = {0xFF, 0xF0, 0xF2, 0xEE, 0x23}; - slice.Put(data, 2, 2); - slice.Flip(); - - Assert.AreEqual(2, slice.Limit); - Assert.AreEqual(0xF2, slice.GetByte()); - Assert.AreEqual(0xEE, slice.GetByte()); - } - - [Test] - [ExpectedException(typeof(BufferOverflowException))] - public void ThrowWhenWritePastLimit() - { - _baseBuffer.Position = 5; - - ByteBuffer slice = _baseBuffer.Slice(); - slice.Put(0x01).Put(0x02); - } - - - [Test] - [ExpectedException(typeof(NotSupportedException))] - public void ThrowOnCompact() - { - // we don't support compacting - ByteBuffer slice = _baseBuffer.Slice(); - slice.Compact(); - } - - [Test] - [ExpectedException(typeof(NotSupportedException))] - public void ThrowOnResize() - { - // we don't support resizing - ByteBuffer slice = _baseBuffer.Slice(); - slice.Expand(50); - } - } // class SlicedByteBufferTests -} diff --git a/qpid/dotnet/Qpid.Buffer.Tests/default.build b/qpid/dotnet/Qpid.Buffer.Tests/default.build deleted file mode 100644 index 77e95fb9d9..0000000000 --- a/qpid/dotnet/Qpid.Buffer.Tests/default.build +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs b/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs deleted file mode 100644 index 5a2fff74a7..0000000000 --- a/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs +++ /dev/null @@ -1,41 +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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Buffer -{ - [Serializable] - public class BufferOverflowException : Exception - { - public BufferOverflowException(string message) : base(message) - { - } - - protected BufferOverflowException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs b/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs deleted file mode 100644 index 13939b77a8..0000000000 --- a/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs +++ /dev/null @@ -1,42 +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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Buffer -{ - [Serializable] - public class BufferUnderflowException : Exception - { - public BufferUnderflowException(string message) - : base(message) - { - } - - protected BufferUnderflowException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs b/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs deleted file mode 100644 index 67f0edd440..0000000000 --- a/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs +++ /dev/null @@ -1,982 +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. - * - */ -using System; - -namespace Apache.Qpid.Buffer -{ - /// - /// Abstract class implementing a byte buffer - /// - public abstract class ByteBuffer - { - private int _position; - private int _limit; - private bool _isAutoExpand; - private static IByteBufferAllocator _allocator = - new SimpleByteBufferAllocator(); - - #region Properties - // - // Properties - // - - /// - /// The maximum number of bytes the buffer can hold - /// - public abstract int Capacity - { - get; - } - - /// - /// Return the backing array of this buffer - /// - public abstract byte[] Array - { - get; - } - - /// - /// The current position inside this buffer - /// - public int Position - { - get { return _position; } - set { Seek(value); } - } - - /// - /// Index of the first element that should not be read or written. - /// A buffer's limit is never negative and is never greater than the its capacity. - /// - public int Limit - { - get { return _limit; } - set { SetLimit(value); } - } - - /// - /// Number of bytes remaining in the buffer from the current position - /// - public int Remaining - { - get { return Limit - Position; } - } - - /// - /// True if there are bytes remaining in the buffer - /// - public bool HasRemaining - { - get { return Remaining > 0; } - } - - /// - /// If true, the buffer will be resized as necessary - /// to allow space for writing. By default is false. - /// - public bool IsAutoExpand - { - get { return _isAutoExpand; } - set { _isAutoExpand = value; } - } - - #endregion // Properties - - #region Buffer Manipulation - // - // Buffer Manipulation - // - - /// - /// Move the buffer to Position 0 - /// - /// This instance - public ByteBuffer Rewind() - { - Seek(0); - return this; - } - - /// - /// Prepare the buffer to read back what's been written - /// - /// This instance - public ByteBuffer Flip() - { - Limit = Position; - Position = 0; - return this; - } - - /// - /// Compact this buffer. - /// - /// This instance - /// - /// The bytes between the buffer's current position and its limit, if any, - /// are copied to the beginning of the buffer. - /// - public ByteBuffer Compact() - { - DoCompact(); - return this; - } - - /// - /// Clears this buffer. The position is set to zero, the limit is set to the capacity - /// - /// This instance - public ByteBuffer Clear() - { - Limit = Capacity; - Position = 0; - return this; - } - - /// - /// Expands this buffer's capacity so that - /// Remaining == expectedRemaining - /// - /// Number of bytes that should be accessable after resizing - /// This instance - public ByteBuffer Expand(int expectedRemaining) - { - return Expand(Position, expectedRemaining); - } - - /// - /// Expands this buffer's capacity so that - /// Remaining == expectedRemaining - /// - /// Position from which to start the resize - /// Number of bytes that should be accessable after resizing - /// This instance - public ByteBuffer Expand(int position, int expectedRemaining) - { - if ( expectedRemaining <= 0 ) - throw new ArgumentException("expectedRemaining must be greater than 0"); - - int end = position + expectedRemaining; - if ( end > Capacity ) - { - DoResize(end); - } - if ( end > Limit ) - Limit = end; - return this; - } - - /// - /// Creates a new byte buffer whose content is a shared - /// subsequence of this buffer's content. - /// - /// - /// The content of the new buffer will start at this buffer's current position. - /// Changes to this buffer's content will be visible in the new buffer, - /// and vice versa; the two buffers' position and limit values will be independent. - /// - /// The new buffer's position will be zero, its capacity and its limit will - /// be the number of bytes remaining in this buffer. - /// - /// - /// A view on top of this instance - public ByteBuffer Slice() - { - return new SlicedByteBuffer(this); - } - - /// - /// Skip the specified number of bytes - /// - /// Number of bytes to move forward by - /// This instance - public ByteBuffer Skip(int numBytes) - { - Position += numBytes; - return this; - } - - /// - /// Acquire this buffer to keep it alive. - /// - public virtual void Acquire() - { - // override in subclass if supported - } - - /// - /// Release this buffer instance - /// - public virtual void Release() - { - // override in subclass if supported - } - - /// - /// Return a string with a Hex Dump of this buffer's contents - /// - /// The hex dump - public string GetHexDump() - { - return ByteBufferHexDumper.GetHexDump(this); - } - - public override string ToString() - { - return GetHexDump(); - } - #endregion // Buffer Manipulation - - #region Static Operations - // - // Static Operations - // - /// - /// Replaces the default allocator with your own implementation - /// - /// New allocator - public static void SetAllocator(IByteBufferAllocator allocator) - { - if ( allocator == null ) - throw new ArgumentNullException("allocator"); - _allocator = allocator; - } - - /// - /// Allocate a new buffer with the specified capacity - /// using the default allocator - /// - /// Desired capacity - /// The new buffer - public static ByteBuffer Allocate(int capacity) - { - return _allocator.Allocate(capacity); - } - - /// - /// Wraps the specified arrat into a new buffer - /// - /// - /// - public static ByteBuffer Wrap(byte[] buffer) - { - return _allocator.Wrap(buffer); - } - #endregion // Static Operations - - #region Data Accessors - // - // Data Accessors - // - - // Byte Stuff - - /// - /// Read the next byte in the buffer - /// - /// The next byte available - public byte GetByte() - { - byte value = GetByte(Position); - Position += 1; - return value; - } - /// - /// Read the byte at the specified position - /// - /// Position to read from - /// The value at the position - public byte GetByte(int position) - { - CheckSpaceForReading(position, 1); - return ReadByte(position); - } - /// - /// Write a byte at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(byte value) - { - Put(Position, value); - Position++; - return this; - } - /// - /// Write a byte at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, byte value) - { - CheckSpaceForWriting(position, 1); - Write(position, value); - return this; - } - - // SByte Stuff - - /// - /// Read the next signed byte in the buffer - /// - /// The next signed byte available - public sbyte GetSByte() - { - sbyte value = GetSByte(Position); - Position += 1; - return value; - } - /// - /// Read the signed byte at the specified position - /// - /// Position to read from - /// The value at the position - public sbyte GetSByte(int position) - { - CheckSpaceForReading(position, 1); - return (sbyte)ReadByte(position); - } - - /// - /// Write a signed byte at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(sbyte value) - { - Put(Position, value); - Position += 1; - return this; - } - - /// - /// Write a signed byte at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, sbyte value) - { - CheckSpaceForWriting(position, 1); - Write(position, (byte)value); - return this; - } - - // UInt16 Stuff - - /// - /// Read the next uint16 in the buffer - /// - /// The next uint16 available - public ushort GetUInt16() - { - ushort value = GetUInt16(Position); - Position += 2; - return value; - } - /// - /// Read the uint16 at the specified position - /// - /// Position to read from - /// The value at the position - public ushort GetUInt16(int position) - { - CheckSpaceForReading(position, 2); - byte upper = ReadByte(position); - byte lower = ReadByte(position+1); - return (ushort)(((ushort)upper << 8) + lower); - } - - /// - /// Write a uint16 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(ushort value) - { - Put(Position, value); - Position += 2; - return this; - } - - /// - /// Write a uint16 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, ushort value) - { - CheckSpaceForWriting(position, 2); - Write(position, (byte)(value >> 8)); - Write(position+1, (byte)(value)); - return this; - } - - // Int16 Stuff - - /// - /// Read the next int16 in the buffer - /// - /// The next int16 available - public short GetInt16() - { - return (short) GetUInt16(); - } - /// - /// Read the int16 at the specified position - /// - /// Position to read from - /// The value at the position - public short GetInt16(int position) - { - return (short)GetUInt16(position); - } - - /// - /// Write a int16 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(short value) - { - return Put((ushort) value); - } - - /// - /// Write a int16 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, short value) - { - return Put(position, (ushort)value); - } - - - // UInt32 Stuff - - /// - /// Read the next uint32 in the buffer - /// - /// The next uint32 available - public uint GetUInt32() - { - uint value = GetUInt32(Position); - Position += 4; - return value; - } - /// - /// Read the uint32 at the specified position - /// - /// Position to read from - /// The value at the position - public uint GetUInt32(int position) - { - CheckSpaceForReading(position, 4); - byte b1 = ReadByte(position); - byte b2 = ReadByte(position + 1); - byte b3 = ReadByte(position + 2); - byte b4 = ReadByte(position + 3); - return (uint)((b1 << 24) + (b2 << 16) + (b3 << 8) + b4); - } - - /// - /// Write a uint32 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(uint value) - { - Put(Position, value); - Position += 4; - return this; - } - - /// - /// Write a uint32 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, uint value) - { - CheckSpaceForWriting(position, 4); - Write(position, (byte)(value >> 24)); - Write(position + 1, (byte)(value >> 16)); - Write(position + 2, (byte)(value >> 8)); - Write(position + 3, (byte)(value)); - return this; - } - - // Int32 Stuff - - /// - /// Read the next int32 in the buffer - /// - /// The next int32 available - public int GetInt32() - { - return (int)GetUInt32(); - } - /// - /// Read the int32 at the specified position - /// - /// Position to read from - /// The value at the position - public int GetInt32(int position) - { - return (int)GetUInt32(position); - } - - /// - /// Write a int32 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(int value) - { - return Put((uint)value); - } - - /// - /// Write a int32 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, int value) - { - return Put(position, (uint)value); - } - - // UInt64 Stuff - - /// - /// Read the next uint64 in the buffer - /// - /// The next uint64 available - public ulong GetUInt64() - { - ulong value = GetUInt64(Position); - Position += 8; - return value; - } - /// - /// Read the uint64 at the specified position - /// - /// Position to read from - /// The value at the position - public ulong GetUInt64(int position) - { - CheckSpaceForReading(position, 8); - byte b1 = ReadByte(position); - byte b2 = ReadByte(position + 1); - byte b3 = ReadByte(position + 2); - byte b4 = ReadByte(position + 3); - byte b5 = ReadByte(position + 4); - byte b6 = ReadByte(position + 5); - byte b7 = ReadByte(position + 6); - byte b8 = ReadByte(position + 7); - // all the casts necessary because otherwise each subexpression - // only gets promoted to uint and cause incorrect results - return (((ulong)b1 << 56) + ((ulong)b2 << 48) + ((ulong)b3 << 40) + - ((ulong)b4 << 32) + ((ulong)b5 << 24) + - ((ulong)b6 << 16) + ((ulong)b7 << 8) + b8); - } - - /// - /// Write a uint64 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(ulong value) - { - Put(Position, value); - Position += 8; - return this; - } - - /// - /// Write a uint64 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, ulong value) - { - CheckSpaceForWriting(position, 8); - Write(position, (byte)(value >> 56)); - Write(position + 1, (byte)(value >> 48)); - Write(position + 2, (byte)(value >> 40)); - Write(position + 3, (byte)(value >> 32)); - Write(position + 4, (byte)(value >> 24)); - Write(position + 5, (byte)(value >> 16)); - Write(position + 6, (byte)(value >> 8)); - Write(position + 7, (byte)(value)); - return this; - } - - // Int64 Stuff - - /// - /// Read the next int64 in the buffer - /// - /// The next int64 available - public long GetInt64() - { - return (long)GetUInt64(); - } - /// - /// Read the int64 at the specified position - /// - /// Position to read from - /// The value at the position - public long GetInt64(int position) - { - return (long)GetUInt64(position); - } - - /// - /// Write a int64 at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(long value) - { - return Put((ulong)value); - } - - /// - /// Write a int64 at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, long value) - { - return Put(position, (ulong)value); - } - - - // Float Stuff - - /// - /// Read the next float in the buffer - /// - /// The next float available - public float GetFloat() - { - unsafe - { - uint val = GetUInt32(); - return *((float*)&val); - } - } - /// - /// Read the float at the specified position - /// - /// Position to read from - /// The value at the position - public float GetFloat(int position) - { - unsafe - { - uint val = GetUInt32(position); - return *((float*)&val); - } - } - - /// - /// Write a float at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(float value) - { - unsafe - { - uint val = *((uint*)&value); - return Put(val); - } - } - - /// - /// Write a float at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, float value) - { - unsafe - { - uint val = *((uint*)&value); - return Put(position, val); - } - } - - // Double Stuff - - /// - /// Read the next double in the buffer - /// - /// The next double available - public double GetDouble() - { - unsafe - { - ulong val = GetUInt64(); - return *((double*)&val); - } - } - /// - /// Read the double at the specified position - /// - /// Position to read from - /// The value at the position - public double GetDouble(int position) - { - unsafe - { - ulong val = GetUInt64(position); - return *((double*)&val); - } - } - - /// - /// Write a double at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(double value) - { - unsafe - { - ulong val = *((ulong*)&value); - return Put(val); - } - } - - /// - /// Write a double at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, double value) - { - unsafe - { - ulong val = *((ulong*)&value); - return Put(position, val); - } - } - - // Char Stuff - - /// - /// Read the next char in the buffer - /// - /// The next char available - public char GetChar() - { - return (char)GetUInt16(); - } - /// - /// Read the char at the specified position - /// - /// Position to read from - /// The value at the position - public char GetChar(int position) - { - return (char)GetUInt16(position); - } - - /// - /// Write a char at the current position - /// - /// Value to write - /// This instance - public ByteBuffer Put(char value) - { - return Put((ushort) value); - } - - /// - /// Write a char at the specified position - /// - /// Position to write to - /// Value to write - /// This instance - public ByteBuffer Put(int position, char value) - { - return Put(position, (ushort)value); - } - - // Byte[] stuff - - public void GetBytes(byte[] buffer) - { - GetBytes(buffer, 0, buffer.Length); - } - - public void GetBytes(byte[] buffer, int offset, int length) - { - GetBytes(Position, buffer, offset, length); - Position += length; - } - public void GetBytes(int position, byte[] buffer, int offset, int length) - { - CheckSpaceForReading(position, length); - if ( offset + length > buffer.Length ) - throw new ArgumentException("Invalid offset + length"); - ReadBytes(position, buffer, offset, length); - } - - public ByteBuffer Put(byte[] buffer) - { - return Put(buffer, 0, buffer.Length); - } - - public ByteBuffer Put(byte[] buffer, int offset, int length) - { - Put(Position, buffer, offset, length); - Position += length; - return this; - } - - public ByteBuffer Put(int position, byte[] buffer, int offset, int length) - { - CheckSpaceForWriting(position, length); - if ( offset + length > buffer.Length ) - throw new ArgumentException("Invalid offset + length"); - - Write(position, buffer, offset, length); - return this; - } - - public ByteBuffer Put(ByteBuffer data) - { - Put(Position, data); - Position += data.Remaining; - return this; - } - - public ByteBuffer Put(int position, ByteBuffer data) - { - CheckSpaceForWriting(position, data.Remaining); - Write(position, data.Array, data.Position, data.Remaining); - return this; - } - - #endregion // Data Accessors - - #region Core Overrides - // - // Core Overrides - // - - protected abstract void DoWrite(int position, byte value); - protected abstract void DoWrite(int position, byte[] src, int offset, int length); - protected abstract byte DoReadByte(int position); - protected abstract void DoReadBytes(int position, byte[] dest, int offset, int length); - protected abstract void DoCompact(); - protected abstract void DoResize(int newSize); - - #endregion // Core Overrides - - #region Private Methods - // - // Private Methods - // - - private void Seek(int offset) - { - if ( offset > Capacity ) - throw new ArgumentException("Cannot position beyond end of buffer"); - _position = offset; - AdjustLimit(); - } - - private void SetLimit(int newLimit) - { - if ( newLimit < 0 ) - throw new ArgumentOutOfRangeException("The new limit must be a positive value"); - if ( newLimit > Capacity ) - throw new ArgumentOutOfRangeException("The new limit must not be greater than the capacity"); - _limit = newLimit; - if ( _position > newLimit ) - _position = newLimit; - } - - private void AdjustLimit() - { - if ( _limit < _position ) - _limit = _position; - } - - private void CheckSpaceForReading(int position, int length) - { - if ( position + length > Limit ) - { - throw new BufferUnderflowException("Attempt to read " + length + " byte(s) to buffer where position is " + position + - " and limit is " + Limit); - } - } - - private void CheckSpaceForWriting(int position, int length) - { - if ( IsAutoExpand ) - { - Expand(position, length); - } - if ( position + length > Limit ) - { - throw new BufferOverflowException("Attempt to write " + length + " byte(s) to buffer where position is " + position + - " and limit is " + Limit); - } - } - - private void Write(int position, byte value) - { - DoWrite(position, value); - } - private void Write(int position, byte[] src, int offset, int length) - { - DoWrite(position, src, offset, length); - } - private byte ReadByte(int position) - { - return DoReadByte(position); - } - private void ReadBytes(int position, byte[] dest, int offset, int length) - { - DoReadBytes(position, dest, offset, length); - } - - #endregion // Private Methods - - } // class ByteBuffer -} diff --git a/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs b/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs deleted file mode 100644 index 4c2856c333..0000000000 --- a/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs +++ /dev/null @@ -1,79 +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. - * - */ -using System.Text; - -namespace Apache.Qpid.Buffer -{ - public class ByteBufferHexDumper - { - private static byte[] highDigits; - - private static byte[] lowDigits; - - static ByteBufferHexDumper() - { - byte[] digits = { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', - (byte)'7', (byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C', (byte)'D', - (byte)'E', (byte)'F' }; - int i; - byte[] high = new byte[256]; - byte[] low = new byte[256]; - - for (i = 0; i < 256; i++) - { - high[i] = digits[i >> 4]; - low[i] = digits[i & 0x0F]; - } - - highDigits = high; - lowDigits = low; - } - - public static string GetHexDump(ByteBuffer input) - { - int size = input.Remaining; - if (size == 0) - { - return "empty"; - } - - StringBuilder output = new StringBuilder(size * 3 - 1); - - byte[] data = input.Array; - int byteValue = data[0] & 0xFF; - output.Append((char) highDigits[byteValue]); - output.Append((char) lowDigits[byteValue]); - - for (int i = 1 ; i < size; i++) - { - output.Append(' '); - byteValue = data[i] & 0xFF; - output.Append((char) highDigits[byteValue]); - output.Append((char) lowDigits[byteValue]); - } - - return output.ToString(); - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs b/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs deleted file mode 100644 index 74944f7e69..0000000000 --- a/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs +++ /dev/null @@ -1,50 +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. - * - */ - -using System; - -namespace Apache.Qpid.Buffer -{ - /// - /// Allocates 's and manages them. Please - /// implement this interface if you need more advanced memory management scheme - /// - public interface IByteBufferAllocator : IDisposable - { - /// - /// Returns the buffer which is capable of the specified size. - /// - /// The capacity of the buffer - /// A new buffer - ByteBuffer Allocate(int capacity); - - /// - /// Wrap the specified byte array in a new buffer - /// - /// Source array - /// A new buffer - ByteBuffer Wrap(byte[] src); - - } // interface IByteBufferAllocator -} - - - diff --git a/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs b/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs deleted file mode 100644 index b692af7ce5..0000000000 --- a/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +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. - * - */ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.ByteBuffer")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("Apache.Qpid.ByteBuffer")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2b3333e5-03b5-4f00-9215-66009f8a5c47")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj b/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj deleted file mode 100644 index d13f399196..0000000000 --- a/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Library - Properties - Apache.Qpid.Buffer - Apache.Qpid.Buffer - true - - - - - 2.0 - - - - - true - full - false - ..\bin\net-2.0\debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - ..\bin\net-2.0\release\ - TRACE - prompt - 4 - true - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs b/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs deleted file mode 100644 index 956c59aa45..0000000000 --- a/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs +++ /dev/null @@ -1,120 +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. - * - */ -using System; - -namespace Apache.Qpid.Buffer -{ - internal sealed class SimpleByteBuffer : ByteBuffer - { - private byte[] _buffer; - - public override int Capacity - { - get { return _buffer.Length; } - } - - public override byte[] Array - { - get { return _buffer; } - } - - /// - /// Initialize a new instance with the desired size - /// - /// Initial Length of the array - internal SimpleByteBuffer(int desiredSize) - { - _buffer = new byte[desiredSize]; - Position = 0; - Limit = Capacity; - } - - /// - /// Initialize a new instance with the data from - /// an underlying array - /// - /// Initial data - /// The original array is copied during construction and is not modified - internal SimpleByteBuffer(byte[] buffer) - { - _buffer = (byte[])buffer.Clone(); - // position at end - Position = Limit = Capacity; - } - - protected override void DoWrite(int position, byte value) - { - // available space is already handled by base class - _buffer[position] = value; - } - - protected override void DoWrite(int position, byte[] src, int offset, int length) - { - // available space is already handled by base class - for ( int i = 0; i < length; i++ ) - { - _buffer[position+i] = src[offset+i]; - } - } - - protected override byte DoReadByte(int position) - { - return _buffer[position]; - } - - protected override void DoReadBytes(int position, byte[] dest, int offset, int length) - { - System.Array.Copy(_buffer, position, dest, offset, length); - } - - protected override void DoCompact() - { - if ( Remaining > 0 ) - { - if ( Position > 0 ) - { - System.Array.Copy(_buffer, Position, _buffer, 0, Remaining); - } - Position = Remaining; - } else - { - Position = 0; - } - Limit = Capacity; - } - - protected override void DoResize(int newSize) - { - if ( newSize < Capacity ) - throw new NotSupportedException("Cannot resize a buffer to make it smaller"); - - int newCapacity = 1; - while ( newCapacity < newSize ) - { - newCapacity <<= 1; - } - - byte[] newBuffer = new byte[newCapacity]; - System.Array.Copy(_buffer, newBuffer, _buffer.Length); - _buffer = newBuffer; - } - } // class SimpleByteBuffer -} diff --git a/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs b/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs deleted file mode 100644 index e772e59ae3..0000000000 --- a/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs +++ /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. - * - */ - -namespace Apache.Qpid.Buffer -{ - /// - /// Allocates 's and manages them. - /// This is a simple implementation that just returns buffers - /// as they are. Buffers are not reused or refcounted - /// - public class SimpleByteBufferAllocator : IByteBufferAllocator - { - #region IByteBufferAllocator Members - - public ByteBuffer Allocate(int capacity) - { - return new SimpleByteBuffer(capacity); - } - - public ByteBuffer Wrap(byte[] src) - { - return new SimpleByteBuffer(src); - } - - #endregion - - #region IDisposable Members - - public void Dispose() - { - // no need to do anaything - } - - #endregion - - } // class SimpleByteBufferAllocator -} - - - diff --git a/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs b/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs deleted file mode 100644 index 890e2a3c7a..0000000000 --- a/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs +++ /dev/null @@ -1,86 +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. - * - */ -using System; - -namespace Apache.Qpid.Buffer -{ - internal sealed class SlicedByteBuffer : ByteBuffer - { - private ByteBuffer _buffer; - private int _capacity; - private int _startPos; - - public override int Capacity - { - get { return _capacity; } - } - - public override byte[] Array - { - get { return _buffer.Array; } - } - - /// - /// Initialize a new instance - /// - /// Underlying byte buffer - internal SlicedByteBuffer(ByteBuffer buffer) - { - _buffer = buffer; - _startPos = buffer.Position; - Position = 0; - _capacity = buffer.Remaining; - Limit = Capacity; - // cannot autoexpand - IsAutoExpand = false; - } - - protected override void DoWrite(int position, byte value) - { - _buffer.Put(_startPos + position, value); - } - - protected override void DoWrite(int position, byte[] src, int offset, int length) - { - _buffer.Put(_startPos + position, src, offset, length); - } - - protected override byte DoReadByte(int position) - { - return _buffer.GetByte(_startPos + position); - } - - protected override void DoReadBytes(int position, byte[] dest, int offset, int length) - { - _buffer.GetBytes(_startPos + position, dest, offset, length); - } - - protected override void DoCompact() - { - throw new NotSupportedException(); - } - - protected override void DoResize(int newSize) - { - throw new NotSupportedException(); - } - } // class SlicedByteBuffer -} diff --git a/qpid/dotnet/Qpid.Buffer/default.build b/qpid/dotnet/Qpid.Buffer/default.build deleted file mode 100644 index efb5a8fc89..0000000000 --- a/qpid/dotnet/Qpid.Buffer/default.build +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Client.Tests/App.config b/qpid/dotnet/Qpid.Client.Tests/App.config deleted file mode 100644 index e71a468a3a..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/App.config +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -
- - - - - - - - diff --git a/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs b/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs deleted file mode 100644 index 56269c0f9d..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs +++ /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. - * - */ -using System; -using System.Net; -using NUnit.Framework; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Tests.BrokerDetails -{ - [TestFixture] - public class BrokerDetailsTest - { - - [Test] - public void ValidateBrokerInfoEqualsMethod() - { - AmqBrokerInfo broker = new AmqBrokerInfo("amqp", "localhost", 5672, true); - AmqBrokerInfo broker1 = new AmqBrokerInfo("Amqp", "localhost", 5672, true); - - Assert.IsTrue(broker.Equals(broker1),"The two AmqBrokerInfo objects are not equals"); - Console.WriteLine(string.Format("The object broker: {0} and broker1: {1} are equals", broker, broker1)); - } - - [Test] - public void ValidateBrokerInfoWithDifferentSSL() - { - AmqBrokerInfo broker = new AmqBrokerInfo("amqp", "localhost", 5672, true); - AmqBrokerInfo broker1 = new AmqBrokerInfo("amqp", "localhost", 5672, false); - - Assert.IsFalse(broker.Equals(broker1), "The two AmqBrokerInfo objects are equals"); - Console.WriteLine(string.Format("The object broker: {0} and broker1: {1} are not equals", broker, broker1)); - } - - [Test] - public void ValidateBrokerInfoFromToString() - { - String url = "tcp://localhost:5672?timeout='200',immediatedelivery='true'"; - - AmqBrokerInfo broker = new AmqBrokerInfo(url); - AmqBrokerInfo broker1 = new AmqBrokerInfo(broker.ToString()); - - Assert.AreEqual(broker.GetOption("timeout"), broker1.GetOption("timeout")); - Assert.AreEqual(broker.GetOption("immediatedelivery"), broker1.GetOption("immediatedelivery")); - } - - } -} diff --git a/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs b/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs deleted file mode 100644 index f4f217c2a0..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs +++ /dev/null @@ -1,79 +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. - * - */ - -using System; - -using log4net; -using NUnit.Framework; -using Apache.Qpid.Client; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client.Tests.Channel -{ - /// - /// Test that channels can create messages correctly - /// - [TestFixture] - public class ChannelMessageCreationTests - { - [Test] - public void CanCreateTextMessage() - { - IChannel channel = AmqChannel.CreateDisconnectedChannel(); - ITextMessage msg = channel.CreateTextMessage(); - Assert.IsNotNull(msg); - } - [Test] - public void CanCreateTextMessageWithContent() - { - IChannel channel = AmqChannel.CreateDisconnectedChannel(); - const string CONTENT = "1234567890"; - ITextMessage msg = channel.CreateTextMessage(CONTENT); - Assert.IsNotNull(msg); - Assert.AreEqual(CONTENT, msg.Text); - } - [Test] - public void CanCreateBytesMessage() - { - IChannel channel = AmqChannel.CreateDisconnectedChannel(); - IBytesMessage msg = channel.CreateBytesMessage(); - Assert.IsNotNull(msg); - } - [Test] - public void CanCreateMessage() - { - IChannel channel = AmqChannel.CreateDisconnectedChannel(); - IMessage msg = channel.CreateMessage(); - Assert.IsNotNull(msg); - } - [Test] - public void CanCreateMessageFromMimeType() - { - IChannel channel = AmqChannel.CreateDisconnectedChannel(); - IMessage msg = channel.CreateMessage("text/xml"); - Assert.IsNotNull(msg); - Assert.IsInstanceOfType(typeof(ITextMessage), msg); - } - } -} // namespace Apache.Qpid.Client.Tests.Channel - - diff --git a/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs b/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs deleted file mode 100644 index 4db3c91cb5..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs +++ /dev/null @@ -1,114 +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. - * - */ - -using System; - -using log4net; -using NUnit.Framework; -using Apache.Qpid.Messaging; -using Apache.Qpid.Client.Message; - -namespace Apache.Qpid.Client.Tests.Messages -{ - /// - /// Ensure a factory creates messages correctly - /// - [TestFixture] - public class MessageFactoryRegistryTests - { - const string TEXT_PLAIN = "text/plain"; - const string TEXT_XML = "text/xml"; - const string OCTET_STREAM = "application/octet-stream"; - - /// - /// Check default registry can create text/plain messages - /// - [Test] - public void CanCreateTextPlain() - { - MessageFactoryRegistry registry = - MessageFactoryRegistry.NewDefaultRegistry(); - - IMessage message = registry.CreateMessage(TEXT_PLAIN); - Assert.IsNotNull(message); - Assert.AreEqual(TEXT_PLAIN, message.ContentType); - Assert.IsInstanceOfType(typeof(QpidTextMessage), message); - } - /// - /// Check default registry can create text/xml messages - /// - [Test] - public void CanCreateTextXml() - { - MessageFactoryRegistry registry = - MessageFactoryRegistry.NewDefaultRegistry(); - - IMessage message = registry.CreateMessage(TEXT_XML); - Assert.IsNotNull(message); - Assert.AreEqual(TEXT_XML, message.ContentType); - Assert.IsInstanceOfType(typeof(QpidTextMessage), message); - } - /// - /// Check default registry can create application/octet-stream messages - /// - [Test] - public void CanCreateBinary() - { - MessageFactoryRegistry registry = - MessageFactoryRegistry.NewDefaultRegistry(); - - IMessage message = registry.CreateMessage(OCTET_STREAM); - Assert.IsNotNull(message); - Assert.AreEqual(OCTET_STREAM, message.ContentType); - Assert.IsInstanceOfType(typeof(QpidBytesMessage), message); - } - /// - /// Check default registry can create messages for unknown types - /// - [Test] - public void CanCreateUnknownType() - { - MessageFactoryRegistry registry = - MessageFactoryRegistry.NewDefaultRegistry(); - - const string OTHER = "application/unknown"; - IMessage message = registry.CreateMessage(OTHER); - Assert.IsNotNull(message); - Assert.AreEqual(OTHER, message.ContentType); - Assert.IsInstanceOfType(typeof(QpidBytesMessage), message); - } - /// - /// Check that text messages default to UTF-8 encoding - /// - [Test] - public void TextMessagesDefaultToUTF8Encoding() - { - MessageFactoryRegistry registry = - MessageFactoryRegistry.NewDefaultRegistry(); - - IMessage message = registry.CreateMessage(TEXT_PLAIN); - Assert.AreEqual("utf-8", message.ContentEncoding.ToLower()); - } - - } -} // namespace Apache.Qpid.Client.Tests.Messages - - diff --git a/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs b/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index c710818053..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +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. - * - */ -using System.Reflection; -using System.Runtime.InteropServices; -using log4net.Config; -[assembly: XmlConfigurator(ConfigFile="log4net.config")] - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.Client.Tests")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("Apache.Qpid.Client.Tests")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7ebdea21-1352-4673-b66e-fdc0beff461f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("0.5.0.0")] diff --git a/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj b/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj deleted file mode 100644 index 73eabfa1f8..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D} - Library - Properties - Apache.Qpid.Client.Tests - Apache.Qpid.Client.Tests - - - - - 2.0 - - - http://localhost/Apache.Qpid.Client.Tests/ - true - Web - true - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - true - false - true - - - true - full - false - ..\bin\net-2.0\debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - ..\bin\net-2.0\release\ - TRACE - prompt - 4 - - - - False - ..\Qpid.Common\lib\log4net\log4net.dll - - - False - lib\nunit\nunit.framework.dll - - - - - - - - - - - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Qpid.Buffer - - - {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07} - Qpid.Messaging - - - {68987C05-3768-452C-A6FC-6BA1D372852F} - Qpid.Client - - - {77064C42-24D2-4CEB-9EA2-0EF481A43205} - Qpid.Common - - - {1465B0EE-6452-42A6-AB73-B2F9EABEEE75} - Qpid.Sasl - - - - - PreserveNewest - - - - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - diff --git a/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs b/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs deleted file mode 100644 index f1446a9aa6..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs +++ /dev/null @@ -1,66 +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. - * - */ -using System; -using NUnit.Framework; -using Apache.Qpid.Client.Security; - - -namespace Apache.Qpid.Client.Tests.Security -{ - [TestFixture] - public class CallbackRegistryHandlerTests - { - [Test] - public void ParsesConfiguration() - { - CallbackHandlerRegistry registry = CallbackHandlerRegistry.Instance; - Assert.AreEqual(4, registry.Mechanisms.Length); - Assert.Contains("TEST", registry.Mechanisms); - - Type handlerType = registry.GetCallbackHandler("TEST"); - Assert.IsNotNull(handlerType); - Assert.AreEqual(typeof(TestCallbackHandler), handlerType); - } - - [Test] - public void MechanimsInOrder() - { - CallbackHandlerRegistry registry = CallbackHandlerRegistry.Instance; - Assert.AreEqual(4, registry.Mechanisms.Length); - Assert.AreEqual("TEST", registry.Mechanisms[0]); - Assert.AreEqual("EXTERNAL", registry.Mechanisms[1]); - Assert.AreEqual("CRAM-MD5", registry.Mechanisms[2]); - Assert.AreEqual("PLAIN", registry.Mechanisms[3]); - } - } // class CallbackRegistryHandlerTests - - public class TestCallbackHandler : IAMQCallbackHandler - { - public void Initialize(Qpid.Client.Protocol.AMQProtocolSession session) - { - } - public void Handle(Qpid.Sasl.ISaslCallback[] callbacks) - { - } - - } // class TestCallbackHandler - -} // namespace Apache.Qpid.Client.Tests.Connection diff --git a/qpid/dotnet/Qpid.Client.Tests/default.build b/qpid/dotnet/Qpid.Client.Tests/default.build deleted file mode 100644 index 5116e651e1..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/default.build +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Client.Tests/interop/Consumer.cs b/qpid/dotnet/Qpid.Client.Tests/interop/Consumer.cs deleted file mode 100644 index d60514ae4c..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/interop/Consumer.cs +++ /dev/null @@ -1,56 +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. - * - */ - -using System; -using Apache.Qpid.Client; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client.Tests.interop -{ - public class Consumer - { - public static void Main(string[] args) - { - try - { - const string connectionUrl = @"amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'"; - const string queueName = @"test-queue"; - - var connectionInfo = QpidConnectionInfo.FromUrl(connectionUrl); - var connection = new AMQConnection(connectionInfo); - var channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1); - - channel.DeclareQueue(queueName, false, true, true); - channel.Bind(queueName, ExchangeNameDefaults.DIRECT, queueName); - IMessageConsumer consumer = channel.CreateConsumerBuilder(queueName) .Create(); - connection.Start(); - - ITextMessage message = (ITextMessage) consumer.Receive(); - Console.WriteLine("Got: " + message.Text); - connection.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Tests/interop/Producer.cs b/qpid/dotnet/Qpid.Client.Tests/interop/Producer.cs deleted file mode 100644 index d775080fc3..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/interop/Producer.cs +++ /dev/null @@ -1,55 +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. - * - */ - -using System; -using Apache.Qpid.Client; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client.Tests.interop -{ - public class Producer - { - public static void Main(string[] args) - { - try - { - const string connectionUrl = @"amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'"; - const string queueName = @"test-queue"; - - var connectionInfo = QpidConnectionInfo.FromUrl(connectionUrl); - var connection = new AMQConnection(connectionInfo); - var channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge); - var publisher = channel.CreatePublisherBuilder() - .WithExchangeName(ExchangeNameDefaults.DIRECT) - .WithRoutingKey(queueName) - .Create(); - IMessage message = channel.CreateTextMessage("0123456789"); - publisher.Send(message); - Console.WriteLine("Sent message"); - connection.Dispose(); - } - catch (Exception e) - { - Console.WriteLine(e); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs b/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs deleted file mode 100644 index e5daa64a89..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs +++ /dev/null @@ -1,229 +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. - * - */ -using System; -using System.Threading; -using log4net; -using Apache.Qpid.Messaging; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Tests.interop -{ - public class TopicListener - { - private static ILog log = LogManager.GetLogger(typeof(TopicListener)); - - /// The default AMQ connection URL to use for tests. - const string DEFAULT_URI = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'"; - - /// Holds the routing key for the topic to receive test messages on. - public static string CONTROL_ROUTING_KEY = "topic_control"; - - /// Holds the routing key for the queue to send reports to. - public static string RESPONSE_ROUTING_KEY = "response"; - - /// Holds the connection to listen on. - private IConnection connection; - - /// Holds the channel for all test messages. - private IChannel channel; - - /// Holds the producer to send report messages on. - private IMessagePublisher publisher; - - /// A monitor used to wait for shutdown. - private AutoResetEvent shutdownReceivedEvt = new AutoResetEvent(false); - - /// Holds the default test timeout for communications . - const int TIMEOUT = 60000; - - /// Holds a flag to indicate that a timer has begun on the first message. Reset when report is sent. */ - private bool init; - - /// Holds the count of messages received by this listener. */ - private int count; - - /// Creates a topic listener using the specified broker URL. - /// - /// The broker URL to listen on. - TopicListener(string connectionUri) - { - log.Debug("TopicListener(string connectionUri = " + connectionUri + "): called"); - - // Create a connection to the broker. - IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(connectionUri); - connection = new AMQConnection(connectionInfo); - - // Establish a session on the broker. - channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1); - - // Set up a queue to listen for test messages on. - string topicQueueName = channel.GenerateUniqueName(); - channel.DeclareQueue(topicQueueName, false, true, true); - - // Set this listener up to listen for incoming messages on the test topic queue. - channel.Bind(topicQueueName, ExchangeNameDefaults.TOPIC, CONTROL_ROUTING_KEY); - IMessageConsumer consumer = channel.CreateConsumerBuilder(topicQueueName) - .Create(); - consumer.OnMessage += new MessageReceivedDelegate(OnMessage); - - // Set up this listener with a producer to send the reports on. - publisher = channel.CreatePublisherBuilder() - .WithExchangeName(ExchangeNameDefaults.DIRECT) - .WithRoutingKey(RESPONSE_ROUTING_KEY) - .Create(); - - connection.Start(); - Console.WriteLine("Waiting for messages..."); - - if (shutdownReceivedEvt.WaitOne(TIMEOUT, true)) - { - Console.WriteLine("Shutting down - shut down message was received"); - } - else - { - Console.WriteLine("Shutting down - timeout elapsed"); - } - } - - public static void Main(String[] argv) - { - // Create an instance of this listener with the command line parameters. - new TopicListener(DEFAULT_URI); - } - - /// - /// Handles all message received by this listener. Test messages are counted, report messages result in a report being sent and - /// shutdown messages result in this listener being terminated. - /// - /// - /// The received message. - public void OnMessage(IMessage message) - { - log.Debug("public void onMessage(Message message = " + message + "): called"); - - // Take the start time of the first message if this is the first message. - if (!init) - { - count = 0; - init = true; - } - - // Check if the message is a control message telling this listener to shut down. - if (IsShutdown(message)) - { - log.Debug("Got a shutdown message."); - Shutdown(); - } - // Check if the message is a report request message asking this listener to respond with the message count. - else if (IsReport(message)) - { - log.Debug("Got a report request message."); - - // Send the message count report. - SendReport(); - - // Reset the initialization flag so that the next message is considered to be the first. - init = false; - } - // Otherwise it is an ordinary test message, so increment the message count. - else - { - count++; - } - } - - /// Checks a message to see if it is a shutdown control message. - /// - /// The message to check. - /// - /// true if it is a shutdown control message, false otherwise. - private bool IsShutdown(IMessage m) - { - bool result = CheckTextField(m, "TYPE", "TERMINATION_REQUEST"); - - //log.Debug("isShutdown = " + result); - - return result; - } - - /// Checks a message to see if it is a report request control message. - /// - /// The message to check. - /// - /// true if it is a report request control message, false otherwise. - private bool IsReport(IMessage m) - { - bool result = CheckTextField(m, "TYPE", "REPORT_REQUEST"); - - //log.Debug("isReport = " + result); - - return result; - } - - /// Checks whether or not a text field on a message has the specified value. - /// - /// The message to check. - /// The name of the field to check. - /// The expected value of the field to compare with. - /// - /// trueIf the specified field has the specified value, fals otherwise. - private static bool CheckTextField(IMessage m, string fieldName, string value) - { - /*log.Debug("private static boolean checkTextField(Message m = " + m + ", String fieldName = " + fieldName - + ", String value = " + value + "): called");*/ - - string comp = m.Headers.GetString(fieldName); - - return (comp != null) && comp == value; - } - - /// Stops the message consumer and closes the connection. - private void Shutdown() - { - connection.Stop(); - channel.Dispose(); - connection.Dispose(); - - shutdownReceivedEvt.Set(); - } - - /// Sends the report message to the response location. - private void SendReport() - { - string report = "Received " + count + "."; - - IMessage reportMessage = channel.CreateTextMessage(report); - - reportMessage.Headers.SetBoolean("BOOLEAN", false); - //reportMessage.Headers.SetByte("BYTE", 5); - reportMessage.Headers.SetDouble("DOUBLE", 3.141); - reportMessage.Headers.SetFloat("FLOAT", 1.0f); - reportMessage.Headers.SetInt("INT", 1); - reportMessage.Headers.SetLong("LONG", 1); - reportMessage.Headers.SetString("STRING", "hello"); - reportMessage.Headers.SetShort("SHORT", 2); - - publisher.Send(reportMessage); - - Console.WriteLine("Sent report: " + report); - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs b/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs deleted file mode 100644 index 4fd0419e9c..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs +++ /dev/null @@ -1,208 +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. - * - */ -using System; -using System.Threading; -using log4net; -using Apache.Qpid.Messaging; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Tests.interop -{ - public class TopicPublisher - { - private static ILog log = LogManager.GetLogger(typeof(TopicPublisher)); - - /// The default AMQ connection URL to use for tests. - const string DEFAULT_URI = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'"; - - /// Holds the default test timeout for broker communications before tests give up. - const int TIMEOUT = 10000; - - /// Holds the routing key for the topic to receive test messages on. - const string CONTROL_ROUTING_KEY = "topic_control"; - - /// Holds the routing key for the queue to send reports to. - const string RESPONSE_ROUTING_KEY = "response"; - - /// Holds the number of messages to send in each test run. - private int numMessages; - - /// Holds the number of subscribers listening to the messsages. - private int numSubscribers; - - /// A monitor used to wait for all reports to arrive back from consumers on. - private AutoResetEvent allReportsReceivedEvt = new AutoResetEvent(false); - - /// Holds the connection to listen on. - private IConnection connection; - - /// Holds the channel for all test messages. - private IChannel channel; - - /// Holds the producer to send test messages on. - private IMessagePublisher publisher; - - /// - /// Creates a topic publisher that will send the specifed number of messages and expect the specifed number of report back from test - /// subscribers. - /// - /// - /// The broker URL. - /// The number of messages to send in each test. - /// The number of subscribes that are expected to reply with a report. - TopicPublisher(string connectionUri, int numMessages, int numSubscribers) - { - log.Debug("TopicPublisher(string connectionUri = " + connectionUri + ", int numMessages = "+ numMessages + - ", int numSubscribers = " + numSubscribers + "): called"); - - // Create a connection to the broker. - IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(connectionUri); - connection = new AMQConnection(connectionInfo); - - // Establish a session on the broker. - channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1); - - // Set up a queue to listen for reports on. - string responseQueueName = channel.GenerateUniqueName(); - channel.DeclareQueue(responseQueueName, false, true, true); - - // Set this listener up to listen for reports on the response queue. - channel.Bind(responseQueueName, ExchangeNameDefaults.DIRECT, RESPONSE_ROUTING_KEY); - //channel.Bind(responseQueueName, "<>", RESPONSE_ROUTING_KEY); - IMessageConsumer consumer = channel.CreateConsumerBuilder(responseQueueName) - .Create(); - consumer.OnMessage += new MessageReceivedDelegate(OnMessage); - - // Set up this listener with a producer to send the test messages and report requests on. - publisher = channel.CreatePublisherBuilder() - .WithExchangeName(ExchangeNameDefaults.TOPIC) - .WithRoutingKey(CONTROL_ROUTING_KEY) - .Create(); - - // Keep the test parameters. - this.numMessages = numMessages; - this.numSubscribers = numSubscribers; - - connection.Start(); - Console.WriteLine("Sending messages and waiting for reports..."); - } - - /// - /// Start a test subscriber. The broker URL must be specified as the first command line argument. - /// - /// - /// The command line arguments, broker URL first. - public static void Main(String[] argv) - { - // Create an instance of this publisher with the command line parameters. - TopicPublisher publisher = new TopicPublisher(DEFAULT_URI, 1, 1); - - // Publish the test messages. - publisher.DoTest(); - } - - /// - /// Sends the test messages and waits for all subscribers to reply with a report. - /// - public void DoTest() - { - log.Debug("public void DoTest(): called"); - - // Create a test message to send. - IMessage testMessage = channel.CreateTextMessage("test"); - - // Send the desired number of test messages. - for (int i = 0; i < numMessages; i++) - { - publisher.Send(testMessage); - } - - log.Debug("Sent " + numMessages + " test messages."); - - // Send the report request. - IMessage reportRequestMessage = channel.CreateTextMessage("Report request message."); - reportRequestMessage.Headers["TYPE"] = "REPORT_REQUEST"; - - reportRequestMessage.Headers.SetBoolean("BOOLEAN", false); - //reportRequestMessage.Headers.SetByte("BYTE", 5); - reportRequestMessage.Headers.SetDouble("DOUBLE", 3.141); - reportRequestMessage.Headers.SetFloat("FLOAT", 1.0f); - reportRequestMessage.Headers.SetInt("INT", 1); - reportRequestMessage.Headers.SetLong("LONG", 1); - reportRequestMessage.Headers.SetString("STRING", "hello"); - reportRequestMessage.Headers.SetShort("SHORT", 2); - - publisher.Send(reportRequestMessage); - - log.Debug("Sent the report request message, waiting for all replies..."); - - // Wait until all the reports come in. - allReportsReceivedEvt.WaitOne(TIMEOUT, true); - - // Check if all reports were really received or if the timeout occurred. - if (numSubscribers == 0) - { - log.Debug("Got all reports."); - } - else - { - log.Debug("Waiting for reports timed out, still waiting for " + numSubscribers + "."); - } - - // Send the termination request. - IMessage terminationRequestMessage = channel.CreateTextMessage("Termination request message."); - terminationRequestMessage.Headers["TYPE"] = "TERMINATION_REQUEST"; - publisher.Send(terminationRequestMessage); - - log.Debug("Sent the termination request message."); - - // Close all message producers and consumers and the connection to the broker. - Shutdown(); - } - - /// - /// Handles all report messages from subscribers. This decrements the count of subscribers that are still to reply, until this becomes - /// zero, at which time waiting threads are notified of this event. - /// - /// - /// The received report message. - public void OnMessage(IMessage message) - { - log.Debug("public void OnMessage(IMessage message = " + message + "): called"); - - // Decrement the count of expected messages and release the wait monitor when this becomes zero. - if (--numSubscribers == 0) - { - log.Debug("Got reports from all subscribers."); - allReportsReceivedEvt.Set(); - } - } - - /// Stops the message consumers and closes the connection. - private void Shutdown() - { - connection.Stop(); - publisher.Dispose(); - channel.Dispose(); - connection.Dispose(); - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt b/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt deleted file mode 100644 index b2316295d3..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt +++ /dev/null @@ -1,23 +0,0 @@ -Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, - Charlie Poole -Copyright © 2000-2004 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In -no event will the authors be held liable for any damages arising from the use -of this software. - -Permission is granted to anyone to use this software for any purpose, including -commercial applications, and to alter it and redistribute it freely, subject to -the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim - that you wrote the original software. If you use this software in a product, an - acknowledgment (see the following) in the product documentation is required. - - Portions Copyright © 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov - or Copyright © 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. diff --git a/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll b/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll deleted file mode 100644 index 53666e74c9..0000000000 Binary files a/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll and /dev/null differ diff --git a/qpid/dotnet/Qpid.Client.Tests/log4net.config b/qpid/dotnet/Qpid.Client.Tests/log4net.config deleted file mode 100644 index 0ad25c4185..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/log4net.config +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs b/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs deleted file mode 100644 index 3c9f8dd4e2..0000000000 --- a/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs +++ /dev/null @@ -1,446 +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. - * - */ -using System; -using System.Net; -using NUnit.Framework; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Tests.url -{ - [TestFixture] - public class connectionUrlTests - { - [Test] - public void FailoverURL() - { - //String url = "amqp://ritchiem:bob@/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'"; - String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.AreEqual("roundrobin", connectionurl.FailoverMethod); - Assert.IsTrue(connectionurl.Username.Equals("ritchiem")); - Assert.IsTrue(connectionurl.Password.Equals("bob")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - Assert.IsTrue(connectionurl.BrokerCount == 2); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - - service = connectionurl.GetBrokerInfo(1); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("fancyserver")); - Assert.IsTrue(service.Port == 3000); - - } - - [Test] - public void SingleTransportUsernamePasswordURL() - { - String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("ritchiem")); - Assert.IsTrue(connectionurl.Password.Equals("bob")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - } - - [Test] - public void SingleTransportUsernameBlankPasswordURL() - { - String url = "amqp://ritchiem:@default/temp?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("ritchiem")); - Assert.IsTrue(connectionurl.Password.Equals("")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - } - - [Test] - public void FailedURLNullPassword() - { - String url = "amqp://ritchiem@default/temp?brokerlist='tcp://localhost:5672'"; - - try - { - QpidConnectionInfo.FromUrl(url); - Assert.Fail("URL has null password"); - } - catch (UrlSyntaxException e) - { - Assert.AreEqual("Null password in user information not allowed.", e.Message); - Assert.IsTrue(e.GetIndex() == 7); - } - } - - [Test] - public void SingleTransportURL() - { - String url = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/test")); - - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - } - - [Test] - public void SingleTransportWithClientURLURL() - { - String url = "amqp://guest:guest@clientname/temp?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - Assert.IsTrue(connectionurl.ClientName.Equals("clientname")); - - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - } - - [Test] - public void SingleTransport1OptionURL() - { - String url = "amqp://guest:guest@default/temp?brokerlist='tcp://localhost:5672',routingkey='jim'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - Assert.IsTrue(connectionurl.GetOption("routingkey").Equals("jim")); - } - - [Test] - public void SingleTransportDefaultedBroker() - { - String url = "amqp://guest:guest@default/temp?brokerlist='localhost:'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - } - - [Test] - public void SingleTransportMultiOptionURL() - { - String url = "amqp://guest:guest@default/temp?brokerlist='tcp://localhost:5672',routingkey='jim',timeout='200',immediatedelivery='true'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("tcp")); - - Assert.IsTrue(service.Host.Equals("localhost")); - Assert.IsTrue(service.Port == 5672); - - Assert.IsTrue(connectionurl.GetOption("routingkey").Equals("jim")); - Assert.IsTrue(connectionurl.GetOption("timeout").Equals("200")); - Assert.IsTrue(connectionurl.GetOption("immediatedelivery").Equals("true")); - } - - [Test] - public void SinglevmURL() - { - String url = "amqp://guest:guest@default/messages?brokerlist='vm://default:2'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod == null); - Assert.IsTrue(connectionurl.Username.Equals("guest")); - Assert.IsTrue(connectionurl.Password.Equals("guest")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/messages")); - - Assert.IsTrue(connectionurl.BrokerCount == 1); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("vm")); - Assert.AreEqual("localhost", service.Host); - Assert.AreEqual(2, service.Port); - } - - [Test] - public void FailoverVMURL() - { - String url = "amqp://ritchiem:bob@default/temp?brokerlist='vm://default:2;vm://default:3',failover='roundrobin'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.FailoverMethod.Equals("roundrobin")); - Assert.IsTrue(connectionurl.Username.Equals("ritchiem")); - Assert.IsTrue(connectionurl.Password.Equals("bob")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp")); - - Assert.AreEqual(2, connectionurl.BrokerCount); - - IBrokerInfo service = connectionurl.GetBrokerInfo(0); - - Assert.IsTrue(service.Transport.Equals("vm")); - Assert.AreEqual("localhost", service.Host); - Assert.IsTrue(service.Port == 2); - - service = connectionurl.GetBrokerInfo(1); - Assert.IsTrue(service.Transport.Equals("vm")); - Assert.AreEqual("localhost", service.Host); - Assert.IsTrue(service.Port == 3); - } - - [Test] - public void NoVirtualHostURL() - { - String url = "amqp://user@default?brokerlist='tcp://localhost:5672'"; - - try - { - QpidConnectionInfo.FromUrl(url); - Assert.Fail("URL has no virtual host should not parse"); - } - catch (UrlSyntaxException) - { - // This should occur. - } - } - - [Test] - public void NoClientID() - { - String url = "amqp://user:@default/test?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url); - - Assert.IsTrue(connectionurl.Username.Equals("user")); - Assert.IsTrue(connectionurl.Password.Equals("")); - Assert.IsTrue(connectionurl.VirtualHost.Equals("/test")); - Assert.IsTrue(connectionurl.ClientName.StartsWith(Dns.GetHostName())); - - Assert.IsTrue(connectionurl.BrokerCount == 1); - } - - [Test] - public void WrongOptionSeparatorInOptions() - { - String url = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'+failover='roundrobin'"; - try - { - QpidConnectionInfo.FromUrl(url); - Assert.Fail("URL Should not parse"); - } - catch (UrlSyntaxException urise) - { - Assert.IsTrue(urise.Message.Equals("Unterminated option. Possible illegal option separator:'+'")); - } - - } - - [Test] - public void NoUserDetailsProvidedWithClientID() - - { - String url = "amqp://clientID/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'"; - try - { - QpidConnectionInfo.FromUrl(url); - Assert.Fail("URL Should not parse"); - } - catch (UrlSyntaxException urise) - { - Assert.IsTrue(urise.Message.StartsWith("User information not found on url")); - } - - } - - [Test] - public void NoUserDetailsProvidedNOClientID() - - { - String url = "amqp:///test@default?brokerlist='tcp://localhost:5672;tcp://localhost:5673'"; - try - { - QpidConnectionInfo.FromUrl(url); - Assert.Fail("URL Should not parse"); - } - catch (UrlSyntaxException urise) - { - - Assert.IsTrue(urise.Message.StartsWith("User information not found on url")); - } - - } - - [Test] - public void CheckVirtualHostFormat() - { - String url = "amqp://guest:guest@default/t.-_+!=:?brokerlist='tcp://localhost:5672'"; - - IConnectionInfo connection = QpidConnectionInfo.FromUrl(url); - Assert.IsTrue(connection.VirtualHost.Equals("/t.-_+!=:")); - } - - [Test] - public void CheckDefaultPort() - { - String url = "amqp://guest:guest@default/test=:?brokerlist='tcp://localhost'"; - - IConnectionInfo connection = QpidConnectionInfo.FromUrl(url); - - IBrokerInfo broker = connection.GetBrokerInfo(0); - Assert.IsTrue(broker.Port == BrokerInfoConstants.DEFAULT_PORT); - - } - - [Test] - public void CheckMissingFinalQuote() - { - String url = "amqp://guest:guest@id/test" + "?brokerlist='tcp://localhost:5672"; - - try - { - QpidConnectionInfo.FromUrl(url); - } - catch (UrlSyntaxException e) - { -// Assert.AreEqual("Unterminated option at index 32: brokerlist='tcp://localhost:5672", -// e.Message); - Assert.AreEqual("Unterminated option", e.Message); - } - } - - [Test] - public void ValidateQpidConnectionInfoFromToString() - { - String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'"; - - IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(url); - IConnectionInfo connectionInfo1 = QpidConnectionInfo.FromUrl(connectionInfo.ToString()); - - Console.WriteLine(connectionInfo.ToString()); - Console.WriteLine(connectionInfo1.ToString()); - - Assert.AreEqual(connectionInfo.Username, connectionInfo1.Username); - Assert.AreEqual(connectionInfo.Password, connectionInfo1.Password); - Assert.AreEqual(connectionInfo.VirtualHost, connectionInfo1.VirtualHost); - - Assert.IsTrue((connectionInfo1.GetAllBrokerInfos().Count == 2)); - Assert.IsTrue(connectionInfo.GetBrokerInfo(0).Equals(connectionInfo1.GetBrokerInfo(0))); - Assert.IsTrue(connectionInfo.GetBrokerInfo(1).Equals(connectionInfo1.GetBrokerInfo(1))); - - } - - [Test] - public void EnsureVirtualHostStartsWithSlash() - { - IConnectionInfo connection = new QpidConnectionInfo(); - connection.VirtualHost = "test"; - Assert.AreEqual("/test", connection.VirtualHost); - - connection.VirtualHost = "/mytest"; - Assert.AreEqual("/mytest", connection.VirtualHost); - - connection.VirtualHost = ""; - Assert.AreEqual("/", connection.VirtualHost); - - connection.VirtualHost = null; - Assert.AreEqual("/", connection.VirtualHost); - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs deleted file mode 100644 index b62b11a3db..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs +++ /dev/null @@ -1,135 +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. - * - */ -using System; -using System.Net; -using System.Net.Sockets; -using log4net; -using Apache.Qpid.Buffer; -using Apache.Qpid.Client.Protocol; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - class BlockingSocketProcessor : IConnectionCloser - { - private static readonly ILog _log = LogManager.GetLogger(typeof(BlockingSocketProcessor)); - - string _host; - int _port; - System.Net.Sockets.Socket _socket; - private NetworkStream _networkStream; - IByteChannel _byteChannel; - IProtocolListener _protocolListener; - - public BlockingSocketProcessor(string host, int port, IProtocolListener protocolListener) - { - _host = host; - _port = port; - _protocolListener = protocolListener; - _byteChannel = new ByteChannel(this); - } - - /// - /// Synchronous blocking connect. - /// - public void Connect() - { - _socket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - - /// For future note TCP Set NoDelay options may help, though with the blocking io not sure - /// The Don't linger may help with detecting disconnect but that hasn't been the case in testing. - /// _socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.NoDelay, 0); - /// _socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 0); - - IPHostEntry ipHostInfo = Dns.Resolve(_host); // Note: don't fix this warning. We do this for .NET 1.1 compatibility. - IPAddress ipAddress = ipHostInfo.AddressList[0]; - - IPEndPoint ipe = new IPEndPoint(ipAddress, _port); - - _socket.Connect(ipe); - _networkStream = new NetworkStream(_socket, true); - } - - public string getLocalEndPoint() - { - return _socket.LocalEndPoint.ToString(); - } - - public void Write(ByteBuffer byteBuffer) - { - try - { - _networkStream.Write(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit()); // FIXME - } - catch (Exception e) - { - _log.Error("Write caused exception", e); - _protocolListener.OnException(e); - // We should provide the error synchronously as we are doing blocking io. - throw e; - } - } - - public ByteBuffer Read() - { - const int bufferSize = 4 * 1024; // TODO: Prevent constant allocation of buffers. - byte[] bytes = new byte[bufferSize]; - - int numOctets = _networkStream.Read(bytes, 0, bytes.Length); - - /// Read only returns 0 if the socket has been gracefully shutdown. - /// http://msdn2.microsoft.com/en-us/library/system.net.sockets.networkstream.read(VS.71).aspx - /// We can use this to block Send so the next Read will force an exception forcing failover. - /// Otherwise we need to wait ~20 seconds for the NetworkStream/Socket code to realise that - /// the socket has been closed. - if (numOctets == 0) - { - _socket.Shutdown(SocketShutdown.Send); - _socket.Close(); - } - - ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); - byteBuffer.limit(numOctets); - - byteBuffer.flip(); - - return byteBuffer; - } - - public void Disconnect() - { - _networkStream.Flush(); - _networkStream.Close(); - _socket.Close(); - } - - public void Close() - { - Disconnect(); - } - - public IByteChannel ByteChannel - { - get { return _byteChannel; } - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs deleted file mode 100644 index 17f911fb6d..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs +++ /dev/null @@ -1,121 +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. - * - */ -using System; -using System.Collections; -using System.Threading; -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Framing; - -namespace Qpid.Client.Transport.Socket.Blocking -{ - public class BlockingSocketTransport : ITransport - { -// static readonly ILog _log = LogManager.GetLogger(typeof(BlockingSocketTransport)); - - // Configuration variables. - string _host; - int _port; - IProtocolListener _protocolListener; - - // Runtime variables. - private BlockingSocketProcessor _socketProcessor; - private AmqpChannel _amqpChannel; - - private ReaderRunner _readerRunner; - private Thread _readerThread; - - public BlockingSocketTransport(string host, int port, AMQConnection connection) - { - _host = host; - _port = port; - _protocolListener = connection.ProtocolListener; - } - - public void Open() - { - _socketProcessor = new BlockingSocketProcessor(_host, _port, _protocolListener); - _socketProcessor.Connect(); - _amqpChannel = new AmqpChannel(_socketProcessor.ByteChannel); - _readerRunner = new ReaderRunner(this); - _readerThread = new Thread(new ThreadStart(_readerRunner.Run)); - _readerThread.Start(); - } - - public string getLocalEndPoint() - { - return _socketProcessor.getLocalEndPoint(); - } - - public void Close() - { - StopReaderThread(); - _socketProcessor.Disconnect(); - } - - public IProtocolChannel ProtocolChannel { get { return _amqpChannel; } } - public IProtocolWriter ProtocolWriter { get { return _amqpChannel; } } - - public void StopReaderThread() - { - _readerRunner.Stop(); - } - - class ReaderRunner - { - BlockingSocketTransport _transport; - bool _running = true; - - public ReaderRunner(BlockingSocketTransport transport) - { - _transport = transport; - } - - public void Run() - { - try - { - while (_running) - { - Queue frames = _transport.ProtocolChannel.Read(); - - foreach (IDataBlock dataBlock in frames) - { - _transport._protocolListener.OnMessage(dataBlock); - } - } - } - catch (Exception e) - { - _transport._protocolListener.OnException(e); - } - } - - public void Stop() - { - // TODO: Check if this is thread safe. running is not volitile.... - _running = false; - } - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs deleted file mode 100644 index 5f67e99838..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs +++ /dev/null @@ -1,63 +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. - * - */ -using System; -using log4net; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - class ByteChannel : IByteChannel - { - // Warning: don't use this log for regular logging. - private static readonly ILog _ioTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ByteChannel"); - - BlockingSocketProcessor processor; - - public ByteChannel(BlockingSocketProcessor processor) - { - this.processor = processor; - } - - public ByteBuffer Read() - { - ByteBuffer result = processor.Read(); - - // TODO: Move into decorator. - if (_ioTraceLog.IsDebugEnabled) - { - _ioTraceLog.Debug(String.Format("READ {0}", result)); - } - - return result; - } - - public void Write(ByteBuffer buffer) - { - // TODO: Move into decorator. - if (_ioTraceLog.IsDebugEnabled) - { - _ioTraceLog.Debug(String.Format("WRITE {0}", buffer)); - } - - processor.Write(buffer); - } - } -} diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs deleted file mode 100644 index 19599b0833..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +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. - * - */ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.Transport.Blocking")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("Apache.Qpid.Transport.Blocking")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ca23e89c-f5b9-4f7a-929a-4fae00ef055b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj deleted file mode 100644 index 6a0b1cd8e6..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {52AC4940-2077-4104-A753-29A9C8C16957} - Library - Properties - Apache.Qpid.Client.Transport.Socket.Blocking - Apache.Qpid.Client.Transport.Socket.Blocking - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\Qpid.Common\lib\log4net\log4net.dll - - - - - - - - - - - - - - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Qpid.Buffer - - - {68987C05-3768-452C-A6FC-6BA1D372852F} - Qpid.Client - - - {77064C42-24D2-4CEB-9EA2-0EF481A43205} - Qpid.Common - - - {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07} - Qpid.Messaging - - - - - diff --git a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp b/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp deleted file mode 100644 index 54c3be76e5..0000000000 --- a/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs b/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs deleted file mode 100644 index 7bb64e3fff..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs +++ /dev/null @@ -1,39 +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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Client -{ - [Serializable] - public class AMQAuthenticationException : AMQException - { - public AMQAuthenticationException(int error, String message) - : base(error, message) - { - } - - protected AMQAuthenticationException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs b/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs deleted file mode 100644 index 41d4e089b6..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs +++ /dev/null @@ -1,873 +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. - * - */ -using System; -using System.Collections; -using System.IO; -using System.Reflection; -using System.Threading; -using log4net; -using Apache.Qpid.Client.Failover; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.Qms; -using Apache.Qpid.Client.State; -using Apache.Qpid.Client.Transport; -using Apache.Qpid.Client.Transport.Socket.Blocking; -using Apache.Qpid.Collections; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client -{ - public class AMQConnection : Closeable, IConnection - { - private static readonly ILog _log = LogManager.GetLogger(typeof(AMQConnection)); - - IConnectionInfo _connectionInfo; - private int _nextChannelId = 0; - - // _Connected should be refactored with a suitable wait object. - private bool _connected; - - Thread _heartBeatThread; - HeartBeatThread _heartBeatRunner; - - // The last error code that occured on the connection. Used to return the correct exception to the client - private AMQException _lastAMQException = null; - - /** - * This is the "root" mutex that must be held when doing anything that could be impacted by failover. - * This must be held by any child objects of this connection such as the session, producers and consumers. - */ - private readonly Object _failoverMutex = new Object(); - public object FailoverMutex - { - get { return _failoverMutex; } - } - - /** - * Policy dictating how to failover - */ - private FailoverPolicy _failoverPolicy; - - internal bool IsFailoverAllowed - { - get { if(!_connected) return false; else return _failoverPolicy.FailoverAllowed(); } - } - - /// - /// A channel is roughly analogous to a session. The server can negotiate the maximum number of channels - /// per session and we must prevent the client from opening too many. Zero means unlimited. - /// - private ushort _maximumChannelCount; - - /// - /// The maximum size of frame supported by the server - /// - private uint _maximumFrameSize; - - private AMQStateManager _stateManager; - - private AMQProtocolSession _protocolSession; - public AMQProtocolSession ProtocolSession { get { return _protocolSession; } } - - /// - /// Maps from session id (Integer) to AmqChannel instance - /// - private readonly IDictionary _sessions = new LinkedHashtable(); - - private ExceptionListenerDelegate _exceptionListener; - - private IConnectionListener _connectionListener; - - private ITransport _transport; - public ITransport Transport { get { return _transport; } } - - /// - /// Whether this connection is started, i.e. whether messages are flowing to consumers. It has no meaning for - /// message publication. - /// - private bool _started; - - private AMQProtocolListener _protocolListener; - public AMQProtocolListener ProtocolListener { get { return _protocolListener; } } - - public IProtocolWriter ProtocolWriter - { - get { return _transport.ProtocolWriter; } - } - - ProtocolWriter _protocolWriter; - - public ProtocolWriter ConvenientProtocolWriter - { - get { return _protocolWriter; } - } - - public AMQConnection(IConnectionInfo connectionInfo) - { - if (connectionInfo == null) - { - throw new ArgumentException("ConnectionInfo must be specified"); - } - _log.Debug("ConnectionInfo: " + connectionInfo); - _connectionInfo = connectionInfo; - _log.Debug("password = " + _connectionInfo.Password); - _failoverPolicy = new FailoverPolicy(connectionInfo); - - // We are not currently connected. - _connected = false; - - Exception lastException = null; - do - { - try - { - IBrokerInfo brokerInfo = _failoverPolicy.GetNextBrokerInfo(); - _log.Debug("Connecting to " + brokerInfo); - MakeBrokerConnection(brokerInfo); - break; - } - catch (Exception e) - { - lastException = e; - _log.Error("Unable to connect to broker " + _failoverPolicy.GetCurrentBrokerInfo(), e); - // XXX: Should perhaps break out of the do/while here if not a SocketException... - } - } while (!_connected && _failoverPolicy.FailoverAllowed()); - - _log.Debug("Are we connected:" + _connected); - - if (!_connected) - { - if ( lastException is AMQException ) - { - throw lastException; - } - else - { - throw new AMQConnectionException("Unable to connect", lastException); - } - } - - } - - /*private ITransport LoadTransportFromAssembly(string host, int port, String assemblyName, String transportType) - { - //Assembly assembly = Assembly.LoadFrom(assemblyName); - Assembly assembly = Assembly.Load(assemblyName); - - foreach (Type type in assembly.GetTypes()) - { - _log.Debug(String.Format("type = {0}", type)); - } - - Type transport = assembly.GetType(transportType); - - if (transport == null) - { - throw new ArgumentException( - String.Format("Type is not found in assembly. Type={0} Assembly={1}", transportType, assemblyName)); - - } - - _log.Debug("transport = " + transport); - _log.Debug("ctors = " + transport.GetConstructors()); - - ConstructorInfo info = transport.GetConstructors()[0]; - ITransport result = (ITransport)info.Invoke(new object[] { host, port, this }); - - _log.Debug("transport = " + result); - - return result; - }*/ - - public void Disconnect() - { - _transport.Close(); - } - - #region IConnection Members - - public string ClientID - { - get - { - CheckNotClosed(); - return _connectionInfo.ClientName; - } - set - { - CheckNotClosed(); - _connectionInfo.ClientName = value; - } - } - - public override void Close() - { - lock (FailoverMutex) - { - // atomically set to closed and check the _previous value was NOT CLOSED - if (Interlocked.Exchange(ref _closed, CLOSED) == NOT_CLOSED) - { - try - { - CloseAllSessions(null); - CloseConnection(); - } - catch (AMQException e) - { - throw new QpidException("Error closing connection: " + e); - } - } - } - } - - private void CloseConnection() - { - _stateManager.ChangeState(AMQState.CONNECTION_CLOSING); - - AMQFrame frame = ConnectionCloseBody.CreateAMQFrame( - 0, 200, "Qpid.NET client is closing the connection.", 0, 0); - - ProtocolWriter.Write(frame); - - _log.Debug("Blocking for connection close ok frame"); - - Disconnect(); - } - - class CreateChannelFailoverSupport : FailoverSupport - { - private static readonly ILog _log = LogManager.GetLogger(typeof(CreateChannelFailoverSupport)); - - private bool _transacted; - private AcknowledgeMode _acknowledgeMode; - int _prefetchHigh; - int _prefetchLow; - AMQConnection _connection; - - public CreateChannelFailoverSupport(AMQConnection connection, bool transacted, AcknowledgeMode acknowledgeMode, int prefetchHigh, int prefetchLow) - { - _connection = connection; - _transacted = transacted; - _acknowledgeMode = acknowledgeMode; - _prefetchHigh = prefetchHigh; - _prefetchLow = prefetchLow; - } - - protected override object operation() - { - ushort channelId = _connection.NextChannelId(); - - if (_log.IsDebugEnabled) - { - _log.Debug("Write channel open frame for channel id " + channelId); - } - - // We must create the channel and register it before actually sending the frame to the server to - // open it, so that there is no window where we could receive data on the channel and not be set - // up to handle it appropriately. - AmqChannel channel = new AmqChannel(_connection, - channelId, _transacted, _acknowledgeMode, _prefetchHigh, _prefetchLow); - _connection.ProtocolSession.AddSessionByChannel(channelId, channel); - _connection.RegisterSession(channelId, channel); - - bool success = false; - try - { - _connection.CreateChannelOverWire(channelId, _prefetchHigh, _prefetchLow, _transacted); - success = true; - } - catch (AMQException e) - { - throw new QpidException("Error creating channel: " + e, e); - } - finally - { - if (!success) { - _connection.ProtocolSession.RemoveSessionByChannel(channelId); - _connection.DeregisterSession(channelId); - } - } - - if (_connection._started) - { - channel.Start(); - } - return channel; - } - } - - internal ushort NextChannelId() - { - return (ushort) Interlocked.Increment(ref _nextChannelId); - } - - public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode) - { - return CreateChannel(transacted, acknowledgeMode, AmqChannel.DEFAULT_PREFETCH_HIGH_MARK); - } - - public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetch) - { - return CreateChannel(transacted, acknowledgeMode, prefetch, prefetch); - } - - public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetchHigh, int prefetchLow) - { - CheckNotClosed(); - if (ChannelLimitReached()) - { - throw new ChannelLimitReachedException(_maximumChannelCount); - } - else - { - CreateChannelFailoverSupport operation = - new CreateChannelFailoverSupport(this, transacted, acknowledgeMode, prefetchHigh, prefetchLow); - return (IChannel)operation.execute(this); - } - } - - public void CloseSession(AmqChannel channel) - { - // FIXME: Don't we need FailoverSupport here (as we have SyncWrite). - _protocolSession.CloseSession(channel); - - AMQFrame frame = ChannelCloseBody.CreateAMQFrame( - channel.ChannelId, 200, "JMS client closing channel", 0, 0); - - _log.Debug("Blocking for channel close frame for channel " + channel.ChannelId); - _protocolWriter.SyncWrite(frame, typeof(ChannelCloseOkBody)); - _log.Debug("Received channel close frame"); - // When control resumes at this point, a reply will have been received that - // indicates the broker has closed the channel successfully - } - - public ExceptionListenerDelegate ExceptionListener - { - get - { - CheckNotClosed(); - return _exceptionListener; - } - set - { - CheckNotClosed(); - _exceptionListener = value; - } - } - - /// - /// Start the connection, i.e. start flowing messages. Note that this method must be called only from a single thread - /// and is not thread safe (which is legal according to the JMS specification). - /// @throws JMSException - /// - public void Start() - { - CheckNotClosed(); - - if (!_started) - { - foreach (DictionaryEntry lde in _sessions) - { - AmqChannel s = (AmqChannel)lde.Value; - s.Start(); - } - _started = true; - } - } - - public void Stop() - { - CheckNotClosed(); - - if (_started) - { - foreach (DictionaryEntry lde in _sessions) - { - AmqChannel s = (AmqChannel) lde.Value; - s.Stop(); - } - _started = false; - } - } - - public IConnectionListener ConnectionListener - { - get { return _connectionListener; } - set { _connectionListener = value; } - } - - #endregion - - #region IDisposable Members - - public void Dispose() - { - Close(); - } - - #endregion - - private bool ChannelLimitReached() - { - return _maximumChannelCount != 0 && _sessions.Count == _maximumChannelCount; - } - - /// - /// Close all the sessions, either due to normal connection closure or due to an error occurring. - /// @param cause if not null, the error that is causing this shutdown - /// - private void CloseAllSessions(Exception cause) - { - _log.Debug("Closing all session in connection " + this); - ICollection sessions = new ArrayList(_sessions.Values); - foreach (AmqChannel channel in sessions) - { - _log.Debug("Closing channel " + channel); - if (cause != null) - { - channel.ClosedWithException(cause); - } - else - { - try - { - channel.Close(); - } - catch (QpidException e) - { - _log.Error("Error closing channel: " + e); - } - } - } - _log.Debug("Done closing all sessions in connection " + this); - } - - public int MaximumChannelCount - { - get - { - CheckNotClosed(); - return _maximumChannelCount; - } - } - - internal void SetMaximumChannelCount(ushort maximumChannelCount) - { - CheckNotClosed(); - _maximumChannelCount = maximumChannelCount; - } - - public uint MaximumFrameSize - { - get - { - return _maximumFrameSize; - } - - set - { - _maximumFrameSize = value; - } - } - - public IDictionary Sessions - { - get - { - return _sessions; - } - } - - public string Host - { - get - { - return _failoverPolicy.GetCurrentBrokerInfo().Host; - } - } - - public int Port - { - get - { - return _failoverPolicy.GetCurrentBrokerInfo().Port; - } - } - - public string Username - { - get - { - return _connectionInfo.Username; - } - } - - public string Password - { - get - { - return _connectionInfo.Password; - } - } - - public string VirtualHost - { - get - { - return _connectionInfo.VirtualHost; - } - } - - /// - /// Invoked by the AMQProtocolSession when a protocol session exception has occurred. - /// This method sends the exception to a JMS exception listener, if configured, and - /// propagates the exception to sessions, which in turn will propagate to consumers. - /// This allows synchronous consumers to have exceptions thrown to them. - /// - /// the exception - public void ExceptionReceived(Exception cause) - { - if (_exceptionListener != null) - { - // Listener expects one of these... - QpidException xe; - - if (cause is QpidException) - { - xe = (QpidException) cause; - } - else - { - xe = new QpidException("Exception thrown against " + ToString() + ": " + cause, cause); - } - // in the case of an IOException, MINA has closed the protocol session so we set _closed to true - // so that any generic client code that tries to close the connection will not mess up this error - // handling sequence - if (cause is IOException) - { - Interlocked.Exchange(ref _closed, CLOSED); - } -#if __MonoCS__ - _exceptionListener(xe); -#else - _exceptionListener.Invoke(xe); -#endif - } - else - { - _log.Error("Connection exception: " + cause); - } - - // An undelivered is not fatal to the connections usability. - if (!(cause is AMQUndeliveredException)) - { - Interlocked.Exchange(ref _closed, CLOSED); - CloseAllSessions(cause); - } - else - { - ; - } - } - - internal void RegisterSession(int channelId, AmqChannel channel) - { - _sessions[channelId] = channel; - } - - internal void DeregisterSession(int channelId) - { - _sessions.Remove(channelId); - } - - /** - * Fire the preFailover event to the registered connection listener (if any) - * - * @param redirect true if this is the result of a redirect request rather than a connection error - * @return true if no listener or listener does not veto change - */ - public bool FirePreFailover(bool redirect) - { - bool proceed = true; - if (_connectionListener != null) - { - proceed = _connectionListener.PreFailover(redirect); - } - return proceed; - } - - /** - * Fire the preResubscribe event to the registered connection listener (if any). If the listener - * vetoes resubscription then all the sessions are closed. - * - * @return true if no listener or listener does not veto resubscription. - * @throws JMSException - */ - public bool FirePreResubscribe() - { - if (_connectionListener != null) - { - bool resubscribe = _connectionListener.PreResubscribe(); - if (!resubscribe) - { - MarkAllSessionsClosed(); - } - return resubscribe; - } - else - { - return true; - } - } - - /** - * Marks all sessions and their children as closed without sending any protocol messages. Useful when - * you need to mark objects "visible" in userland as closed after failover or other significant event that - * impacts the connection. - *

- * The caller must hold the failover mutex before calling this method. - */ - private void MarkAllSessionsClosed() - { - //LinkedList sessionCopy = new LinkedList(_sessions.values()); - ArrayList sessionCopy = new ArrayList(_sessions.Values); - foreach (AmqChannel session in sessionCopy) - { - session.MarkClosed(); - } - _sessions.Clear(); - } - - /** - * Fires a failover complete event to the registered connection listener (if any). - */ - public void FireFailoverComplete() - { - if (_connectionListener != null) - { - _connectionListener.FailoverComplete(); - } - } - - public bool AttemptReconnection(String host, int port, SslOptions sslConfig) - { - IBrokerInfo bd = new AmqBrokerInfo("amqp", host, port, sslConfig); - - _failoverPolicy.setBroker(bd); - - try - { - MakeBrokerConnection(bd); - return true; - } - catch (Exception e) - { - _log.Debug("Unable to connect to broker at " + bd, e); - AttemptReconnection(); - } - return false; - } - - private void MakeBrokerConnection(IBrokerInfo brokerDetail) - { - try - { - _stateManager = new AMQStateManager(); - _protocolListener = new AMQProtocolListener(this, _stateManager); - _protocolListener.AddFrameListener(_stateManager); - - /* - // Currently there is only one transport option - BlockingSocket. - String assemblyName = "Apache.Qpid.Client.Transport.Socket.Blocking.dll"; - String transportType = "Apache.Qpid.Client.Transport.Socket.Blocking.BlockingSocketTransport"; - - // Load the transport assembly dynamically. - _transport = LoadTransportFromAssembly(brokerDetail.getHost(), brokerDetail.getPort(), assemblyName, transportType); - */ - - _transport = new BlockingSocketTransport(); - - // Connect. - _transport.Connect(brokerDetail, this); - _protocolWriter = new ProtocolWriter(_transport.ProtocolWriter, _protocolListener); - _protocolSession = new AMQProtocolSession(_transport.ProtocolWriter, _transport, this); - _protocolListener.ProtocolSession = _protocolSession; - - // Now start the connection "handshake". - _transport.ProtocolWriter.Write(new ProtocolInitiation()); - - // Blocks until the connection has been opened. - _stateManager.AttainState(AMQState.CONNECTION_OPEN); - - _failoverPolicy.attainedConnection(); - - // XXX: Again this should be changed to a suitable notify. - _connected = true; - } - catch (AMQException e) - { - _lastAMQException = e; - throw; // rethrow - } - } - - public bool AttemptReconnection() - { - while (_failoverPolicy.FailoverAllowed()) - { - try - { - MakeBrokerConnection(_failoverPolicy.GetNextBrokerInfo()); - return true; - } - catch (Exception e) - { - if (!(e is AMQException)) - { - _log.Debug("Unable to connect to broker at " + _failoverPolicy.GetCurrentBrokerInfo(), e); - } - else - { - _log.Debug(e.Message + ":Unable to connect to broker at " + _failoverPolicy.GetCurrentBrokerInfo()); - } - } - } - - // Connection unsuccessful. - return false; - } - - /** - * For all channels, and for all consumers in those sessions, resubscribe. This is called during failover handling. - * The caller must hold the failover mutex before calling this method. - */ - public void ResubscribeChannels() - { - ArrayList channels = new ArrayList(_sessions.Values); - _log.Debug(String.Format("Resubscribing sessions = {0} sessions.size={1}", channels, channels.Count)); - foreach (AmqChannel channel in channels) - { - _protocolSession.AddSessionByChannel(channel.ChannelId, channel); - ReopenChannel( - channel.ChannelId, - channel.DefaultPrefetchHigh, - channel.DefaultPrefetchLow, - channel.Transacted - ); - channel.ReplayOnFailOver(); - } - } - - private void ReopenChannel(ushort channelId, int prefetchHigh, int prefetchLow, bool transacted) - { - _log.Debug(string.Format("Reopening channel id={0} prefetchHigh={1} prefetchLow={2} transacted={3}", - channelId, prefetchHigh, prefetchLow, transacted)); - try - { - CreateChannelOverWire(channelId, prefetchHigh, prefetchLow, transacted); - } - catch (AMQException e) - { - _protocolSession.RemoveSessionByChannel(channelId); - DeregisterSession(channelId); - throw new AMQException("Error reopening channel " + channelId + " after failover: " + e); - } - } - - void CreateChannelOverWire(ushort channelId, int prefetchHigh, int prefetchLow, bool transacted) - { - _protocolWriter.SyncWrite(ChannelOpenBody.CreateAMQFrame(channelId, null), typeof (ChannelOpenOkBody)); - - // Don't use the BasicQos frame if connecting to OpenAMQ (at it is not support). We - // know this when we connection using AMQP 0.7 - if (ProtocolInitiation.CURRENT_PROTOCOL_VERSION_MAJOR != 7) - { - // Basic.Qos frame appears to not be supported by OpenAMQ 1.0d. - _protocolWriter.SyncWrite(BasicQosBody.CreateAMQFrame(channelId, 0, (ushort)prefetchHigh, false), typeof (BasicQosOkBody)); - } - - if (transacted) - { - if (_log.IsDebugEnabled) - { - _log.Debug("Issuing TxSelect for " + channelId); - } - _protocolWriter.SyncWrite(TxSelectBody.CreateAMQFrame(channelId), typeof(TxSelectOkBody)); - } - } - - public String toURL() - { - return _connectionInfo.AsUrl(); - } - - class HeartBeatThread - { - int _heartbeatMillis; - IProtocolWriter _protocolWriter; - bool _run = true; - - public HeartBeatThread(IProtocolWriter protocolWriter, int heartbeatMillis) - { - _protocolWriter = protocolWriter; - _heartbeatMillis = heartbeatMillis; - } - - public void Run() - { - while (_run) - { - Thread.Sleep(_heartbeatMillis); - if (!_run) break; - _log.Debug("Sending heartbeat"); - // TODO: Can we optimise this so that heartbeats are only written when we haven't sent anything recently to the broker? - _protocolWriter.Write(HeartbeatBody.FRAME); - } - _log.Debug("Heatbeat thread stopped"); - } - - public void Stop() - { - _run = false; - } - } - - public void StartHeartBeatThread(int heartbeatSeconds) - { - _log.Debug("Starting new heartbeat thread"); - _heartBeatRunner = new HeartBeatThread(ProtocolWriter, heartbeatSeconds * 1000); - _heartBeatThread = new Thread(new ThreadStart(_heartBeatRunner.Run)); - _heartBeatThread.Name = "HeartBeat"; - _heartBeatThread.Start(); - } - - public void StopHeartBeatThread() - { - if (_heartBeatRunner != null) - { - _log.Debug("Stopping old heartbeat thread"); - _heartBeatRunner.Stop(); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs b/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs deleted file mode 100644 index c8a48814bb..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs +++ /dev/null @@ -1,38 +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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Client -{ - [Serializable] - public class AMQConnectionException : AMQException - { - public AMQConnectionException(String message, Exception e) : base(message, e) - { - } - - protected AMQConnectionException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs b/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs deleted file mode 100644 index 07ce3c2354..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs +++ /dev/null @@ -1,234 +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. - * - */ -using System; - -namespace Apache.Qpid.Client -{ - public abstract class AMQDestination - { - protected readonly string _exchangeName; - protected readonly string _exchangeClass; - protected readonly string _destinationName; - protected readonly bool _isExclusive; - protected readonly bool _isAutoDelete; - protected bool _isDurable; - - public bool IsDurable - { - - get { return _isDurable; } - } - - protected string _queueName; - - protected AMQDestination(String exchangeName, String exchangeClass, String destinationName, bool isExclusive, - bool isAutoDelete, String queueName) - { - // XXX: This is ugly - OnlyRequired because of ReplyToDestination. -// if (destinationName == null) -// { -// throw new ArgumentNullException("destinationName"); -// } - - // XXX: This is ugly - OnlyRequired because of SendingDestinationAdapter. -// if (exchangeName == null) -// { -// throw new ArgumentNullException("exchangeName"); -// } - - // XXX: This is ugly - OnlyRequired because of SendingDestinationAdapter. -// if (exchangeClass == null) -// { -// throw new ArgumentNullException("exchangeClass"); -// } - - _exchangeName = exchangeName; - _exchangeClass = exchangeClass; - _destinationName = destinationName; - _isExclusive = isExclusive; - _isAutoDelete = isAutoDelete; - _queueName = queueName; - } - - public string Name - { - get - { - return _destinationName; - } - } - - public abstract string RoutingKey - { - get; - } - - public abstract string EncodedName - { - get; - } - - public bool AutoDelete - { - get - { - return _isAutoDelete; - } - } - - public string QueueName - { - get - { - return _queueName; - } - set - { - _queueName = value; - } - } - - public string ExchangeName - { - get - { - return _exchangeName; - } - } - - public string ExchangeClass - { - get - { - return _exchangeClass; - } - } - - public bool IsExclusive - { - get - { - return _isExclusive; - } - } - - public bool IsAutoDelete - { - get - { - return _isAutoDelete; - } - } - - public override string ToString() - { - return "Destination: " + _destinationName + ", " + - "Queue Name: " + _queueName + ", Exchange: " + _exchangeName + - ", Exchange class: " + _exchangeClass + ", Exclusive: " + _isExclusive + - ", AutoDelete: " + _isAutoDelete; // +", Routing Key: " + RoutingKey; - } - - public override bool Equals(object o) - { - if (this == o) - { - return true; - } - if (o == null || GetType() != o.GetType()) - { - return false; - } - - AMQDestination that = (AMQDestination) o; - - if (!StringsNotEqualNullSafe(_destinationName, that._destinationName)) - { - return false; - } - if (!StringsNotEqualNullSafe(_exchangeClass, that._exchangeClass)) - { - return false; - } - if (!StringsNotEqualNullSafe(_exchangeName, that._exchangeName)) - { - return false; - } - if (!StringsNotEqualNullSafe(_queueName, that._queueName)) - { - return false; - } - if (_isExclusive != that._isExclusive) - { - return false; - } - if (_isAutoDelete != that._isAutoDelete) - { - return false; - } - return true; - } - - private bool StringsNotEqualNullSafe(string one, string two) - { - if ((one == null && two != null) || - (one != null && !one.Equals(two))) - { - return false; - } - else - { - return true; - } - } - - public override int GetHashCode() - { - int result; - if (_exchangeName == null) - { - result = "".GetHashCode(); - } - else - { - result = _exchangeName.GetHashCode(); - } - if (_exchangeClass != null) - { - result = 29 * result + _exchangeClass.GetHashCode(); - } - if (_destinationName != null) - { - result = 29 * result + _destinationName.GetHashCode(); - } - if (_queueName != null) - { - result = 29 * result + _queueName.GetHashCode(); - } - result = result * (_isExclusive ? 13 : 7); - result = result * (_isAutoDelete ? 13 : 7); - - Console.WriteLine("FIXME HashCode for " + this + " = " + result); - return result; - } - - public abstract bool IsNameRequired { get; } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs b/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs deleted file mode 100644 index 5c9dd86c53..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs +++ /dev/null @@ -1,45 +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. - * - */ -using System; -using System.Runtime.Serialization; -using Apache.Qpid.Common; -using Apache.Qpid.Protocol; - -namespace Apache.Qpid.Client -{ - [Serializable] - public class AMQNoConsumersException : AMQUndeliveredException - { - public AMQNoConsumersException(string message) - : this(message, null) - { - } - - public AMQNoConsumersException(string message, object bounced) - : base(AMQConstant.NO_CONSUMERS.Code, message, bounced) - { - } - protected AMQNoConsumersException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs b/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs deleted file mode 100644 index 5868d78f32..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs +++ /dev/null @@ -1,46 +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. - * - */ -using System; -using System.Runtime.Serialization; -using Apache.Qpid.Common; -using Apache.Qpid.Protocol; - -namespace Apache.Qpid.Client -{ - [Serializable] - public class AMQNoRouteException : AMQUndeliveredException - { - public AMQNoRouteException(string message) - : this(message, null) - { - } - - public AMQNoRouteException(string message, object bounced) - : base(AMQConstant.NO_ROUTE.Code, message, bounced) - { - } - - protected AMQNoRouteException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs b/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs deleted file mode 100644 index 591c5b941f..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs +++ /dev/null @@ -1,322 +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. - * - */ -using System; -using System.Collections; -using System.Text; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client -{ - public class AmqBrokerInfo : IBrokerInfo - { - public readonly string URL_FORMAT_EXAMPLE = - "://[:][?

- ///

- ///
CRC Card
Responsibilities Collaborations - ///
Declare queues. - ///
Declare exchanges. - ///
Bind queues to exchanges. - ///
Create messages. - ///
Set up message consumers on the channel. - ///
Set up message producers on the channel. - ///
Commit the current transaction. - ///
Roll-back the current transaction. - ///
Close the channel. - ///
- ///

- public class AmqChannel : Closeable, IChannel - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(AmqChannel)); - - internal const int BASIC_CONTENT_TYPE = 60; - - public const int DEFAULT_PREFETCH_HIGH_MARK = 5000; - - public const int DEFAULT_PREFETCH_LOW_MARK = 2500; - - private static int _nextSessionNumber = 0; - - private AMQConnection _connection; - - private int _sessionNumber; - - private bool _suspended; - - private object _suspensionLock = new object(); - - // Used in the consume method. We generate the consume tag on the client so that we can use the nowait feature. - private int _nextConsumerNumber = 1; - - private bool _transacted; - - private AcknowledgeMode _acknowledgeMode; - - private ushort _channelId; - - private int _defaultPrefetchHighMark = DEFAULT_PREFETCH_HIGH_MARK; - - private int _defaultPrefetchLowMark = DEFAULT_PREFETCH_LOW_MARK; - - private FlowControlQueue _queue; - - private Dispatcher _dispatcher; - - private MessageFactoryRegistry _messageFactoryRegistry; - - /// Holds all of the producers created by this channel. - private Hashtable _producers = Hashtable.Synchronized(new Hashtable()); - - /// Holds all of the consumers created by this channel. - private Hashtable _consumers = Hashtable.Synchronized(new Hashtable()); - - private ArrayList _replayFrames = new ArrayList(); - - /// - /// The counter of the _next producer id. This id is generated by the session and used only to allow the - /// producer to identify itself to the session when deregistering itself. - /// - /// Access to this id does not require to be synchronized since according to the JMS specification only one - /// thread of control is allowed to create producers for any given session instance. - /// - private long _nextProducerId; - - /// - /// Initializes a new instance of the class. - /// - /// The connection. - /// The channel id. - /// if set to true [transacted]. - /// The acknowledge mode. - /// Default prefetch high value - /// Default prefetch low value - internal AmqChannel(AMQConnection con, ushort channelId, bool transacted, AcknowledgeMode acknowledgeMode, - int defaultPrefetchHigh, int defaultPrefetchLow) - : this() - { - _sessionNumber = Interlocked.Increment(ref _nextSessionNumber); - _connection = con; - _transacted = transacted; - - if ( transacted ) - { - _acknowledgeMode = AcknowledgeMode.SessionTransacted; - } - else - { - _acknowledgeMode = acknowledgeMode; - } - - _channelId = channelId; - _defaultPrefetchHighMark = defaultPrefetchHigh; - _defaultPrefetchLowMark = defaultPrefetchLow; - - if ( _acknowledgeMode == AcknowledgeMode.NoAcknowledge ) - { - _queue = new FlowControlQueue(_defaultPrefetchLowMark, _defaultPrefetchHighMark, - new ThresholdMethod(OnPrefetchLowMark), - new ThresholdMethod(OnPrefetchHighMark)); - } - else - { - // low and upper are the same - _queue = new FlowControlQueue(_defaultPrefetchHighMark, _defaultPrefetchHighMark, - null, null); - } - } - - private AmqChannel() - { - _messageFactoryRegistry = MessageFactoryRegistry.NewDefaultRegistry(); - } - - /// - /// Acknowledge mode for messages received. - /// - public AcknowledgeMode AcknowledgeMode - { - get - { - CheckNotClosed(); - return _acknowledgeMode; - } - } - - /// - /// True if the channel should use transactions. - /// - public bool Transacted - { - get - { - CheckNotClosed(); - return _transacted; - } - } - - /// - /// Prefetch value to be used as the default for - /// consumers created on this channel. - /// - public int DefaultPrefetch - { - get { return DefaultPrefetchHigh; } - } - - /// - /// Prefetch low value to be used as the default for - /// consumers created on this channel. - /// - public int DefaultPrefetchLow - { - get { return _defaultPrefetchLowMark; } - } - - /// - /// Prefetch high value to be used as the default for - /// consumers created on this channel. - /// - public int DefaultPrefetchHigh - { - get { return _defaultPrefetchHighMark; } - } - - /// Indicates whether or not this channel is currently suspended. - public bool IsSuspended - { - get { return _suspended; } - } - - /// Provides the channels number within the the connection. - public ushort ChannelId - { - get { return _channelId; } - } - - /// Provides the connection that this channel runs over. - public AMQConnection Connection - { - get { return _connection; } - } - - /// - /// Declare a new exchange. - /// - /// Name of the exchange - /// Class of the exchange, from - public void DeclareExchange(String exchangeName, String exchangeClass) - { - _logger.Debug(string.Format("DeclareExchange vame={0} exchangeClass={1}", exchangeName, exchangeClass)); - - DeclareExchange(_channelId, 0, exchangeName, exchangeClass, false, false, false, false, true, null); - } - - /// - /// Declare a new exchange using the default exchange class. - /// - /// Name of the exchange - public void DeleteExchange(string exchangeName) - { - throw new NotImplementedException(); - } - - /// - /// Declare a new queue with the specified set of arguments. - /// - /// Name of the queue - /// True if the queue should be durable - /// True if the queue should be exclusive to this channel - /// True if the queue should be deleted when the channel closes - public void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete) - { - DoQueueDeclare(queueName, isDurable, isExclusive, isAutoDelete, null); - } - - /// - /// Declare a new queue with the specified set of arguments. - /// - /// Name of the queue - /// True if the queue should be durable - /// True if the queue should be exclusive to this channel - /// True if the queue should be deleted when the channel closes - /// Optional arguments to Queue.Declare - public void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete, IFieldTable args) - { - DoQueueDeclare(queueName, isDurable, isExclusive, isAutoDelete, args); - } - - /// - /// Delete a queue with the specifies arguments. - /// - /// Name of the queue to delete - /// If true, the queue will not deleted if it has no consumers - /// If true, the queue will not deleted if it has no messages - /// If true, the server will not respond to the method - public void DeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait) - { - DoDeleteQueue(queueName, ifUnused, ifEmpty, noWait); - } - - /// - /// Generate a new Unique name to use for a queue. - /// - /// A unique name to this channel - public string GenerateUniqueName() - { - string result = _connection.ProtocolSession.GenerateQueueName(); - return Regex.Replace(result, "[^a-z0-9_]", "_"); - } - - /// - /// Removes all messages from a queue. - /// - /// Name of the queue to delete - /// If true, the server will not respond to the method - public void PurgeQueue(string queueName, bool noWait) - { - DoPurgeQueue(queueName, noWait); - } - - /// - /// Bind a queue to the specified exchange. - /// - /// Name of queue to bind - /// Name of exchange to bind to - /// Routing key - public void Bind(string queueName, string exchangeName, string routingKey) - { - DoBind(queueName, exchangeName, routingKey, new FieldTable()); - } - - /// - /// Bind a queue to the specified exchange. - /// - /// Name of queue to bind - /// Name of exchange to bind to - /// Routing key - /// Table of arguments for the binding. Used to bind with a Headers Exchange - public void Bind(string queueName, string exchangeName, string routingKey, IFieldTable args) - { - DoBind(queueName, exchangeName, routingKey, (FieldTable)args); - } - - /// - /// Create a new empty message with no body. - /// - /// The new message - public IMessage CreateMessage() - { - return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream"); - } - - /// - /// Create a new message of the specified MIME type. - /// - /// The mime type to create - /// The new message - public IMessage CreateMessage(string mimeType) - { - return _messageFactoryRegistry.CreateMessage(mimeType); - } - - /// - /// Creates a new message for bytes (application/octet-stream). - /// - /// The new message - public IBytesMessage CreateBytesMessage() - { - return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream"); - } - - /// - /// Creates a new text message (text/plain) with empty content. - /// - /// The new message - public ITextMessage CreateTextMessage() - { - return CreateTextMessage(String.Empty); - } - - /// - /// Creates a new text message (text/plain) with a body. - /// - /// Initial body of the message - /// The new message - public ITextMessage CreateTextMessage(string text) - { - ITextMessage msg = (ITextMessage)_messageFactoryRegistry.CreateMessage("text/plain"); - msg.Text = text; - return msg; - } - - /// - /// Creates a new Consumer using the builder pattern. - /// - /// Name of queue to receive messages from - /// The builder object - public MessageConsumerBuilder CreateConsumerBuilder(string queueName) - { - return new MessageConsumerBuilder(this, queueName); - } - - /// - /// Creates a new consumer. - /// - /// Name of queue to receive messages from - /// Low prefetch value - /// High prefetch value - /// If true, messages sent on this channel will not be received by this consumer - /// If true, the consumer opens the queue in exclusive mode - /// The new consumer - public IMessageConsumer CreateConsumer(string queueName, - int prefetchLow, - int prefetchHigh, - bool noLocal, - bool exclusive) - { - _logger.Debug(String.Format("CreateConsumer queueName={0} prefetchLow={1} prefetchHigh={2} noLocal={3} exclusive={4} ", - queueName, prefetchLow, prefetchHigh, noLocal, exclusive)); - - return CreateConsumerImpl(queueName, prefetchLow, prefetchHigh, noLocal, exclusive, false); - } - - /// - /// Creates a new consumer. - /// - /// Name of queue to receive messages from - /// Low prefetch value - /// High prefetch value - /// If true, messages sent on this channel will not be received by this consumer - /// If true, the consumer opens the queue in exclusive mode - /// If true, the consumer only browses and does not consume messages - /// The new consumer - public IMessageConsumer CreateConsumer(string queueName, - int prefetchLow, - int prefetchHigh, - bool noLocal, - bool exclusive, - bool browse) - { - _logger.Debug(String.Format("CreateConsumer queueName={0} prefetchLow={1} prefetchHigh={2} noLocal={3} exclusive={4} browse={5}", - queueName, prefetchLow, prefetchHigh, noLocal, exclusive, browse)); - - return CreateConsumerImpl(queueName, prefetchLow, prefetchHigh, noLocal, exclusive, browse); - } - - - /// - /// Unsubscribe from a queue. - /// - /// Subscription name - public void Unsubscribe(String name) - { - throw new NotImplementedException(); - } - - /// - /// Create a new message publisher using the builder pattern. - /// - /// The builder object - public MessagePublisherBuilder CreatePublisherBuilder() - { - return new MessagePublisherBuilder(this); - } - - /// - /// Create a new message publisher. - /// - /// Name of exchange to publish to - /// Routing key - /// Default delivery mode - /// Default TTL time of messages - /// If true, sent immediately - /// If true, the broker will return an error - /// (as a connection exception) if the message cannot be delivered - /// Default message priority - /// The new message publisher - public IMessagePublisher CreatePublisher(string exchangeName, string routingKey, DeliveryMode deliveryMode, - long timeToLive, bool immediate, bool mandatory, int priority) - { - _logger.Debug(string.Format("Using new CreatePublisher exchangeName={0}, exchangeClass={1} routingKey={2}", - exchangeName, "none", routingKey)); - - return CreateProducerImpl(exchangeName, routingKey, deliveryMode, - timeToLive, immediate, mandatory, priority); - } - - /// - /// Recover after transaction failure. - /// - /// The 0-8 protocol does not support this, not implemented exception will always be thrown. - public void Recover() - { - CheckNotClosed(); - CheckNotTransacted(); - - throw new NotImplementedException(); - } - - /// - /// Commit the transaction. - /// - public void Commit() - { - // FIXME: Fail over safety. Needs FailoverSupport? - CheckNotClosed(); - CheckTransacted(); // throws IllegalOperationException if not a transacted session - - try - { - // Acknowledge up to message last delivered (if any) for each consumer. - // Need to send ack for messages delivered to consumers so far. - foreach (BasicMessageConsumer consumer in _consumers.Values) - { - // Sends acknowledgement to server. - consumer.AcknowledgeDelivered(); - } - - // Commits outstanding messages sent and outstanding acknowledgements. - _connection.ConvenientProtocolWriter.SyncWrite(TxCommitBody.CreateAMQFrame(_channelId), typeof(TxCommitOkBody)); - } - catch (AMQException e) - { - throw new QpidException("Failed to commit", e); - } - } - - /// - /// Rollback the transaction. - /// - public void Rollback() - { - lock (_suspensionLock) - { - CheckTransacted(); // throws IllegalOperationException if not a transacted session - - try - { - bool suspended = IsSuspended; - if (!suspended) - { - Suspend(true); - } - - // Reject up to message last delivered (if any) for each consumer. - // Need to send reject for messages delivered to consumers so far. - foreach (BasicMessageConsumer consumer in _consumers.Values) - { - // Sends acknowledgement to server. - consumer.RejectUnacked(); - } - - _connection.ConvenientProtocolWriter.SyncWrite(TxRollbackBody.CreateAMQFrame(_channelId), typeof(TxRollbackOkBody)); - - if ( !suspended ) - { - Suspend(false); - } - } - catch (AMQException e) - { - throw new QpidException("Failed to rollback", e); - } - } - } - - /// - /// Create a disconnected channel that will fault - /// for most things, but is useful for testing - /// - /// A new disconnected channel - public static IChannel CreateDisconnectedChannel() - { - return new AmqChannel(); - } - - public override void Close() - { - lock (_connection.FailoverMutex) - { - // We must close down all producers and consumers in an orderly fashion. This is the only method - // that can be called from a different thread of control from the one controlling the session - - lock (_closingLock) - { - SetClosed(); - - // we pass null since this is not an error case - CloseProducersAndConsumers(null); - - try - { - _connection.CloseSession(this); - } - catch (AMQException e) - { - throw new QpidException("Error closing session: " + e); - } - finally - { - _connection.DeregisterSession(_channelId); - } - } - } - } - - /** - * Called when the server initiates the closure of the session - * unilaterally. - * @param e the exception that caused this session to be closed. Null causes the - */ - public void ClosedWithException(Exception e) - { - lock (_connection.FailoverMutex) - { - // An AMQException has an error code and message already and will be passed in when closure occurs as a - // result of a channel close request - SetClosed(); - AMQException amqe; - - if (e is AMQException) - { - amqe = (AMQException) e; - } - else - { - amqe = new AMQException("Closing session forcibly", e); - } - - _connection.DeregisterSession(_channelId); - CloseProducersAndConsumers(amqe); - } - } - - public void MessageReceived(UnprocessedMessage message) - { - if (_logger.IsDebugEnabled) - { - _logger.Debug("Message received in session with channel id " + _channelId); - } - - if ( message.DeliverBody == null ) - { - ReturnBouncedMessage(message); - } - else - { - _queue.Enqueue(message); - } - } - - public void Dispose() - { - Close(); - } - - private void SetClosed() - { - Interlocked.Exchange(ref _closed, CLOSED); - } - - /// - /// Close all producers or consumers. This is called either in the error case or when closing the session normally. - /// the exception, may be null to indicate no error has occurred - /// - private void CloseProducersAndConsumers(AMQException amqe) - { - try - { - CloseProducers(); - } - catch (QpidException e) - { - _logger.Error("Error closing session: " + e, e); - } - try - { - CloseConsumers(amqe); - } - catch (QpidException e) - { - _logger.Error("Error closing session: " + e, e); - } - } - - /// - /// Called to close message producers cleanly. This may or may not be as a result of an error. There is - /// currently no way of propagating errors to message producers (this is a JMS limitation). - /// - private void CloseProducers() - { - _logger.Debug("Closing producers on session " + this); - - // we need to clone the list of producers since the close() method updates the _producers collection - // which would result in a concurrent modification exception - ArrayList clonedProducers = new ArrayList(_producers.Values); - - foreach (BasicMessageProducer prod in clonedProducers) - { - _logger.Debug("Closing producer " + prod); - prod.Close(); - } - - // at this point the _producers map is empty - } - - /// - /// Called to close message consumers cleanly. This may or may not be as a result of an error. - /// not null if this is a result of an error occurring at the connection level - private void CloseConsumers(Exception error) - { - if (_dispatcher != null) - { - _dispatcher.StopDispatcher(); - } - - // we need to clone the list of consumers since the close() method updates the _consumers collection - // which would result in a concurrent modification exception - ArrayList clonedConsumers = new ArrayList(_consumers.Values); - - foreach (BasicMessageConsumer con in clonedConsumers) - { - if (error != null) - { - con.NotifyError(error); - } - else - { - con.Close(); - } - } - - // at this point the _consumers map will be empty - } - - private IMessagePublisher CreateProducerImpl(string exchangeName, string routingKey, - DeliveryMode deliveryMode, - long timeToLive, bool immediate, bool mandatory, int priority) - { - lock (_closingLock) - { - CheckNotClosed(); - - try - { - return new BasicMessageProducer(exchangeName, routingKey, _transacted, _channelId, - this, GetNextProducerId(), - deliveryMode, timeToLive, immediate, mandatory, priority); - } - catch (AMQException e) - { - _logger.Error("Error creating message producer: " + e, e); - throw new QpidException("Error creating message producer", e); - } - } - } - - /// Creates a message consumer on this channel. - /// - /// The name of the queue to attach the consumer to. - /// The pre-fetch buffer low-water mark. - /// The pre-fetch buffer high-water mark. - /// The no-local flag, true means that the consumer does not receive messages sent on this channel. - /// The exclusive flag, true gives this consumer exclusive receive access to the queue. - /// - /// The message consumer. - private IMessageConsumer CreateConsumerImpl(string queueName, - int prefetchLow, - int prefetchHigh, - bool noLocal, - bool exclusive, - bool browse) - { - lock (_closingLock) - { - CheckNotClosed(); - - BasicMessageConsumer consumer = new BasicMessageConsumer(_channelId, queueName, noLocal, - _messageFactoryRegistry, this, - prefetchHigh, prefetchLow, exclusive, - browse); - try - { - RegisterConsumer(consumer); - } - catch (AMQException e) - { - throw new QpidException("Error registering consumer: " + e, e); - } - - return consumer; - } - } - - private void CheckTransacted() - { - if (!Transacted) - { - throw new InvalidOperationException("Channel is not transacted"); - } - } - - private void CheckNotTransacted() - { - if (Transacted) - { - throw new InvalidOperationException("Channel is transacted"); - } - } - - internal void Start() - { - _dispatcher = new Dispatcher(this); - Thread dispatcherThread = new Thread(new ThreadStart(_dispatcher.RunDispatcher)); - dispatcherThread.IsBackground = true; - dispatcherThread.Start(); - } - - internal void Stop() - { - Suspend(true); - if (_dispatcher != null) - { - _dispatcher.StopDispatcher(); - } - } - - internal void RegisterConsumer(string consumerTag, IMessageConsumer consumer) - { - _consumers[consumerTag] = consumer; - } - - /// - /// Called by the MessageConsumer when closing, to deregister the consumer from the - /// map from consumerTag to consumer instance. - /// - /// the consumer tag, that was broker-generated - internal void DeregisterConsumer(string consumerTag) - { - _consumers.Remove(consumerTag); - } - - internal void RegisterProducer(long producerId, IMessagePublisher publisher) - { - _producers[producerId] = publisher; - } - - internal void DeregisterProducer(long producerId) - { - _producers.Remove(producerId); - } - - private long GetNextProducerId() - { - return ++_nextProducerId; - } - - /** - * Called to mark the session as being closed. Useful when the session needs to be made invalid, e.g. after - * failover when the client has veoted resubscription. - * - * The caller of this method must already hold the failover mutex. - */ - internal void MarkClosed() - { - SetClosed(); - _connection.DeregisterSession(_channelId); - MarkClosedProducersAndConsumers(); - } - - private void MarkClosedProducersAndConsumers() - { - try - { - // no need for a markClosed* method in this case since there is no protocol traffic closing a producer - CloseProducers(); - } - catch (QpidException e) - { - _logger.Error("Error closing session: " + e, e); - } - try - { - MarkClosedConsumers(); - } - catch (QpidException e) - { - _logger.Error("Error closing session: " + e, e); - } - } - - private void MarkClosedConsumers() - { - if (_dispatcher != null) - { - _dispatcher.StopDispatcher(); - } - // we need to clone the list of consumers since the close() method updates the _consumers collection - // which would result in a concurrent modification exception - ArrayList clonedConsumers = new ArrayList(_consumers.Values); - - foreach (BasicMessageConsumer consumer in clonedConsumers) - { - consumer.MarkClosed(); - } - // at this point the _consumers map will be empty - } - - private void DoPurgeQueue(string queueName, bool noWait) - { - try - { - _logger.DebugFormat("PurgeQueue {0}", queueName); - - AMQFrame purgeQueue = QueuePurgeBody.CreateAMQFrame(_channelId, 0, queueName, noWait); - - if (noWait) - _connection.ProtocolWriter.Write(purgeQueue); - else - _connection.ConvenientProtocolWriter.SyncWrite(purgeQueue, typeof(QueuePurgeOkBody)); - } - catch (AMQException) - { - throw; - } - } - - /** - * Replays frame on fail over. - * - * @throws AMQException - */ - internal void ReplayOnFailOver() - { - _logger.Debug(string.Format("Replaying frames for channel {0}", _channelId)); - foreach (AMQFrame frame in _replayFrames) - { - _logger.Debug(string.Format("Replaying frame=[{0}]", frame)); - _connection.ProtocolWriter.Write(frame); - } - } - - /// - /// Callers must hold the failover mutex before calling this method. - /// - /// - private void RegisterConsumer(BasicMessageConsumer consumer) - { - // Need to generate a consumer tag on the client so we can exploit the nowait flag. - String tag = string.Format("{0}-{1}", _sessionNumber, _nextConsumerNumber++); - consumer.ConsumerTag = tag; - _consumers.Add(tag, consumer); - - String consumerTag = ConsumeFromQueue(consumer.QueueName, consumer.NoLocal, - consumer.Exclusive, consumer.AcknowledgeMode, tag, consumer.Browse); - - } - - internal void DoBind(string queueName, string exchangeName, string routingKey, FieldTable args) - { - - _logger.Debug(string.Format("QueueBind queueName={0} exchangeName={1} routingKey={2}, arg={3}", - queueName, exchangeName, routingKey, args)); - - AMQFrame queueBind = QueueBindBody.CreateAMQFrame(_channelId, 0, - queueName, exchangeName, - routingKey, false, args); - - - lock (_connection.FailoverMutex) - { - _connection.ConvenientProtocolWriter.SyncWrite(queueBind, typeof(QueueBindOkBody)); - } - // AS FIXME: wasnae me - _replayFrames.Add(QueueBindBody.CreateAMQFrame(_channelId, 0, - queueName, exchangeName, - routingKey, true, args)); - } - - private String ConsumeFromQueue(String queueName, bool noLocal, bool exclusive, AcknowledgeMode acknowledgeMode, String tag, bool browse) - { - FieldTable args = new FieldTable(); - if(browse) - { - args["x-filter-no-consume"] = true; - } - AMQFrame basicConsume = BasicConsumeBody.CreateAMQFrame(_channelId, 0, - queueName, tag, noLocal, - acknowledgeMode == AcknowledgeMode.NoAcknowledge, - exclusive, true, args); - - _replayFrames.Add(basicConsume); - - _connection.ProtocolWriter.Write(basicConsume); - return tag; - } - - private void DoDeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait) - { - try - { - _logger.Debug(string.Format("DeleteQueue name={0}", queueName)); - - AMQFrame queueDelete = QueueDeleteBody.CreateAMQFrame(_channelId, 0, queueName, ifUnused, ifEmpty, noWait); - - if (noWait) - { - _connection.ProtocolWriter.Write(queueDelete); - } - else - { - _connection.ConvenientProtocolWriter.SyncWrite(queueDelete, typeof(QueueDeleteOkBody)); - } - // AS FIXME: wasnae me - _replayFrames.Add(QueueDeleteBody.CreateAMQFrame(_channelId, 0, queueName, ifUnused, ifEmpty, true)); - } - catch (AMQException) - { - throw; - } - } - - private void DoQueueDeclare(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete, IFieldTable args) - { - _logger.Debug(string.Format("DeclareQueue name={0} durable={1} exclusive={2}, auto-delete={3}", - queueName, isDurable, isExclusive, isAutoDelete)); - - AMQFrame queueDeclare = QueueDeclareBody.CreateAMQFrame(_channelId, 0, queueName, false, isDurable, isExclusive, - isAutoDelete, false, (FieldTable) args); - - - lock (_connection.FailoverMutex) - { - _connection.ConvenientProtocolWriter.SyncWrite(queueDeclare, typeof(QueueDeclareOkBody)); - } - // AS FIXME: wasnae me - _replayFrames.Add(QueueDeclareBody.CreateAMQFrame(_channelId, 0, queueName, false, isDurable, isExclusive, - isAutoDelete, true, null)); - } - - // AMQP-level method. - private void DeclareExchange(ushort channelId, ushort ticket, string exchangeName, - string exchangeClass, bool passive, bool durable, - bool autoDelete, bool xinternal, bool noWait, FieldTable args) - { - _logger.Debug(String.Format("DeclareExchange channelId={0} exchangeName={1} exchangeClass={2}", - _channelId, exchangeName, exchangeClass)); - - AMQFrame declareExchange = ExchangeDeclareBody.CreateAMQFrame(channelId, ticket, exchangeName, exchangeClass, passive, - durable, autoDelete, xinternal, noWait, args); - - if (noWait) - { - lock (_connection.FailoverMutex) - { - _connection.ProtocolWriter.Write(declareExchange); - } - // AS FIXME: wasnae me - _replayFrames.Add(declareExchange); - } - else - { - throw new NotImplementedException("Don't use nowait=false with DeclareExchange"); - //_connection.ConvenientProtocolWriter.SyncWrite(declareExchange, typeof (ExchangeDeclareOkBody)); - } - } - - /** - * Acknowledge a message or several messages. This method can be called via AbstractJMSMessage or from - * a BasicConsumer. The former where the mode is CLIENT_ACK and the latter where the mode is - * AUTO_ACK or similar. - * - * @param deliveryTag the tag of the last message to be acknowledged - * @param multiple if true will acknowledge all messages up to and including the one specified by the - * delivery tag - */ - internal void AcknowledgeMessage(ulong deliveryTag, bool multiple) - { - AMQFrame ackFrame = BasicAckBody.CreateAMQFrame(_channelId, deliveryTag, multiple); - if (_logger.IsDebugEnabled) - { - _logger.Debug("Sending ack for delivery tag " + deliveryTag + " on channel " + _channelId); - } - // FIXME: lock FailoverMutex here? - _connection.ProtocolWriter.Write(ackFrame); - } - - public void RejectMessage(ulong deliveryTag, bool requeue) - { - if ((_acknowledgeMode == AcknowledgeMode.ClientAcknowledge) || (_acknowledgeMode == AcknowledgeMode.SessionTransacted)) - { - AMQFrame rejectFrame = BasicRejectBody.CreateAMQFrame(_channelId, deliveryTag, requeue); - _connection.ProtocolWriter.Write(rejectFrame); - } - } - - /// - /// Handle a message that bounced from the server, creating - /// the corresponding exception and notifying the connection about it - /// - /// Unprocessed message - private void ReturnBouncedMessage(UnprocessedMessage message) - { - try - { - AbstractQmsMessage bouncedMessage = - _messageFactoryRegistry.CreateMessage(0, false, message.ContentHeader, message.Bodies); - - int errorCode = message.BounceBody.ReplyCode; - string reason = message.BounceBody.ReplyText; - _logger.Debug("Message returned with error code " + errorCode + " (" + reason + ")"); - AMQException exception; - - if (errorCode == AMQConstant.NO_CONSUMERS.Code) - { - exception = new AMQNoConsumersException(reason, bouncedMessage); - } - else if (errorCode == AMQConstant.NO_ROUTE.Code) - { - exception = new AMQNoRouteException(reason, bouncedMessage); - } - else - { - exception = new AMQUndeliveredException(errorCode, reason, bouncedMessage); - } - - _connection.ExceptionReceived(exception); - } - catch (Exception ex) - { - _logger.Error("Caught exception trying to raise undelivered message exception (dump follows) - ignoring...", ex); - } - } - - private void OnPrefetchLowMark(int count) - { - if (_acknowledgeMode == AcknowledgeMode.NoAcknowledge) - { - _logger.Warn("Below threshold(" + _defaultPrefetchLowMark + ") so unsuspending channel. Current value is " + count); - Suspend(false); - } - } - - private void OnPrefetchHighMark(int count) - { - if (_acknowledgeMode == AcknowledgeMode.NoAcknowledge) - { - _logger.Warn("Above threshold(" + _defaultPrefetchHighMark + ") so suspending channel. Current value is " + count); - Suspend(true); - } - } - - private void Suspend(bool suspend) - { - lock (_suspensionLock) - { - if (_logger.IsDebugEnabled) - { - _logger.Debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended")); - } - - _suspended = suspend; - AMQFrame frame = ChannelFlowBody.CreateAMQFrame(_channelId, !suspend); - - Connection.ConvenientProtocolWriter.SyncWrite(frame, typeof(ChannelFlowOkBody)); - } - } - - /// A Dispatcher turns the consumption of incoming messages from an arrival queue, into event notifications on consumers. - /// The arrival queue is typically a blocking queue, on which a dispatcher waits for messages to consume. Upon receipt of a message - /// the dispatcher finds the consumer that is listening to the queue to which the message has been send and notifies it of the new - /// message. - /// - ///

The Dispatcher also contains logic to recognize bounced messages. Bounced messages returned from the broker can be - /// told apart from regular deliveries because they do not have a delivery queue set on them. When the dispatcher receives a - /// bounced message it creates an exception and notifies the connection, to which its containing channel belongs, of the condition. - /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Notify consumers of message arrivals on their queues. - ///
Notify the containing connection of bounced message arrivals. - ///
- ///

- /// - /// Stop mechanism seems wrong, as queue consume is evaluated after stop flag, so could consume and notify one more message. - /// Placing stop check after consume may also be wrong as it may cause a message to be thrown away. Seems more correct to use interupt on - /// the block thread to cause it to prematurely return from its wait, whereupon it can be made to re-check the stop flag. - /// - /// Exception swallowed, if there is an exception whilst notifying the connection on bounced messages. Unhandled excetpion should - /// fall through and terminate the loop, as it is a bug if it occurrs. - private class Dispatcher - { - /// Flag used to indicate when this dispatcher is to be stopped (0=go, 1=stop). - private int _stopped = 0; - - /// The channel for which this is a dispatcher. - private AmqChannel _containingChannel; - - /// Creates a dispatcher on the specified channel. - /// - /// The channel on which this is a dispatcher. - public Dispatcher(AmqChannel containingChannel) - { - _containingChannel = containingChannel; - } - - /// The message dispatch loop. Consumes messages from the channels queue, notifying consumers of regular deliveries, and - /// the connection of bounced messages. - public void RunDispatcher() - { - UnprocessedMessage message; - - while (_stopped == 0 && (message = (UnprocessedMessage)_containingChannel._queue.Dequeue()) != null) - { - if (message.DeliverBody != null) - { - BasicMessageConsumer consumer = (BasicMessageConsumer) _containingChannel._consumers[message.DeliverBody.ConsumerTag]; - - if (consumer == null) - { - _logger.Warn("Received a message from queue " + message.DeliverBody.ConsumerTag + " without a f - ignoring..."); - } - else - { - consumer.NotifyMessage(message, _containingChannel.ChannelId); - } - } - else - { - try - { - // Bounced message is processed here, away from the transport thread - AbstractQmsMessage bouncedMessage = _containingChannel._messageFactoryRegistry. - CreateMessage(0, false, message.ContentHeader, message.Bodies); - - int errorCode = message.BounceBody.ReplyCode; - string reason = message.BounceBody.ReplyText; - - _logger.Debug("Message returned with error code " + errorCode + " (" + reason + ")"); - - _containingChannel._connection.ExceptionReceived(new AMQUndeliveredException(errorCode, "Error: " + reason, bouncedMessage)); - } - catch (Exception e) - { - _logger.Error("Caught exception trying to raise undelivered message exception (dump follows) - ignoring...", e); - } - } - } - - _logger.Debug("Dispatcher thread terminating for channel: " + _containingChannel._channelId + "."); - } - - /// Sets a stop flag on this dispatcher, which causes its dispatch loop to exit at the next available opportunity. - public void StopDispatcher() - { - Interlocked.Exchange(ref _stopped, 1); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs b/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs deleted file mode 100644 index fdac5e75f2..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs +++ /dev/null @@ -1,485 +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. - * - */ -using System; -using System.Threading; -using System.Collections; -using System.Collections.Generic; -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Collections; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client -{ - public class BasicMessageConsumer : Closeable, IMessageConsumer - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicMessageConsumer)); - - private bool _noLocal; - - /** Holds the exclusive status flag for the consumers access to its queue. */ - private bool _exclusive; - - public bool Exclusive - { - get { return _exclusive; } - } - - private bool _browse; - - public bool Browse - { - get { return _browse; } - } - - public bool NoLocal - { - get { return _noLocal; } - set { _noLocal = value; } - } - - private AcknowledgeMode _acknowledgeMode; - - public AcknowledgeMode AcknowledgeMode - { - get { return _acknowledgeMode; } - } - - private MessageReceivedDelegate _messageListener; - - private bool IsMessageListenerSet - { - get { return _messageListener != null; } - } - - /// - /// The consumer tag allows us to close the consumer by sending a jmsCancel method to the - /// broker - /// - private string _consumerTag; - - /// - /// We need to know the channel id when constructing frames - /// - private ushort _channelId; - - private readonly string _queueName; - - /// - /// Protects the setting of a messageListener - /// - private readonly object _syncLock = new object(); - - /// - /// We store the high water prefetch field in order to be able to reuse it when resubscribing in the event of failover - /// - private int _prefetchHigh; - - /// - /// We store the low water prefetch field in order to be able to reuse it when resubscribing in the event of failover - /// - private int _prefetchLow; - - /// - /// When true indicates that either a message listener is set or that - /// a blocking receive call is in progress - /// - private bool _receiving; - - /// - /// Used in the blocking receive methods to receive a message from - /// the Channel thread. - /// - private readonly ConsumerProducerQueue _messageQueue = new ConsumerProducerQueue(); - - private MessageFactoryRegistry _messageFactory; - - private AmqChannel _channel; - - // - // Tag of last message delievered, whoch should be acknowledged on commit in transaction mode. - // - //private long _lastDeliveryTag; - - /// - /// Explicit list of all received but un-acked messages in a transaction. Used to ensure acking is completed when transaction is committed. - /// - private LinkedList _receivedDeliveryTags; - - /// - /// Number of messages unacknowledged in DUPS_OK_ACKNOWLEDGE mode - /// - private int _outstanding; - - /// - /// Switch to enable sending of acknowledgements when using DUPS_OK_ACKNOWLEDGE mode. - /// Enabled when _outstannding number of msgs >= _prefetchHigh and disabled at < _prefetchLow - /// - private bool _dups_ok_acknowledge_send; - - internal BasicMessageConsumer(ushort channelId, string queueName, bool noLocal, - MessageFactoryRegistry messageFactory, AmqChannel channel, - int prefetchHigh, int prefetchLow, bool exclusive, bool browse) - { - _channelId = channelId; - _queueName = queueName; - _noLocal = noLocal; - _messageFactory = messageFactory; - _channel = channel; - _acknowledgeMode = _channel.AcknowledgeMode; - _prefetchHigh = prefetchHigh; - _prefetchLow = prefetchLow; - _exclusive = exclusive; - _browse = browse; - - if (_acknowledgeMode == AcknowledgeMode.SessionTransacted) - { - _receivedDeliveryTags = new LinkedList(); - } - } - - #region IMessageConsumer Members - - public MessageReceivedDelegate OnMessage - { - get - { - return _messageListener; - } - set - { - CheckNotClosed(); - - lock (_syncLock) - { - // If someone is already receiving - if (_messageListener != null && _receiving) - { - throw new InvalidOperationException("Another thread is already receiving..."); - } - - _messageListener = value; - - _receiving = (_messageListener != null); - - if (_receiving) - { - _logger.Debug("Message listener set for queue with name " + _queueName); - } - } - } - } - - public IMessage Receive(long delay) - { - CheckNotClosed(); - - lock (_syncLock) - { - // If someone is already receiving - if (_receiving) - { - throw new InvalidOperationException("Another thread is already receiving (possibly asynchronously)..."); - } - - _receiving = true; - } - - try - { - object o = _messageQueue.Dequeue(delay); - - return ReturnMessageOrThrowAndPostDeliver(o); - } - finally - { - lock (_syncLock) - { - _receiving = false; - } - } - } - - private IMessage ReturnMessageOrThrowAndPostDeliver(object o) - { - IMessage m = ReturnMessageOrThrow(o); - if (m != null) - { - PostDeliver(m); - } - return m; - } - - public IMessage Receive() - { - return Receive(Timeout.Infinite); - } - - public IMessage ReceiveNoWait() - { - return Receive(0); - } - - #endregion - - /// - /// We can get back either a Message or an exception from the queue. This method examines the argument and deals - /// with it by throwing it (if an exception) or returning it (in any other case). - /// - /// the object off the queue - /// a message only if o is a Message - /// JMSException if the argument is a throwable. If it is a QpidMessagingException it is rethrown as is, but if not - /// a QpidMessagingException is created with the linked exception set appropriately - private IMessage ReturnMessageOrThrow(object o) - { - // errors are passed via the queue too since there is no way of interrupting the poll() via the API. - if (o is Exception) - { - Exception e = (Exception) o; - throw new QpidException("Message consumer forcibly closed due to error: " + e, e); - } - else - { - return (IMessage) o; - } - } - - #region IDisposable Members - - public void Dispose() - { - Close(); - } - - #endregion - - public override void Close() - { - if (_closed == CLOSED) - { - return; - } - // FIXME: Don't we need FailoverSupport here (as we have SyncWrite). i.e. rather than just locking FailOverMutex - lock (_channel.Connection.FailoverMutex) - { - lock (_closingLock) - { - Interlocked.Exchange(ref _closed, CLOSED); - - AMQFrame cancelFrame = BasicCancelBody.CreateAMQFrame(_channelId, _consumerTag, false); - - try - { - _channel.Connection.ConvenientProtocolWriter.SyncWrite( - cancelFrame, typeof(BasicCancelOkBody)); - } - catch (AMQException e) - { - _logger.Error("Error closing consumer: " + e, e); - throw new QpidException("Error closing consumer: " + e); - } - finally - { - DeregisterConsumer(); - } - } - } - } - - /** - * Called from the AMQSession when a message has arrived for this consumer. This methods handles both the case - * of a message listener or a synchronous receive() caller. - * - * @param messageFrame the raw unprocessed mesage - * @param channelId channel on which this message was sent - */ - internal void NotifyMessage(UnprocessedMessage messageFrame, int channelId) - { - if (_logger.IsDebugEnabled) - { - _logger.Debug("notifyMessage called with message number " + messageFrame.DeliverBody.DeliveryTag); - } - try - { - AbstractQmsMessage jmsMessage = _messageFactory.CreateMessage((long)messageFrame.DeliverBody.DeliveryTag, - messageFrame.DeliverBody.Redelivered, - messageFrame.ContentHeader, - messageFrame.Bodies); - - _logger.Debug("Message is of type: " + jmsMessage.GetType().Name); - - PreDeliver(jmsMessage); - - if (IsMessageListenerSet) - { - // We do not need a lock around the test above, and the dispatch below as it is invalid - // for an application to alter an installed listener while the session is started. -#if __MonoCS__ - _messageListener(jmsMessage); -#else - _messageListener.Invoke(jmsMessage); -#endif - PostDeliver(jmsMessage); - } - else - { - _messageQueue.Enqueue(jmsMessage); - } - } - catch (Exception e) - { - _logger.Error("Caught exception (dump follows) - ignoring...", e); // FIXME - } - } - - - internal void NotifyError(Exception cause) - { - lock (_syncLock) - { - SetClosed(); - - // we have no way of propagating the exception to a message listener - a JMS limitation - so we - // deal with the case where we have a synchronous receive() waiting for a message to arrive - if (_messageListener == null) - { - // offer only succeeds if there is a thread waiting for an item from the queue - _messageQueue.Enqueue(cause); - _logger.Debug("Passed exception to synchronous queue for propagation to receive()"); - } - DeregisterConsumer(); - } - } - - private void SetClosed() - { - Interlocked.Exchange(ref _closed, CLOSED); - } - - /// - /// Perform cleanup to deregister this consumer. This occurs when closing the consumer in both the clean - /// case and in the case of an error occurring. - /// - internal void DeregisterConsumer() - { - _channel.DeregisterConsumer(_consumerTag); - } - - public string ConsumerTag - { - get - { - return _consumerTag; - } - set - { - _consumerTag = value; - } - } - - /** - * Called when you need to invalidate a consumer. Used for example when failover has occurred and the - * client has vetoed automatic resubscription. - * The caller must hold the failover mutex. - */ - internal void MarkClosed() - { - SetClosed(); - DeregisterConsumer(); - } - - public string QueueName - { - get { return _queueName; } - } - - /// - /// Acknowledge up to last message delivered (if any). Used when commiting. - /// - internal void AcknowledgeDelivered() - { - foreach (long tag in _receivedDeliveryTags) - { - _channel.AcknowledgeMessage((ulong)tag, false); - } - - _receivedDeliveryTags.Clear(); - } - - internal void RejectUnacked() - { - foreach (long tag in _receivedDeliveryTags) - { - _channel.RejectMessage((ulong)tag, true); - } - - _receivedDeliveryTags.Clear(); - } - - private void PreDeliver(AbstractQmsMessage msg) - { - switch (AcknowledgeMode) - { - case AcknowledgeMode.PreAcknowledge: - _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, false); - break; - - case AcknowledgeMode.ClientAcknowledge: - // We set the session so that when the user calls acknowledge() it can call the method on session - // to send out the appropriate frame. - //msg.setAMQSession(_session); - msg.Channel = _channel; - break; - } - } - - private void PostDeliver(IMessage m) - { - AbstractQmsMessage msg = (AbstractQmsMessage) m; - switch (AcknowledgeMode) - { - case AcknowledgeMode.DupsOkAcknowledge: - if (++_outstanding >= _prefetchHigh) - { - _dups_ok_acknowledge_send = true; - } - if (_outstanding <= _prefetchLow) - { - _dups_ok_acknowledge_send = false; - } - if (_dups_ok_acknowledge_send) - { - _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, true); - } - break; - - case AcknowledgeMode.AutoAcknowledge: - _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, true); - break; - - case AcknowledgeMode.SessionTransacted: - _receivedDeliveryTags.AddLast(msg.DeliveryTag); - break; - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs b/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs deleted file mode 100644 index f33afc452e..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs +++ /dev/null @@ -1,405 +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. - * - */ -using System; -using System.Threading; -using log4net; -using Apache.Qpid.Buffer; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Messaging; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client -{ - public class BasicMessageProducer : Closeable, IMessagePublisher - { - protected readonly ILog _logger = LogManager.GetLogger(typeof(BasicMessageProducer)); - - /// - /// If true, messages will not get a timestamp. - /// - private bool _disableTimestamps; - - /// - /// Priority of messages created by this producer. - /// - private int _messagePriority; - - /// - /// Time to live of messages. Specified in milliseconds but AMQ has 1 second resolution. - /// - private long _timeToLive; - - /// - /// Delivery mode used for this producer. - /// - private DeliveryMode _deliveryMode; - - private bool _immediate; - private bool _mandatory; - - string _exchangeName; - string _routingKey; - - /// - /// Default encoding used for messages produced by this producer. - /// - private string _encoding; - - /// - /// Default encoding used for message produced by this producer. - /// - private string _mimeType; - - /// - /// True if this producer was created from a transacted session - /// - private bool _transacted; - - private ushort _channelId; - - /// - /// This is an id generated by the session and is used to tie individual producers to the session. This means we - /// can deregister a producer with the session when the producer is closed. We need to be able to tie producers - /// to the session so that when an error is propagated to the session it can close the producer (meaning that - /// a client that happens to hold onto a producer reference will get an error if he tries to use it subsequently). - /// - private long _producerId; - - /// - /// The session used to create this producer - /// - private AmqChannel _channel; - - public BasicMessageProducer(string exchangeName, string routingKey, - bool transacted, - ushort channelId, - AmqChannel channel, - long producerId, - DeliveryMode deliveryMode, - long timeToLive, - bool immediate, - bool mandatory, - int priority) - { - _exchangeName = exchangeName; - _routingKey = routingKey; - _transacted = transacted; - _channelId = channelId; - _channel = channel; - _producerId = producerId; - _deliveryMode = deliveryMode; - _timeToLive = timeToLive; - _immediate = immediate; - _mandatory = mandatory; - _messagePriority = priority; - - _channel.RegisterProducer(producerId, this); - } - - - #region IMessagePublisher Members - - public DeliveryMode DeliveryMode - { - get - { - CheckNotClosed(); - return _deliveryMode; - } - set - { - CheckNotClosed(); - _deliveryMode = value; - } - } - - public string ExchangeName - { - get { return _exchangeName; } - } - - public string RoutingKey - { - get { return _routingKey; } - } - - public bool DisableMessageID - { - get - { - throw new Exception("The method or operation is not implemented."); - } - set - { - throw new Exception("The method or operation is not implemented."); - } - } - - public bool DisableMessageTimestamp - { - get - { - CheckNotClosed(); - return _disableTimestamps; - } - set - { - CheckNotClosed(); - _disableTimestamps = value; - } - } - - public int Priority - { - get - { - CheckNotClosed(); - return _messagePriority; - } - set - { - CheckNotClosed(); - if ( value < 0 || value > 9 ) - { - throw new ArgumentOutOfRangeException("Priority of " + value + " is illegal. Value must be in range 0 to 9"); - } - _messagePriority = value; - } - } - - public override void Close() - { - _logger.Debug("Closing producer " + this); - Interlocked.Exchange(ref _closed, CLOSED); - _channel.DeregisterProducer(_producerId); - } - - public void Send(IMessage msg, DeliveryMode deliveryMode, int priority, long timeToLive) - { - CheckNotClosed(); - SendImpl( - _exchangeName, - _routingKey, - (AbstractQmsMessage)msg, - deliveryMode, - priority, - (uint)timeToLive, - _mandatory, - _immediate - ); - } - - public void Send(IMessage msg) - { - CheckNotClosed(); - SendImpl( - _exchangeName, - _routingKey, - (AbstractQmsMessage)msg, - _deliveryMode, - _messagePriority, - (uint)_timeToLive, - _mandatory, - _immediate - ); - } - - // This is a short-term hack (knowing that this code will be re-vamped sometime soon) - // to facilitate publishing messages to potentially non-existent recipients. - public void Send(IMessage msg, bool mandatory) - { - CheckNotClosed(); - SendImpl( - _exchangeName, - _routingKey, - (AbstractQmsMessage)msg, - _deliveryMode, - _messagePriority, - (uint)_timeToLive, - mandatory, - _immediate - ); - } - - public long TimeToLive - { - get - { - CheckNotClosed(); - return _timeToLive; - } - set - { - CheckNotClosed(); - if ( value < 0 ) - { - throw new ArgumentOutOfRangeException("Time to live must be non-negative - supplied value was " + value); - } - _timeToLive = value; - } - } - - #endregion - - public string MimeType - { - get - { - CheckNotClosed(); - return _mimeType; - } - set - { - CheckNotClosed(); - _mimeType = value; - } - } - - public string Encoding - { - get - { - CheckNotClosed(); - return _encoding; - } - set - { - CheckNotClosed(); - _encoding = value; - } - } - - public void Dispose() - { - Close(); - } - - #region Message Publishing - - private void SendImpl(string exchangeName, string routingKey, AbstractQmsMessage message, DeliveryMode deliveryMode, int priority, uint timeToLive, bool mandatory, bool immediate) - { - // todo: handle session access ticket - AMQFrame publishFrame = BasicPublishBody.CreateAMQFrame( - _channel.ChannelId, 0, exchangeName, - routingKey, mandatory, immediate - ); - - // fix message properties - if ( !_disableTimestamps ) - { - message.Timestamp = DateTime.UtcNow.Ticks; - if (timeToLive != 0) - { - message.Expiration = message.Timestamp + timeToLive; - } - } else - { - message.Expiration = 0; - } - message.DeliveryMode = deliveryMode; - message.Priority = (byte)priority; - - ByteBuffer payload = message.Data; - int payloadLength = payload.Limit; - - ContentBody[] contentBodies = CreateContentBodies(payload); - AMQFrame[] frames = new AMQFrame[2 + contentBodies.Length]; - for ( int i = 0; i < contentBodies.Length; i++ ) - { - frames[2 + i] = ContentBody.CreateAMQFrame(_channelId, contentBodies[i]); - } - if ( contentBodies.Length > 0 && _logger.IsDebugEnabled ) - { - _logger.Debug(string.Format("Sending content body frames to {{exchangeName={0} routingKey={1}}}", exchangeName, routingKey)); - } - - // weight argument of zero indicates no child content headers, just bodies - AMQFrame contentHeaderFrame = ContentHeaderBody.CreateAMQFrame( - _channelId, AmqChannel.BASIC_CONTENT_TYPE, 0, - message.ContentHeaderProperties, (uint)payloadLength - ); - if ( _logger.IsDebugEnabled ) - { - _logger.Debug(string.Format("Sending content header frame to {{exchangeName={0} routingKey={1}}}", exchangeName, routingKey)); - } - - frames[0] = publishFrame; - frames[1] = contentHeaderFrame; - CompositeAMQDataBlock compositeFrame = new CompositeAMQDataBlock(frames); - - lock ( _channel.Connection.FailoverMutex ) - { - _channel.Connection.ProtocolWriter.Write(compositeFrame); - } - } - - - /// - /// Create content bodies. This will split a large message into numerous bodies depending on the negotiated - /// maximum frame size. - /// - /// - /// return the array of content bodies - private ContentBody[] CreateContentBodies(ByteBuffer payload) - { - if ( payload == null ) - { - return null; - } else if ( payload.Remaining == 0 ) - { - return new ContentBody[0]; - } - // we substract one from the total frame maximum size to account for the end of frame marker in a body frame - // (0xCE byte). - int framePayloadMax = (int)(_channel.Connection.MaximumFrameSize - 1); - int frameCount = CalculateContentBodyFrames(payload); - ContentBody[] bodies = new ContentBody[frameCount]; - for ( int i = 0; i < frameCount; i++ ) - { - int length = (payload.Remaining >= framePayloadMax) - ? framePayloadMax : payload.Remaining; - bodies[i] = new ContentBody(payload, (uint)length); - } - return bodies; - } - - private int CalculateContentBodyFrames(ByteBuffer payload) - { - // we substract one from the total frame maximum size to account - // for the end of frame marker in a body frame - // (0xCE byte). - int frameCount; - if ( (payload == null) || (payload.Remaining == 0) ) - { - frameCount = 0; - } else - { - int dataLength = payload.Remaining; - int framePayloadMax = (int)_channel.Connection.MaximumFrameSize - 1; - int lastFrame = ((dataLength % framePayloadMax) > 0) ? 1 : 0; - frameCount = (int)(dataLength / framePayloadMax) + lastFrame; - } - - return frameCount; - } - #endregion // Message Publishing - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Closeable.cs b/qpid/dotnet/Qpid.Client/Client/Closeable.cs deleted file mode 100644 index b9664ccea3..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Closeable.cs +++ /dev/null @@ -1,83 +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. - * - */ -using System; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client -{ - /// Closeable provides monitoring of the state of a closeable resource; whether it is open or closed. It also provides a lock on which - /// attempts to close the resource from multiple threads can be coordinated. - /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Close (and clean-up) a resource. - ///
Monitor the state of a closeable resource. - ///
Synchronous attempts to close resource from concurrent threads. - ///
- ///

- /// - /// Poor encapsulation of the close lock. Better to completely hide the implementation, such that there is a method, e.g., DoSingleClose, - /// that sub-classes implement. Guaranteed to only be called by one thread at once, and iff the object is not already closed. That is, multiple - /// simultaneous closes will result in a single call to the real close method. Put the wait and condition checking loop in this base class. - /// - public abstract class Closeable : ICloseable - { - /// Constant representing the closed state. - protected const int CLOSED = 1; - - /// Constant representing the open state. - protected const int NOT_CLOSED = 2; - - /// Used to ensure orderly closing of the object. - protected readonly object _closingLock = new object(); - - /// Indicates the state of this resource; open or closed. - protected int _closed = NOT_CLOSED; - - /// - /// Checks the not closed. - /// - /// - /// Don't like check methods that throw exceptions. a) it can come as a surprise without checked exceptions, b) it limits the - /// callers choice, if the caller would prefer a boolean, c) it is not side-effect free programming, where such could be used. Get rid - /// of this and replace with boolean. - protected void CheckNotClosed() - { - if (_closed == CLOSED) - { - throw new InvalidOperationException("Object " + ToString() + " has been closed"); - } - } - - /// Indicates whether this resource is closed. - /// true if closed; otherwise, false. - public bool Closed - { - get - { - return _closed == CLOSED; - } - } - - /// Close this resource. - public abstract void Close(); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs b/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs deleted file mode 100644 index 8d289fa956..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs +++ /dev/null @@ -1,84 +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. - * - */ - -using System; -using System.Collections; -using System.Collections.Specialized; -using System.Configuration; -using System.Text; - -using Apache.Qpid.Client.Security; -using Apache.Qpid.Sasl.Mechanisms; - -namespace Apache.Qpid.Client.Configuration -{ - public class AuthenticationConfigurationSectionHandler - : IConfigurationSectionHandler - { - - public object Create(object parent, object configContext, System.Xml.XmlNode section) - { - NameValueSectionHandler handler = new NameValueSectionHandler(); - OrderedHashTable schemes = new OrderedHashTable(); - - NameValueCollection options = (NameValueCollection) - handler.Create(parent, configContext, section); - - if ( options != null ) - { - foreach ( string key in options.Keys ) - { - Type type = Type.GetType(options[key]); - if ( type == null ) - throw new ConfigurationException(string.Format("Type '{0}' not found", key)); - if ( !typeof(IAMQCallbackHandler).IsAssignableFrom(type) ) - throw new ConfigurationException(string.Format("Type '{0}' does not implement IAMQCallbackHandler", key)); - - schemes.Add(key, type); - } - } - - return schemes; - } - - } // class AuthenticationConfigurationSectionHandler - - public class OrderedHashTable : Hashtable - { - private ArrayList _keys = new ArrayList(); - - public IList OrderedKeys - { - get { return _keys; } - } - - public override void Add(object key, object value) - { - base.Add(key, value); - _keys.Add(key); - } - public override void Remove(object key) - { - base.Remove(key); - _keys.Remove(key); - } - } -} // namespace Apache.Qpid.Client.Configuration diff --git a/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs b/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs deleted file mode 100644 index b21486bfa8..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs +++ /dev/null @@ -1,83 +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. - * - */ -namespace Apache.Qpid.Client -{ - public class ConnectionTuneParameters - { - private uint _frameMax; - - private ushort _channelMax; - - private uint _hearbeat; - - private uint _txnLimit; - - public uint FrameMax - { - get - { - return _frameMax; - } - set - { - _frameMax = value; - } - } - - public ushort ChannelMax - { - get - { - return _channelMax; - } - set - { - _channelMax = value; - } - } - - public uint Heartbeat - { - get - { - return _hearbeat; - } - set - { - _hearbeat = value; - } - } - - public uint TxnLimit - { - get - { - return _txnLimit; - } - set - { - _txnLimit = value; - } - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs b/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs deleted file mode 100644 index 7013746414..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs +++ /dev/null @@ -1,42 +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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Client.Failover -{ - /// - /// This exception is thrown when failover is taking place and we need to let other - /// parts of the client know about this. - /// - [Serializable] - class FailoverException : Exception - { - public FailoverException(String message) : base(message) - { - } - - protected FailoverException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs b/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs deleted file mode 100644 index 83c69b7d25..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs +++ /dev/null @@ -1,175 +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. - * - */ -using System; -using System.Threading; -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; - -namespace Apache.Qpid.Client.Failover -{ - public class FailoverHandler - { - private static readonly ILog _log = LogManager.GetLogger(typeof(FailoverHandler)); - - private AMQConnection _connection; - - /** - * Used where forcing the failover host - */ - private String _host; - - /** - * Used where forcing the failover port - */ - private int _port; - - public FailoverHandler(AMQConnection connection) - { - _connection = connection; - } - - public void Run() - { - if (Thread.CurrentThread.IsBackground) - { - throw new InvalidOperationException("FailoverHandler must Run on a non-background thread."); - } - - AMQProtocolListener pl = _connection.ProtocolListener; - pl.FailoverLatch = new ManualResetEvent(false); - - // We wake up listeners. If they can handle failover, they will extend the - // FailoverSupport class and will in turn block on the latch until failover - // has completed before retrying the operation - _connection.ProtocolListener.PropagateExceptionToWaiters(new FailoverException("Failing over about to start")); - - // Since failover impacts several structures we protect them all with a single mutex. These structures - // are also in child objects of the connection. This allows us to manipulate them without affecting - // client code which runs in a separate thread. - lock (_connection.FailoverMutex) - { - _log.Info("Starting failover process"); - - // We switch in a new state manager temporarily so that the interaction to get to the "connection open" - // state works, without us having to terminate any existing "state waiters". We could theoretically - // have a state waiter waiting until the connection is closed for some reason. Or in future we may have - // a slightly more complex state model therefore I felt it was worthwhile doing this. - AMQStateManager existingStateManager = _connection.ProtocolListener.StateManager; - _connection.ProtocolListener.StateManager = new AMQStateManager(); - if (!_connection.FirePreFailover(_host != null)) - { - _connection.ProtocolListener.StateManager = existingStateManager; - if (_host != null) - { - _connection.ExceptionReceived(new AMQDisconnectedException("Redirect was vetoed by client")); - } - else - { - _connection.ExceptionReceived(new AMQDisconnectedException("Failover was vetoed by client")); - } - pl.FailoverLatch.Set(); - pl.FailoverLatch = null; - return; - } - bool failoverSucceeded; - // when host is non null we have a specified failover host otherwise we all the client to cycle through - // all specified hosts - - // if _host has value then we are performing a redirect. - if (_host != null) - { - // todo: fix SSL support! - failoverSucceeded = _connection.AttemptReconnection(_host, _port, null); - } - else - { - failoverSucceeded = _connection.AttemptReconnection(); - } - - // XXX: at this point it appears that we are going to set StateManager to existingStateManager in - // XXX: both paths of control. - if (!failoverSucceeded) - { - _connection.ProtocolListener.StateManager = existingStateManager; - _connection.ExceptionReceived( - new AMQDisconnectedException("Server closed connection and no failover " + - "was successful")); - } - else - { - _connection.ProtocolListener.StateManager = existingStateManager; - try - { - if (_connection.FirePreResubscribe()) - { - _log.Info("Resubscribing on new connection"); - _connection.ResubscribeChannels(); - } - else - { - _log.Info("Client vetoed automatic resubscription"); - } - _connection.FireFailoverComplete(); - _connection.ProtocolListener.FailoverState = FailoverState.NOT_STARTED; - _log.Info("Connection failover completed successfully"); - } - catch (Exception e) - { - _log.Info("Failover process failed - exception being propagated by protocol handler"); - _connection.ProtocolListener.FailoverState = FailoverState.FAILED; - try - { - _connection.ProtocolListener.OnException(e); - } - catch (Exception ex) - { - _log.Error("Error notifying protocol session of error: " + ex, ex); - } - } - } - } - pl.FailoverLatch.Set(); - } - - public String getHost() - { - return _host; - } - - public void setHost(String host) - { - _host = host; - } - - public int getPort() - { - return _port; - } - - public void setPort(int port) - { - _port = port; - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs b/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs deleted file mode 100644 index 3058cdcd69..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs +++ /dev/null @@ -1,31 +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. - * - */ -namespace Apache.Qpid.Client.Failover -{ - /// - /// Enumeration of failover states. Used to handle failover from within AMQProtocolHandler where MINA events need to be - /// dealt with and can happen during failover. - /// - enum FailoverState - { - NOT_STARTED, IN_PROGRESS, FAILED - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs b/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs deleted file mode 100644 index afa5301f39..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs +++ /dev/null @@ -1,55 +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. - * - */ -using log4net; - -namespace Apache.Qpid.Client.Failover -{ - public abstract class FailoverSupport - { - private static readonly ILog _log = LogManager.GetLogger(typeof(FailoverSupport)); - - public object execute(AMQConnection con) - { - // We wait until we are not in the middle of failover before acquiring the mutex and then proceeding. - // Any method that can potentially block for any reason should use this class so that deadlock will not - // occur. The FailoverException is propagated by the AMQProtocolHandler to any listeners (e.g. frame listeners) - // that might be causing a block. When that happens, the exception is caught here and the mutex is released - // before waiting for the failover to complete (either successfully or unsuccessfully). - while (true) - { - con.ProtocolListener.BlockUntilNotFailingOver(); - lock (con.FailoverMutex) - { - try - { - return operation(); - } - catch (FailoverException e) - { - _log.Info("Failover exception caught during operation", e); - } - } - } - } - - protected abstract object operation(); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs deleted file mode 100644 index def1e78e8c..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs +++ /dev/null @@ -1,42 +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. - * - */ -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class BasicDeliverMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicDeliverMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - UnprocessedMessage msg = new UnprocessedMessage(); - msg.DeliverBody = (BasicDeliverBody) evt.Method; - msg.ChannelId = evt.ChannelId; - _logger.Debug("New JmsDeliver method received"); - evt.ProtocolSession.UnprocessedMessageReceived(msg); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs deleted file mode 100644 index f413dfc9c6..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs +++ /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. - * - */ -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class BasicReturnMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicReturnMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - _logger.Debug("New Basic.Return method received"); - UnprocessedMessage msg = new UnprocessedMessage(); - msg.DeliverBody = null; - msg.BounceBody = (BasicReturnBody) evt.Method; - msg.ChannelId = evt.ChannelId; - - evt.ProtocolSession.UnprocessedMessageReceived(msg); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs deleted file mode 100644 index 9ed09a0d01..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs +++ /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. - * - */ -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Protocol; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class ChannelCloseMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(ChannelCloseMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - _logger.Debug("ChannelClose method received"); - ChannelCloseBody method = (ChannelCloseBody) evt.Method; - - int errorCode = method.ReplyCode; - string reason = method.ReplyText; - if (_logger.IsDebugEnabled) - { - _logger.Debug("Channel close reply code: " + errorCode + ", reason: " + reason); - } - - AMQFrame frame = ChannelCloseOkBody.CreateAMQFrame(evt.ChannelId); - evt.ProtocolSession.WriteFrame(frame); - - if ( errorCode != AMQConstant.REPLY_SUCCESS.Code ) - { - _logger.Debug("Channel close received with errorCode " + errorCode + ", throwing exception"); - if ( errorCode == AMQConstant.NO_CONSUMERS.Code ) - throw new AMQNoConsumersException(reason); - if ( errorCode == AMQConstant.NO_ROUTE.Code ) - throw new AMQNoRouteException(reason); - if ( errorCode == AMQConstant.INVALID_ARGUMENT.Code ) - throw new AMQInvalidArgumentException(reason); - if ( errorCode == AMQConstant.INVALID_ROUTING_KEY.Code ) - throw new AMQInvalidRoutingKeyException(reason); - // any other - throw new AMQChannelClosedException(errorCode, "Error: " + reason); - } - evt.ProtocolSession.ChannelClosed(evt.ChannelId, errorCode, reason); - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs deleted file mode 100644 index 66cff3bc65..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs +++ /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. - * - */ -using System; -using System.Threading; -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; -using Apache.Qpid.Protocol; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionCloseMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionCloseMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - _logger.Debug("ConnectionClose frame received"); - ConnectionCloseBody method = (ConnectionCloseBody) evt.Method; - - int errorCode = method.ReplyCode; - String reason = method.ReplyText; - - // send CloseOK - evt.ProtocolSession.WriteFrame(ConnectionCloseOkBody.CreateAMQFrame(evt.ChannelId)); - - if ( errorCode != AMQConstant.REPLY_SUCCESS.Code ) - { - if ( errorCode == AMQConstant.NOT_ALLOWED.Code ) - { - _logger.Info("Authentication Error: " + Thread.CurrentThread.Name); - evt.ProtocolSession.CloseProtocolSession(); - - //todo this is a bit of a fudge (could be conssidered such as each new connection needs a new state manager or at least a fresh state. - stateManager.ChangeState(AMQState.CONNECTION_NOT_STARTED); - - throw new AMQAuthenticationException(errorCode, reason); - } else - { - _logger.Info("Connection close received with error code " + errorCode); - throw new AMQConnectionClosedException(errorCode, "Error: " + reason); - } - } - // this actually closes the connection in the case where it is not an error. - evt.ProtocolSession.CloseProtocolSession(); - stateManager.ChangeState(AMQState.CONNECTION_CLOSED); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs deleted file mode 100644 index 038da15731..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs +++ /dev/null @@ -1,41 +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. - * - */ -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionCloseOkHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionCloseOkHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - _logger.Debug("ConnectionCloseOk frame received"); -// ConnectionCloseOkBody method = (ConnectionCloseOkBody)evt.Method; - stateManager.ChangeState(AMQState.CONNECTION_CLOSED); - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs deleted file mode 100644 index a12e4ead60..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs +++ /dev/null @@ -1,35 +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. - * - */ -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionOpenOkMethodHandler : IStateAwareMethodListener - { - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - stateManager.ChangeState(AMQState.CONNECTION_OPEN); - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs deleted file mode 100644 index 08cc580b17..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs +++ /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. - * - */ -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionRedirectMethodHandler : IStateAwareMethodListener - { -// private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionRedirectMethodHandler)); - - private const int DEFAULT_REDIRECT_PORT = 5672; - - private static ConnectionRedirectMethodHandler _handler = new ConnectionRedirectMethodHandler(); - - public static ConnectionRedirectMethodHandler GetInstance() - { - return _handler; - } - - private ConnectionRedirectMethodHandler() - { - } - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - /*_logger.Info("ConnectionRedirect frame received"); - ConnectionRedirectBody method = (ConnectionRedirectBody) evt.Method; - - // the host is in the form hostname:port with the port being optional - int portIndex = method.Host.IndexOf(':'); - String host; - int port; - if (portIndex == -1) - { - host = method.Host; - port = DEFAULT_REDIRECT_PORT; - } - else - { - host = method.Host.Substring(0, portIndex); - port = Int32.Parse(method.Host.Substring(portIndex + 1)); - } - evt.ProtocolSession.Failover(host, port);*/ - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs deleted file mode 100644 index 9333d4d0a6..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs +++ /dev/null @@ -1,60 +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. - * - */ -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; -using Apache.Qpid.Sasl; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionSecureMethodHandler : IStateAwareMethodListener - { - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - ISaslClient saslClient = evt.ProtocolSession.SaslClient; - if ( saslClient == null ) - { - throw new AMQException("No SASL client set up - cannot proceed with authentication"); - } - - - ConnectionSecureBody body = (ConnectionSecureBody)evt.Method; - - try - { - // Evaluate server challenge - byte[] response = saslClient.EvaluateChallenge(body.Challenge); - // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0) - // TODO: Connect this to the session version obtained from ProtocolInitiation for this session. - // Be aware of possible changes to parameter order as versions change. - AMQFrame responseFrame = ConnectionSecureOkBody.CreateAMQFrame( - evt.ChannelId, response); - evt.ProtocolSession.WriteFrame(responseFrame); - } catch ( SaslException e ) - { - throw new AMQException("Error processing SASL challenge: " + e, e); - } - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs deleted file mode 100644 index c54662286b..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs +++ /dev/null @@ -1,144 +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. - * - */ -using System; -using System.Collections; -using System.Text; -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.Security; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; -using Apache.Qpid.Sasl; - - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionStartMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _log = LogManager.GetLogger(typeof(ConnectionStartMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - ConnectionStartBody body = (ConnectionStartBody) evt.Method; - AMQProtocolSession ps = evt.ProtocolSession; - - try - { - if ( body.Mechanisms == null ) - { - throw new AMQException("mechanism not specified in ConnectionStart method frame"); - } - string mechanisms = Encoding.UTF8.GetString(body.Mechanisms); - string selectedMechanism = ChooseMechanism(mechanisms); - if ( selectedMechanism == null ) - { - throw new AMQException("No supported security mechanism found, passed: " + mechanisms); - } - - byte[] saslResponse = DoAuthentication(selectedMechanism, ps); - - if (body.Locales == null) - { - throw new AMQException("Locales is not defined in Connection Start method"); - } - string allLocales = Encoding.ASCII.GetString(body.Locales); - string[] locales = allLocales.Split(' '); - string selectedLocale; - if (locales != null && locales.Length > 0) - { - selectedLocale = locales[0]; - } - else - { - throw new AMQException("No locales sent from server, passed: " + locales); - } - - stateManager.ChangeState(AMQState.CONNECTION_NOT_TUNED); - FieldTable clientProperties = new FieldTable(); - clientProperties["product"] = "Apache.Qpid.NET"; - clientProperties["version"] = "1.0"; - clientProperties["platform"] = GetFullSystemInfo(); - clientProperties["instance"] = ps.ClientID; - AMQFrame frame = ConnectionStartOkBody.CreateAMQFrame( - evt.ChannelId, clientProperties, selectedMechanism, - saslResponse, selectedLocale); - ps.WriteFrame(frame); - } - catch (Exception e) - { - throw new AMQException(_log, "Unable to decode data: " + e, e); - } - } - - private string GetFullSystemInfo() - { - StringBuilder sysInfo = new StringBuilder(); - // check if we're running on mono or .net - Type monoRuntime = Type.GetType("Mono.Runtime"); - if ( monoRuntime != null ) - sysInfo.Append("Mono"); - else - sysInfo.Append(".NET"); - sysInfo.Append(" ").Append(Environment.Version); - sysInfo.Append(", ").Append(Environment.OSVersion); - return sysInfo.ToString(); - } - - private string ChooseMechanism(string mechanisms) - { - return CallbackHandlerRegistry.Instance.ChooseMechanism(mechanisms); - } - - private byte[] DoAuthentication(string selectedMechanism, AMQProtocolSession ps) - { - ISaslClient saslClient = Sasl.Sasl.CreateClient( - new string[] { selectedMechanism }, null, "AMQP", "localhost", - new Hashtable(), CreateCallbackHandler(selectedMechanism, ps) - ); - if ( saslClient == null ) - { - throw new AMQException("Client SASL configuration error: no SaslClient could be created for mechanism " + - selectedMechanism); - } - ps.SaslClient = saslClient; - try - { - return saslClient.HasInitialResponse ? - saslClient.EvaluateChallenge(new byte[0]) : null; - } catch ( Exception ex ) - { - ps.SaslClient = null; - throw new AMQException("Unable to create SASL client", ex); - } - } - - private IAMQCallbackHandler CreateCallbackHandler(string mechanism, AMQProtocolSession session) - { - Type type = CallbackHandlerRegistry.Instance.GetCallbackHandler(mechanism); - IAMQCallbackHandler handler = - (IAMQCallbackHandler)Activator.CreateInstance(type); - if ( handler == null ) - throw new AMQException("Unable to create callback handler: " + mechanism); - handler.Initialize(session); - return handler; - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs deleted file mode 100644 index 15a1d908b7..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs +++ /dev/null @@ -1,63 +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. - * - */ -using System; -using log4net; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class ConnectionTuneMethodHandler : IStateAwareMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionTuneMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - _logger.Debug("ConnectionTune frame received"); - ConnectionTuneBody frame = (ConnectionTuneBody) evt.Method; - AMQProtocolSession session = evt.ProtocolSession; - - ConnectionTuneParameters parameters = session.ConnectionTuneParameters; - if (parameters == null) - { - parameters = new ConnectionTuneParameters(); - } - - _logger.Debug(String.Format("ConnectionTune.heartbeat = {0}.", frame.Heartbeat)); - - parameters.FrameMax = frame.FrameMax; - parameters.Heartbeat = frame.Heartbeat; - session.ConnectionTuneParameters = parameters; - - stateManager.ChangeState(AMQState.CONNECTION_NOT_OPENED); - session.WriteFrame(ConnectionTuneOkBody.CreateAMQFrame( - evt.ChannelId, frame.ChannelMax, frame.FrameMax, frame.Heartbeat)); - session.WriteFrame(ConnectionOpenBody.CreateAMQFrame( - evt.ChannelId, session.AMQConnection.VirtualHost, null, true)); - - if (frame.Heartbeat > 0) - { - evt.ProtocolSession.AMQConnection.StartHeartBeatThread(frame.Heartbeat); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs deleted file mode 100644 index 70aa3e1078..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs +++ /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. - * - */ -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class QueueDeleteOkMethodHandler : IStateAwareMethodListener - { - - private static readonly ILog _logger = LogManager.GetLogger(typeof(QueueDeleteOkMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - QueueDeleteOkBody body = (QueueDeleteOkBody)evt.Method; - if (body != null) - { - _logger.InfoFormat("Received Queue.Delete-Ok message, message count {0}", body.MessageCount); - } - } - - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs deleted file mode 100644 index 22db70575d..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs +++ /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. - * - */ -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Handler -{ - public class QueuePurgeOkMethodHandler : IStateAwareMethodListener - { - - private static readonly ILog _logger = LogManager.GetLogger(typeof(QueuePurgeOkMethodHandler)); - - public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt) - { - QueuePurgeOkBody body = (QueuePurgeOkBody)evt.Method; - if (body != null) - { - _logger.InfoFormat("Received Queue.Purge-Ok message, message count {0}", body.MessageCount); - } - } - - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs deleted file mode 100644 index e58de2ab96..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs +++ /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. - * - */ -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Message -{ - public class AMQMessage - { - protected IContentHeaderProperties _contentHeaderProperties; - - /// - /// If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required - /// - protected AmqChannel _channel; - - private long _deliveryTag; - - public AMQMessage(IContentHeaderProperties properties, long deliveryTag) - { - _contentHeaderProperties = properties; - _deliveryTag = deliveryTag; - } - - public AMQMessage(IContentHeaderProperties properties) - : this(properties, -1) - { - } - - public long DeliveryTag - { - get { return _deliveryTag; } - } - - public AmqChannel Channel - { - get { return _channel; } - set { _channel = value; } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs b/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs deleted file mode 100644 index f352d62c11..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs +++ /dev/null @@ -1,73 +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. - * - */ -using System.Collections; -using Apache.Qpid.Framing; -using log4net; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Message -{ - public abstract class AbstractQmsMessageFactory : IMessageFactory - { - public abstract AbstractQmsMessage CreateMessage(string mimeType); - - private static readonly ILog _logger = LogManager.GetLogger(typeof (AbstractQmsMessageFactory)); - - protected abstract AbstractQmsMessage CreateMessage(long messageNbr, ByteBuffer data, ContentHeaderBody contentHeader); - - protected AbstractQmsMessage CreateMessageWithBody(long messageNbr, - ContentHeaderBody contentHeader, - IList bodies) - { - ByteBuffer data; - - // we optimise the non-fragmented case to avoid copying - if (bodies != null && bodies.Count == 1) - { - _logger.Debug("Non-fragmented message body (bodySize=" + contentHeader.BodySize +")"); - data = ((ContentBody)bodies[0]).Payload; - } - else - { - _logger.Debug("Fragmented message body (" + bodies.Count + " frames, bodySize=" + contentHeader.BodySize + ")"); - data = ByteBuffer.Allocate((int)contentHeader.BodySize); // XXX: Is cast a problem? - foreach (ContentBody body in bodies) { - data.Put(body.Payload); - //body.Payload.Release(); - } - - data.Flip(); - } - _logger.Debug("Creating message from buffer with position=" + data.Position + " and remaining=" + data.Remaining); - - return CreateMessage(messageNbr, data, contentHeader); - } - - public AbstractQmsMessage CreateMessage(long messageNbr, bool redelivered, - ContentHeaderBody contentHeader, - IList bodies) - { - AbstractQmsMessage msg = CreateMessageWithBody(messageNbr, contentHeader, bodies); - msg.Redelivered = redelivered; - return msg; - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs deleted file mode 100644 index 34b47137e5..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs +++ /dev/null @@ -1,694 +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. - * - */ -using System; -using System.Collections; -using System.Text; -using log4net; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Message -{ - public abstract class AbstractQmsMessage : AMQMessage, IMessage - { - private static ILog log = LogManager.GetLogger(typeof(AbstractQmsMessage)); - - protected bool _redelivered; - - protected ByteBuffer _data; - protected bool _readableMessage = false; - private QpidHeaders _headers; - - protected AbstractQmsMessage(ByteBuffer data) - : base(new BasicContentHeaderProperties()) - { - Init(data); - } - - protected AbstractQmsMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, ByteBuffer data) - : this(contentHeader, deliveryTag) - { - Init(data); - } - - protected AbstractQmsMessage(BasicContentHeaderProperties contentHeader, long deliveryTag) : base(contentHeader, deliveryTag) - { - Init(null); - } - - private void Init(ByteBuffer data) - { - _data = data; - if ( _data != null ) - { - _data.Acquire(); - } - _readableMessage = (data != null); - if ( ContentHeaderProperties.Headers == null ) - ContentHeaderProperties.Headers = new FieldTable(); - _headers = new QpidHeaders(ContentHeaderProperties.Headers); - } - - // - // Properties - // - - /// - /// The application message identifier - /// - public string MessageId - { - get - { - if (ContentHeaderProperties.MessageId == null) - { - ContentHeaderProperties.MessageId = "ID:" + DeliveryTag; - } - return ContentHeaderProperties.MessageId; - } - set { ContentHeaderProperties.MessageId = value; } - } - - /// - /// The message timestamp - /// - public long Timestamp - { - get - { - // TODO: look at ulong/long choice - return (long) ContentHeaderProperties.Timestamp; - } - set - { - ContentHeaderProperties.Timestamp = (ulong) value; - } - } - - /// - /// The as a byte array. - /// - public byte[] CorrelationIdAsBytes - { - get { return Encoding.Default.GetBytes(ContentHeaderProperties.CorrelationId); } - set { ContentHeaderProperties.CorrelationId = Encoding.Default.GetString(value); } - } - - /// - /// The application correlation identifier - /// - public string CorrelationId - { - get { return ContentHeaderProperties.CorrelationId; } - set { ContentHeaderProperties.CorrelationId = value; } - } - - struct Dest - { - public string ExchangeName; - public string RoutingKey; - - public Dest(string exchangeName, string routingKey) - { - ExchangeName = exchangeName; - RoutingKey = routingKey; - } - } - - /// - /// Exchange name of the reply-to address - /// - public string ReplyToExchangeName - { - get - { - return ReadReplyToHeader().ExchangeName; - } - set - { - BindingURL dest = ReadReplyToHeader(); - dest.ExchangeName = value; - WriteReplyToHeader(dest); - } - } - - /// - /// Routing key of the reply-to address - /// - public string ReplyToRoutingKey - { - get - { - return ReadReplyToHeader().RoutingKey; - } - set - { - BindingURL dest = ReadReplyToHeader(); - dest.RoutingKey = value; - WriteReplyToHeader(dest); - } - } - - /// - /// Non-persistent (1) or persistent (2) - /// - public DeliveryMode DeliveryMode - { - get - { - byte b = ContentHeaderProperties.DeliveryMode; - switch (b) - { - case 1: - return DeliveryMode.NonPersistent; - case 2: - return DeliveryMode.Persistent; - default: - throw new QpidException("Illegal value for delivery mode in content header properties"); - } - } - set - { - ContentHeaderProperties.DeliveryMode = (byte)(value==DeliveryMode.NonPersistent?1:2); - } - } - - /// - /// True, if this is a redelivered message - /// - public bool Redelivered - { - get { return _redelivered; } - set { _redelivered = value; } - } - - /// - /// The message type name - /// - public string Type - { - get { return ContentHeaderProperties.Type; } - set { ContentHeaderProperties.Type = value; } - } - - /// - /// Message expiration specification - /// - public long Expiration - { - get { return ContentHeaderProperties.Expiration; } - set { ContentHeaderProperties.Expiration = value; } - } - - /// - /// The message priority, 0 to 9 - /// - public byte Priority - { - get { return ContentHeaderProperties.Priority; } - set { ContentHeaderProperties.Priority = (byte) value; } - } - - /// - /// The MIME Content Type - /// - public string ContentType - { - get { return ContentHeaderProperties.ContentType; } - set { ContentHeaderProperties.ContentType = value; } - } - - /// - /// The MIME Content Encoding - /// - public string ContentEncoding - { - get { return ContentHeaderProperties.Encoding; } - set { ContentHeaderProperties.Encoding = value; } - } - - /// - /// Headers of this message - /// - public IHeaders Headers - { - get { return _headers; } - } - - /// - /// The creating user id - /// - public string UserId - { - get { return ContentHeaderProperties.UserId; } - set { ContentHeaderProperties.UserId = value; } - } - - /// - /// The creating application id - /// - public string AppId - { - get { return ContentHeaderProperties.AppId; } - set { ContentHeaderProperties.AppId = value; } - } - - /// - /// Intra-cluster routing identifier - /// - public string ClusterId - { - get { return ContentHeaderProperties.ClusterId; } - set { ContentHeaderProperties.ClusterId = value; } - } - - /// - /// Return the raw byte array that is used to populate the frame when sending - /// the message. - /// - /// a byte array of message data - public ByteBuffer Data - { - get - { - if (_data != null) - { - if (!_readableMessage) - { - _data.Flip(); - } - else - { - // Make sure we rewind the data just in case any method has moved the - // position beyond the start. - _data.Rewind(); - } - } - return _data; - } - - set - { - _data = value; - } - } - - public void Acknowledge() - { - // the JMS 1.1 spec says in section 3.6 that calls to acknowledge are ignored when client acknowledge - // is not specified. In our case, we only set the session field where client acknowledge mode is specified. - if (_channel != null) - { - // we set multiple to true here since acknowledgement implies acknowledge of all count messages - // received on the session - _channel.AcknowledgeMessage((ulong)DeliveryTag, true); - } - - } - - public abstract void ClearBodyImpl(); - - public void ClearBody() - { - ClearBodyImpl(); - _readableMessage = false; - } - - /// - /// Get a String representation of the body of the message. Used in the - /// toString() method which outputs this before message properties. - /// - /// - public abstract string ToBodyString(); - - public override string ToString() - { - try - { - StringBuilder buf = new StringBuilder("Body:\n"); - buf.Append(ToBodyString()); - buf.Append("\nQmsTimestamp: ").Append(Timestamp); - buf.Append("\nQmsExpiration: ").Append(Expiration); - buf.Append("\nQmsPriority: ").Append(Priority); - buf.Append("\nQmsDeliveryMode: ").Append(DeliveryMode); - buf.Append("\nReplyToExchangeName: ").Append(ReplyToExchangeName); - buf.Append("\nReplyToRoutingKey: ").Append(ReplyToRoutingKey); - buf.Append("\nAMQ message number: ").Append(DeliveryTag); - buf.Append("\nProperties:"); - if (ContentHeaderProperties.Headers == null) - { - buf.Append(""); - } - else - { - buf.Append(Headers.ToString()); - } - return buf.ToString(); - } - catch (Exception e) - { - return e.ToString(); - } - } - - public FieldTable PopulateHeadersFromMessageProperties() - { - if (ContentHeaderProperties.Headers == null) - { - return null; - } - else - { - // - // We need to convert every property into a String representation - // Note that type information is preserved in the property name - // - FieldTable table = new FieldTable(); - foreach (DictionaryEntry entry in ContentHeaderProperties.Headers) - { - string propertyName = (string) entry.Key; - if (propertyName == null) - { - continue; - } - else - { - table[propertyName] = entry.Value.ToString(); - } - } - return table; - } - } - - public BasicContentHeaderProperties ContentHeaderProperties - { - get - { - return (BasicContentHeaderProperties) _contentHeaderProperties; - } - } - - protected virtual void Reset() - { - _readableMessage = true; - } - - public bool IsReadable - { - get { return _readableMessage; } - } - - public bool isWritable - { - get { return !_readableMessage; } - } - - protected void CheckReadable() - { - if ( !_readableMessage ) - { - throw new MessageNotReadableException("You need to call reset() to make the message readable"); - } - } - - /// - /// Decodes the replyto field if one is set. - /// - /// Splits a replyto field containing an exchange name followed by a ':', followed by a routing key into the exchange name and - /// routing key seperately. The exchange name may be empty in which case the empty string is returned. If the exchange name is - /// empty the replyto field is expected to being with ':'. - /// - /// Anyhting other than a two part replyto field sperated with a ':' will result in an exception. - /// - /// - /// A destination initialized to the replyto location if a replyto field was set, or an empty destination otherwise. - private BindingURL ReadReplyToHeader() - { - string replyToEncoding = ContentHeaderProperties.ReplyTo; - //log.Debug("replyToEncoding = " + replyToEncoding); - - BindingURL bindingUrl = new BindingURL(replyToEncoding); - //log.Debug("bindingUrl = " + bindingUrl.ToString()); - - return bindingUrl; - - //log.Info("replyToEncoding = " + replyToEncoding); - -// if ( replyToEncoding == null ) -// { -// return new Dest(); -// } else -// { -// // Split the replyto field on a ':' -// string[] split = replyToEncoding.Split(':'); - -// // Ensure that the replyto field argument only consisted of two parts. -// if ( split.Length != 2 ) -// { -// throw new QpidException("Illegal value in ReplyTo property: " + replyToEncoding); -// } - -// // Extract the exchange name and routing key from the split replyto field. -// string exchangeName = split[0]; - -// string[] split2 = split[1].Split('/'); -// string routingKey = split2[3]; - -// return new Dest(exchangeName, routingKey); -// } - } - - private void WriteReplyToHeader(BindingURL dest) - { - string encodedDestination = string.Format("{0}:{1}", dest.ExchangeName, dest.RoutingKey); - ContentHeaderProperties.ReplyTo = encodedDestination; - } - } - - public class BindingURL - { - public readonly static string OPTION_EXCLUSIVE = "exclusive"; - public readonly static string OPTION_AUTODELETE = "autodelete"; - public readonly static string OPTION_DURABLE = "durable"; - public readonly static string OPTION_CLIENTID = "clientid"; - public readonly static string OPTION_SUBSCRIPTION = "subscription"; - public readonly static string OPTION_ROUTING_KEY = "routingkey"; - - /// Holds the undecoded URL - string url; - - /// Holds the decoded options. - IDictionary options = new Hashtable(); - - /// Holds the decoded exchange class. - string exchangeClass; - - /// Holds the decoded exchange name. - string exchangeName; - - /// Holds the destination name. - string destination; - - /// Holds the decoded queue name. - string queueName; - - /// - /// The binding URL has the format: - /// :///[]/[]? - public BindingURL(string url) - { - this.url = url; - Parse(); - } - - public string Url { get { return url; } } - - public string ExchangeClass - { - get { return exchangeClass; } - set { exchangeClass = value; } - } - - public string ExchangeName - { - get { return exchangeName; } - set { exchangeName = value; } - } - - public string QueueName - { - get { return queueName; } - set { queueName = value; } - } - - public string DestinationName - { - get { return destination; } - set { destination = value; } - } - - public string RoutingKey { - get { return (string)options[OPTION_ROUTING_KEY]; } - set { options[OPTION_ROUTING_KEY] = value; } - } - - public bool ContainsOption(string key) { return options.Contains(key); } - - public string ToString() - { - return "BindingURL: [ ExchangeClass = " + ExchangeClass + ", ExchangeName = " + ExchangeName + ", QueueName = " + QueueName + - ", DestinationName = " + DestinationName + ", RoutingKey = " + RoutingKey + " ] "; - } - - private void Parse() - { - Uri binding = new Uri(url); - - // Extract the URI scheme, this contains the exchange class. It is defaulted to the direct exchange if not specified. - string exchangeClass = binding.Scheme; - - if (exchangeClass == null) - { - url = ExchangeNameDefaults.DIRECT_EXCHANGE_CLASS + "://" + ExchangeNameDefaults.DIRECT + "//" + url; - Parse(); - - return; - } - else - { - this.exchangeClass = exchangeClass; - } - - // Extract the host name, this contains the exchange name. It is defaulted to the default direct exchange if not specified. - string exchangeName = binding.Host; - - if (exchangeName == null) - { - if (exchangeClass.Equals(ExchangeNameDefaults.DIRECT_EXCHANGE_CLASS)) - { - this.exchangeName = ""; - } - } - else - { - this.exchangeName = exchangeName; - } - - // Extract the destination and queue name. - if ((binding.AbsolutePath == null) || binding.AbsolutePath.Equals("")) - { - throw new UriFormatException("Destination or Queue required"); - } - else - { - int slashOffset = binding.AbsolutePath.IndexOf("/", 1); - if (slashOffset == -1) - { - throw new UriFormatException("Destination required"); - } - else - { - String path = binding.AbsolutePath; - - this.destination = path.Substring(1, slashOffset - 1); - this.queueName = path.Substring(slashOffset + 1); - } - } - - ParseOptions(options, binding.Query); - - // If the routing key is not set as an option, set it to the destination name. - if (!ContainsOption(OPTION_ROUTING_KEY)) - { - options[OPTION_ROUTING_KEY] = destination; - } - } - - /// - /// options looks like this - /// brokerlist='tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'',failover='method?option='value',option='value' - /// - public static void ParseOptions(IDictionary optionMap, string options) - { - // Check that there really are some options to parse. - if ((options == null) || (options.IndexOf('=') == -1)) - { - return; - } - - int optionIndex = options.IndexOf('='); - string option = options.Substring(0, optionIndex); - int length = options.Length; - int nestedQuotes = 0; - - // Holds the index of the final "'". - int valueIndex = optionIndex; - - // Loop over all the options.Dest - while ((nestedQuotes > 0) || (valueIndex < length)) - { - valueIndex++; - - if (valueIndex >= length) - { - break; - } - - if (options[valueIndex] == '\'') - { - if ((valueIndex + 1) < options.Length) - { - if ((options[valueIndex + 1] == '&') || - (options[valueIndex + 1] == ',') || - (options[valueIndex + 1] == ';') || - (options[valueIndex + 1] == '\'')) - { - nestedQuotes--; - - if (nestedQuotes == 0) - { - // We've found the value of an option - break; - } - } - else - { - nestedQuotes++; - } - } - else - { - // We are at the end of the string - // Check to see if we are corectly closing quotes - if (options[valueIndex] == '\'') - { - nestedQuotes--; - } - - break; - } - } - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs b/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs deleted file mode 100644 index bed379290f..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs +++ /dev/null @@ -1,52 +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. - * - */ -using System.Collections; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Message -{ - public interface IMessageFactory - { - /// - /// Create a message - /// - /// Delivery Tag - /// Message Sequence Number - /// True if this is a redelivered message - /// Content headers - /// Message bodies - /// The new message - /// if the message cannot be created - AbstractQmsMessage CreateMessage(long deliverTag, bool redelivered, - ContentHeaderBody contentHeader, - IList bodies); - - /// - /// Creates the message. - /// - /// Mime type to associate the new message with - /// The new message - /// if the message cannot be created - AbstractQmsMessage CreateMessage(string mimeType); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs b/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs deleted file mode 100644 index fdb5e14aa6..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs +++ /dev/null @@ -1,129 +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. - * - */ -using System; -using System.Collections; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client.Message -{ - public class MessageFactoryRegistry - { - private readonly Hashtable _mimeToFactoryMap = new Hashtable(); - private IMessageFactory _defaultFactory; - - /// - /// Default factory to use for unknown message types - /// - public IMessageFactory DefaultFactory - { - get { return _defaultFactory; } - set { _defaultFactory = value; } - } - - /// - /// Register a new message factory for a MIME type - /// - /// Mime type to register - /// - public void RegisterFactory(string mimeType, IMessageFactory mf) - { - if ( mf == null ) - throw new ArgumentNullException("mf"); - if ( mimeType == null || mimeType.Length == 0 ) - throw new ArgumentNullException("mimeType"); - - _mimeToFactoryMap[mimeType] = mf; - } - - /// - /// Remove a message factory - /// - /// MIME type to unregister - public void DeregisterFactory(string mimeType) - { - _mimeToFactoryMap.Remove(mimeType); - } - - /// - /// Create a message. This looks up the MIME type from the content header and instantiates the appropriate - /// concrete message type. - /// - /// the AMQ message id - /// true if redelivered - /// the content header that was received - /// a list of ContentBody instances - /// the message. - /// - /// - public AbstractQmsMessage CreateMessage(long messageNbr, bool redelivered, - ContentHeaderBody contentHeader, - IList bodies) - { - BasicContentHeaderProperties properties = (BasicContentHeaderProperties)contentHeader.Properties; - - if ( properties.ContentType == null ) - { - properties.ContentType = ""; - } - - IMessageFactory mf = GetFactory(properties.ContentType); - return mf.CreateMessage(messageNbr, redelivered, contentHeader, bodies); - } - - /// - /// Create a new message of the specified type - /// - /// The Mime type - /// The new message - public AbstractQmsMessage CreateMessage(string mimeType) - { - if ( mimeType == null || mimeType.Length == 0 ) - throw new ArgumentNullException("mimeType"); - - IMessageFactory mf = GetFactory(mimeType); - return mf.CreateMessage(mimeType); - } - - /// - /// Construct a new registry with the default message factories registered - /// - /// a message factory registry - public static MessageFactoryRegistry NewDefaultRegistry() - { - MessageFactoryRegistry mf = new MessageFactoryRegistry(); - mf.RegisterFactory("text/plain", new QpidTextMessageFactory()); - mf.RegisterFactory("text/xml", new QpidTextMessageFactory()); - mf.RegisterFactory("application/octet-stream", new QpidBytesMessageFactory()); - - mf.DefaultFactory = new QpidBytesMessageFactory(); - return mf; - } - - private IMessageFactory GetFactory(string mimeType) - { - IMessageFactory mf = (IMessageFactory)_mimeToFactoryMap[mimeType]; - return mf != null ? mf : _defaultFactory; - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs deleted file mode 100644 index fb3efb1b0f..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs +++ /dev/null @@ -1,353 +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. - * - */ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Text; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Message -{ - [Serializable] - class MessageEOFException : QpidException - { - public MessageEOFException(string message) : base(message) - { - } - - protected MessageEOFException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } - - public class QpidBytesMessage : AbstractQmsMessage, IBytesMessage - { - private const int DEFAULT_BUFFER_INITIAL_SIZE = 1024; - - public QpidBytesMessage() : this(null) - { - } - - /// - /// Construct a bytes message with existing data. - /// - /// if data is not null, the message is immediately in read only mode. if data is null, it is in - /// write-only mode - QpidBytesMessage(ByteBuffer data) : base(data) - { - // superclass constructor has instantiated a content header at this point - if (data == null) - { - _data = ByteBuffer.Allocate(DEFAULT_BUFFER_INITIAL_SIZE); - _data.IsAutoExpand = true; - } - } - - internal QpidBytesMessage(long messageNbr, ContentHeaderBody contentHeader, ByteBuffer data) - // TODO: this casting is ugly. Need to review whole ContentHeaderBody idea - : base(messageNbr, (BasicContentHeaderProperties)contentHeader.Properties, data) - { - } - - public override void ClearBodyImpl() - { - _data.Clear(); - } - - public override string ToBodyString() - { - CheckReadable(); - try - { - return GetText(); - } - catch (IOException e) - { - throw new QpidException(e.ToString()); - } - } - - private String GetText() - { - // this will use the default platform encoding - if (_data == null) - { - return null; - } - int pos = _data.Position; - _data.Rewind(); - // one byte left is for the end of frame marker - if (_data.Remaining == 0) - { - // this is really redundant since pos must be zero - _data.Position = pos; - return null; - } - else - { - byte[] data = new byte[_data.Remaining]; - _data.GetBytes(data); - return Encoding.UTF8.GetString(data); - } - } - - public long BodyLength - { - get - { - CheckReadable(); - return _data.Limit; - } - } - - private void CheckWritable() - { - if (_readableMessage) - { - throw new MessageNotWriteableException("You need to call clearBody() to make the message writable"); - } - } - - public bool ReadBoolean() - { - CheckReadable(); - CheckAvailable(1); - return _data.GetByte() != 0; - } - - public byte ReadByte() - { - CheckReadable(); - CheckAvailable(1); - return _data.GetByte(); - } - - public short ReadSignedByte() - { - CheckReadable(); - CheckAvailable(1); - return _data.GetSByte(); - } - - public short ReadShort() - { - CheckReadable(); - CheckAvailable(2); - return _data.GetInt16(); - } - - public char ReadChar() - { - CheckReadable(); - CheckAvailable(2); - return _data.GetChar(); - } - - public int ReadInt() - { - CheckReadable(); - CheckAvailable(4); - return _data.GetInt32(); - } - - public long ReadLong() - { - CheckReadable(); - CheckAvailable(8); - return _data.GetInt64(); - } - - public float ReadFloat() - { - CheckReadable(); - CheckAvailable(4); - return _data.GetFloat(); - } - - public double ReadDouble() - { - CheckReadable(); - CheckAvailable(8); - return _data.GetDouble(); - } - - public string ReadUTF() - { - CheckReadable(); - // we check only for one byte since theoretically the string could be only a - // single byte when using UTF-8 encoding - CheckAvailable(1); - try - { - byte[] data = new byte[_data.Remaining]; - _data.GetBytes(data); - return Encoding.UTF8.GetString(data); - } - catch (IOException e) - { - throw new QpidException(e.ToString(), e); - } - } - - public int ReadBytes(byte[] bytes) - { - if (bytes == null) - { - throw new ArgumentNullException("bytes"); - } - CheckReadable(); - int count = (_data.Remaining >= bytes.Length ? bytes.Length : _data.Remaining); - if (count == 0) - { - return -1; - } - else - { - _data.GetBytes(bytes, 0, count); - return count; - } - } - - public int ReadBytes(byte[] bytes, int maxLength) - { - if (bytes == null) - { - throw new ArgumentNullException("bytes"); - } - if (maxLength > bytes.Length) - { - throw new ArgumentOutOfRangeException("maxLength must be >= 0"); - } - CheckReadable(); - int count = (_data.Remaining >= maxLength ? maxLength : _data.Remaining); - if (count == 0) - { - return -1; - } - else - { - _data.GetBytes(bytes, 0, count); - return count; - } - } - - public void WriteBoolean(bool b) - { - CheckWritable(); - _data.Put(b ? (byte)1 : (byte)0); - } - - public void WriteByte(byte b) - { - CheckWritable(); - _data.Put(b); - } - - public void WriteShort(short i) - { - CheckWritable(); - _data.Put(i); - } - - public void WriteChar(char c) - { - CheckWritable(); - _data.Put(c); - } - - public void WriteSignedByte(short value) - { - CheckWritable(); - _data.Put(value); - } - - public void WriteDouble(double value) - { - CheckWritable(); - _data.Put(value); - } - - public void WriteFloat(float value) - { - CheckWritable(); - _data.Put(value); - } - - public void WriteInt(int value) - { - CheckWritable(); - _data.Put(value); - } - - public void WriteLong(long value) - { - CheckWritable(); - _data.Put(value); - } - - public void WriteUTF(string value) - { - CheckWritable(); - byte[] encodedData = Encoding.UTF8.GetBytes(value); - _data.Put(encodedData); - } - - public void WriteBytes(byte[] bytes) - { - CheckWritable(); - _data.Put(bytes); - } - - public void WriteBytes(byte[] bytes, int offset, int length) - { - CheckWritable(); - _data.Put(bytes, offset, length); - } - - protected override void Reset() - { - base.Reset(); - _data.Flip(); - } - - void IBytesMessage.Reset() - { - Reset(); - } - - /** - * Check that there is at least a certain number of bytes available to read - * - * @param len the number of bytes - * @throws MessageEOFException if there are less than len bytes available to read - */ - private void CheckAvailable(int len) - { - if (_data.Remaining < len) - { - throw new MessageEOFException("Unable to read " + len + " bytes"); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs deleted file mode 100644 index 3cc96cbddc..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs +++ /dev/null @@ -1,75 +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. - * - */ -using System; -using System.Collections; -using Apache.Qpid.Framing; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Message -{ - public class QpidBytesMessageFactory : AbstractQmsMessageFactory - { - //protected override AbstractQmsMessage CreateMessageWithBody(long messageNbr, - // ContentHeaderBody contentHeader, - // IList bodies) - //{ - // byte[] data; - - // // we optimise the non-fragmented case to avoid copying - // if (bodies != null && bodies.Count == 1) - // { - // data = ((ContentBody)bodies[0]).Payload; - // } - // else - // { - // data = new byte[(long)contentHeader.BodySize]; - // int currentPosition = 0; - // foreach (ContentBody cb in bodies) - // { - // Array.Copy(cb.Payload, 0, data, currentPosition, cb.Payload.Length); - // currentPosition += cb.Payload.Length; - // } - // } - - // return new QpidBytesMessage(messageNbr, data, contentHeader); - //} - - //public override AbstractQmsMessage CreateMessage() - //{ - // return new QpidBytesMessage(); - //} - - protected override AbstractQmsMessage CreateMessage(long deliveryTag, ByteBuffer data, ContentHeaderBody contentHeader) - { - return new QpidBytesMessage(deliveryTag, contentHeader, data); - } - - public override AbstractQmsMessage CreateMessage(string mimeType) - { - QpidBytesMessage msg = new QpidBytesMessage(); - msg.ContentType = mimeType; - return msg; - } - - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs deleted file mode 100644 index 9ad1c26867..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs +++ /dev/null @@ -1,233 +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. - * - */ -using System; -using System.Collections; -using System.Text; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; - -namespace Apache.Qpid.Client.Message -{ - internal class QpidHeaders : IHeaders - { - private FieldTable _headers; - - public QpidHeaders(FieldTable headers) - { - if ( headers == null ) - throw new ArgumentNullException("headers"); - _headers = headers; - } - - public bool Contains(string name) - { - CheckPropertyName(name); - return _headers.Contains(name); - } - - public void Clear() - { - _headers.Clear(); - } - - public object this[string name] - { - get { return GetObject(name); } - set { SetObject(name, value); } - } - - public bool GetBoolean(string name) - { - CheckPropertyName(name); - if ( Contains(name) ) - return _headers.GetBoolean(name); - return false; - } - - public void SetBoolean(string name, bool b) - { - CheckPropertyName(name); - _headers.SetBoolean(name, b); - } - - public byte GetByte(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetByte(propertyName); - return 0; - } - - public void SetByte(string propertyName, byte b) - { - CheckPropertyName(propertyName); - _headers.SetByte(propertyName, b); - } - - // we have sbyte overloads to interoperate with java - // because the Java client/server uses signed bytes - // by default, while C#'s is unsigned - public sbyte GetSByte(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetSByte(propertyName); - return 0; - } - - public void SetSByte(string propertyName, sbyte b) - { - CheckPropertyName(propertyName); - _headers.SetSByte(propertyName, b); - } - - public short GetShort(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetInt16(propertyName); - return 0; - } - - public void SetShort(string propertyName, short i) - { - CheckPropertyName(propertyName); - _headers.SetInt16(propertyName, i); - } - - public int GetInt(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetInt32(propertyName); - return 0; - } - - public void SetInt(string propertyName, int i) - { - CheckPropertyName(propertyName); - _headers.SetInt32(propertyName, i); - } - - public long GetLong(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetInt64(propertyName); - return 0; - } - - public void SetLong(string propertyName, long l) - { - CheckPropertyName(propertyName); - _headers.SetInt64(propertyName, l); - } - - public float GetFloat(String propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetFloat(propertyName); - return 0f; - } - - public void SetFloat(string propertyName, float f) - { - CheckPropertyName(propertyName); - _headers.SetFloat(propertyName, f); - } - - public double GetDouble(string propertyName) - { - CheckPropertyName(propertyName); - if ( Contains(propertyName) ) - return _headers.GetDouble(propertyName); - return 0; - } - - public void SetDouble(string propertyName, double v) - { - CheckPropertyName(propertyName); - _headers.SetDouble(propertyName, v); - } - - public string GetString(string propertyName) - { - CheckPropertyName(propertyName); - return _headers.GetString(propertyName); - } - - public void SetString(string propertyName, string value) - { - CheckPropertyName(propertyName); - _headers.SetString(propertyName, value); - } - - public object GetObject(string propertyName) - { - CheckPropertyName(propertyName); - return _headers[propertyName]; - } - - public void SetObject(string propertyName, object value) - { - CheckPropertyName(propertyName); - _headers[propertyName] = value; - } - - private static void CheckPropertyName(string propertyName) - { - if ( propertyName == null ) - { - throw new ArgumentException("Property name must not be null"); - } else if ( "".Equals(propertyName) ) - { - throw new ArgumentException("Property name must not be the empty string"); - } - } - - public override string ToString() - { - StringBuilder buf = new StringBuilder("{"); - int i = 0; - foreach ( DictionaryEntry entry in _headers ) - { - ++i; - if ( i > 1 ) - { - buf.Append(", "); - } - string propertyName = (string)entry.Key; - if ( propertyName == null ) - { - buf.Append("\nInternal error: Property with NULL key defined"); - } else - { - buf.Append(propertyName); - buf.Append(" = ").Append(entry.Value); - } - } - buf.Append("}"); - return buf.ToString(); - } - - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs deleted file mode 100644 index 24aef92aa5..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs +++ /dev/null @@ -1,115 +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. - * - */ -using System; -using System.Text; -using Apache.Qpid.Framing; -using Apache.Qpid.Messaging; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Message -{ - public class QpidTextMessage : AbstractQmsMessage, ITextMessage - { - private string _decodedValue = null; - private static Encoding DEFAULT_ENCODING = Encoding.UTF8; - - internal QpidTextMessage() : this(null, null) - { - ContentEncoding = DEFAULT_ENCODING.BodyName; - } - - internal QpidTextMessage(ByteBuffer data, String encoding) : base(data) - { - ContentEncoding = encoding; - } - - internal QpidTextMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, ByteBuffer data) - :base(deliveryTag, contentHeader, data) - { - } - - public override void ClearBodyImpl() - { - if (_data != null) - { - _data.Release(); - } - _data = null; - _decodedValue = null; - } - - public override string ToBodyString() - { - return Text; - } - - public string Text - { - get - { - if (_data == null && _decodedValue == null) - { - return null; - } - else if (_decodedValue != null) - { - return _decodedValue; - } - else - { - _data.Rewind(); - - // Read remaining bytes. - byte[] bytes = new byte[_data.Remaining]; - _data.GetBytes(bytes); - - // Convert to string based on encoding. - if (ContentHeaderProperties.Encoding != null) - { - // throw ArgumentException if the encoding is not supported - _decodedValue = Encoding.GetEncoding(ContentHeaderProperties.Encoding).GetString(bytes); - } - else - { - _decodedValue = DEFAULT_ENCODING.GetString(bytes); - } - return _decodedValue; - } - } - - set - { - byte[] bytes; - if (ContentHeaderProperties.Encoding == null) - { - bytes = Encoding.Default.GetBytes(value); - } - else - { - // throw ArgumentException if the encoding is not supported - bytes = Encoding.GetEncoding(ContentHeaderProperties.Encoding).GetBytes(value); - } - _data = ByteBuffer.Wrap(bytes); - _decodedValue = value; - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs deleted file mode 100644 index 79871e85ca..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs +++ /dev/null @@ -1,40 +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. - * - */ -using Apache.Qpid.Buffer; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Message -{ - public class QpidTextMessageFactory : AbstractQmsMessageFactory - { - public override AbstractQmsMessage CreateMessage(string mimeType) - { - QpidTextMessage msg = new QpidTextMessage(); - msg.ContentType = mimeType; - return msg; - } - - protected override AbstractQmsMessage CreateMessage(long deliveryTag, ByteBuffer data, ContentHeaderBody contentHeader) - { - return new QpidTextMessage(deliveryTag, (BasicContentHeaderProperties) contentHeader.Properties, data); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs b/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs deleted file mode 100644 index 4317ef3474..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs +++ /dev/null @@ -1,57 +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. - * - */ -using System; -using System.Runtime.Serialization; -using log4net; - -namespace Apache.Qpid.Client.Message -{ - /// - /// Raised when a message body is received unexpectedly by the client. This typically occurs when the - /// length of bodies received does not match with the declared length in the content header. - /// - [Serializable] - public class UnexpectedBodyReceivedException : AMQException - { - public UnexpectedBodyReceivedException(ILog logger, string msg, Exception t) - : base(logger, msg, t) - { - } - - public UnexpectedBodyReceivedException(ILog logger, string msg) - : base(logger, msg) - { - } - - public UnexpectedBodyReceivedException(ILog logger, int errorCode, string msg) - : base(logger, errorCode, msg) - { - } - - protected UnexpectedBodyReceivedException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs deleted file mode 100644 index d329712334..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs +++ /dev/null @@ -1,57 +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. - * - */ -using System.Collections; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Message -{ - public class UnprocessedMessage - { - private ulong _bytesReceived = 0; - - public BasicDeliverBody DeliverBody; - public BasicReturnBody BounceBody; - public ushort ChannelId; - public ContentHeaderBody ContentHeader; - - /// - /// List of ContentBody instances. Due to fragmentation you don't know how big this will be in general - /// - /// TODO: write and use linked list class - public IList Bodies = new ArrayList(); - - public void ReceiveBody(ContentBody body) - { - Bodies.Add(body); - if (body.Payload != null) - { - _bytesReceived += (uint)body.Payload.Remaining; - } - } - - public bool IsAllBodyDataReceived() - { - return _bytesReceived == ContentHeader.BodySize; - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs deleted file mode 100644 index a7ce808862..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs +++ /dev/null @@ -1,76 +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. - * - */ -using System; -using System.Text; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Protocol -{ - public class AMQMethodEvent - { - private AMQMethodBody _method; - - private ushort _channelId; - - private AMQProtocolSession _protocolSession; - - public AMQMethodEvent(ushort channelId, AMQMethodBody method, AMQProtocolSession protocolSession) - { - _channelId = channelId; - _method = method; - _protocolSession = protocolSession; - } - - public AMQMethodBody Method - { - get - { - return _method; - } - } - - public ushort ChannelId - { - get - { - return _channelId; - } - } - - public AMQProtocolSession ProtocolSession - { - get - { - return _protocolSession; - } - } - - public override String ToString() - { - StringBuilder buf = new StringBuilder("Method event: "); - buf.Append("\nChannel id: ").Append(_channelId); - buf.Append("\nMethod: ").Append(_method); - return buf.ToString(); - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs deleted file mode 100644 index c51538b70e..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs +++ /dev/null @@ -1,318 +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. - * - */ -using System; -using System.Collections; -using System.Threading; -using log4net; -using Apache.Qpid.Client.Failover; -using Apache.Qpid.Client.Protocol.Listener; -using Apache.Qpid.Client.State; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Protocol -{ - /// - /// AMQProtocolListener - /// - ///

Fail-over state transition rules... - /// - ///

The failover handler is created when the session is created since it needs a reference to the IoSession in order - /// to be able to send errors during failover back to the client application. The session won't be available in the case - /// when failing over due to a Connection.Redirect message from the broker. - /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Track fail over state of a connection. - ///
Manage method listeners. IAMQMethodListener - ///
Receive notification of all IO errors on a connection. IoHandler - ///
Inform method listeners of all method events on a connection. IAMQMethodListener - ///
Inform method listeners of all error events on a connection. IAMQMethodListener - ///
- /// - /// Todo: The broker will close the connection with no warning if authentication fails. This may result in the fail-over process being - /// triggered, when it should not be. - /// - ///

- public class AMQProtocolListener : IProtocolListener - { - /// Used for debugging. - private static readonly ILog _log = LogManager.GetLogger(typeof(AMQProtocolListener)); - - /// - /// Holds the failover handler for the connection. When a failure is detected, and the current failover state allows it, - /// the failover process is handed off to this handler. - /// - private FailoverHandler _failoverHandler; - - /// Tracks the current fail-over state. - internal FailoverState _failoverState = FailoverState.NOT_STARTED; - - internal FailoverState FailoverState - { - get { return _failoverState; } - set { _failoverState = value; } - } - - internal ManualResetEvent FailoverLatch; - - AMQConnection _connection; - AMQStateManager _stateManager; - - public AMQStateManager StateManager - { - get { return _stateManager; } - set { _stateManager = value; } - } - - private readonly ArrayList _frameListeners = ArrayList.Synchronized(new ArrayList()); - - AMQProtocolSession _protocolSession = null; - - private readonly Object _lock = new Object(); - - public AMQProtocolSession ProtocolSession { set { _protocolSession = value; } } - - public AMQProtocolListener(AMQConnection connection, AMQStateManager stateManager) - { - _connection = connection; - _stateManager = stateManager; - _failoverHandler = new FailoverHandler(connection); - } - - public void OnMessage(IDataBlock message) - { - // Handle incorrect protocol version. - if (message is ProtocolInitiation) - { - string error = String.Format("Protocol mismatch - {0}", message.ToString()); - AMQException e = new AMQProtocolHeaderException(error); - _log.Error("Closing connection because of protocol mismatch", e); - //_protocolSession.CloseProtocolSession(); - _stateManager.Error(e); - return; - } - - AMQFrame frame = (AMQFrame)message; - - if (frame.BodyFrame is AMQMethodBody) - { - if (_log.IsDebugEnabled) - { - _log.Debug("Method frame received: " + frame); - } - AMQMethodEvent evt = new AMQMethodEvent(frame.Channel, (AMQMethodBody)frame.BodyFrame, _protocolSession); - try - { - bool wasAnyoneInterested = false; - lock (_frameListeners.SyncRoot) - { - foreach (IAMQMethodListener listener in _frameListeners) - { - wasAnyoneInterested = listener.MethodReceived(evt) || wasAnyoneInterested; - } - } - if (!wasAnyoneInterested) - { - throw new AMQException("AMQMethodEvent " + evt + " was not processed by any listener."); - } - } - catch (Exception e) - { - foreach (IAMQMethodListener listener in _frameListeners) - { - listener.Error(e); - } - } - } - else if (frame.BodyFrame is ContentHeaderBody) - { - _protocolSession.MessageContentHeaderReceived(frame.Channel, - (ContentHeaderBody)frame.BodyFrame); - } - else if (frame.BodyFrame is ContentBody) - { - _protocolSession.MessageContentBodyReceived(frame.Channel, - (ContentBody)frame.BodyFrame); - } - else if (frame.BodyFrame is HeartbeatBody) - { - _log.Debug("HeartBeat received"); - } - } - - /// - /// Receives notification of any IO exceptions on the connection. - /// - ///

Upon receipt of a connection closed exception or any IOException, the fail-over process is attempted. If the fail-over fails, then - /// all method listeners and the application connection object are notified of the connection failure exception. - /// - ///

All other exception types are propagated to all method listeners. - ///

- public void OnException(Exception cause) - { - _log.Warn("public void OnException(Exception cause = " + cause + "): called"); - - // Ensure that the method listener set cannot be changed whilst this exception is propagated to all listeners. This also - // ensures that this exception is fully propagated to all listeners, before another one can be processed. - lock (_lock) - { - if (cause is AMQConnectionClosedException || cause is System.IO.IOException) - { - // Try a fail-over because the connection has failed. - FailoverState failoverState = AttemptFailover(); - - // Check if the fail-over has failed, in which case notify all method listeners of the exception. - // The application connection object is also notified of the failure of the connection with the exception. - if (failoverState == FailoverState.FAILED) - { - _log.Debug("Fail-over has failed. Notifying all method listeners of the exception."); - - AMQException amqe = new AMQException("Protocol handler error: " + cause, cause); - PropagateExceptionToWaiters(amqe); - _connection.ExceptionReceived(cause); - } - } - // Notify all method listeners of the exception. - else - { - PropagateExceptionToWaiters(cause); - _connection.ExceptionReceived(cause); - } - } - } - - /// - /// Tries to fail-over the connection, if the connection policy will permit it, and the fail-over process has not yet been - /// started. If the connection does not allow fail-over then an exception will be raised. If a fail-over is already in progress - /// this method allows it to continue to run and will do nothing. - /// - ///

This method should only be called when the connection has been remotely closed. - ///

- /// - /// The fail-over state at the end of this attempt. - private FailoverState AttemptFailover() - { - _log.Debug("private void AttemptFailover(): called"); - _log.Debug("_failoverState = " + _failoverState); - - // Ensure that the connection stops sending heart beats, if it still is. - _connection.StopHeartBeatThread(); - - // Check that the connection policy allows fail-over to be attempted. - if (!_connection.IsFailoverAllowed) - { - _log.Debug("Connection does not allowed to failover"); - _connection.ExceptionReceived( - new AMQDisconnectedException("Broker closed connection and reconnection is not permitted.")); - } - - // Check if connection was closed deliberately by the application, in which case no fail-over is attempted. - if (_connection.Closed) - { - return _failoverState; - } - - // If the connection allows fail-over and fail-over has not yet been started, then it is started and the fail-over state is - // advanced to 'in progress' - if (_failoverState == FailoverState.NOT_STARTED && _connection.IsFailoverAllowed) - { - _log.Info("Starting the fail-over process."); - - _failoverState = FailoverState.IN_PROGRESS; - StartFailoverThread(); - } - - return _failoverState; - } - - /// - /// There are two cases where we have other threads potentially blocking for events to be handled by this - /// class. These are for the state manager (waiting for a state change) or a frame listener (waiting for a - /// particular type of frame to arrive). When an error occurs we need to notify these waiters so that they can - /// react appropriately. - /// - /// the exception to propagate - /// - public void PropagateExceptionToWaiters(Exception e) - { - // FIXME: not sure if required as StateManager is in _frameListeners. Probably something to do with fail-over. - _stateManager.Error(e); - lock ( _lock ) - { - foreach ( IAMQMethodListener listener in _frameListeners ) - { - listener.Error(e); - } - } - } - - public void AddFrameListener(IAMQMethodListener listener) - { - lock ( _lock ) - { - _frameListeners.Add(listener); - } - } - - public void RemoveFrameListener(IAMQMethodListener listener) - { - if (_log.IsDebugEnabled) - { - _log.Debug("Removing frame listener: " + listener.ToString()); - } - lock ( _lock ) - { - _frameListeners.Remove(listener); - } - } - - public void BlockUntilNotFailingOver() - { - if (FailoverLatch != null) - { - FailoverLatch.WaitOne(); - } - } - - /// - /// "Failover" for redirection. - /// - /// - /// - public void Failover(string host, int port) - { - _failoverHandler.setHost(host); - _failoverHandler.setPort(port); - // see javadoc for FailoverHandler to see rationale for separate thread - StartFailoverThread(); - } - - private void StartFailoverThread() - { - Thread failoverThread = new Thread(new ThreadStart(_failoverHandler.Run)); - failoverThread.Name = "Failover"; - // Do not inherit daemon-ness from current thread as this can be a daemon - // thread such as a AnonymousIoService thread. - failoverThread.IsBackground = false; - failoverThread.Start(); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs deleted file mode 100644 index 1fb3d407eb..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs +++ /dev/null @@ -1,267 +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. - * - */ -using System; -using System.Collections; -using log4net; -using Apache.Qpid.Client.Message; -using Apache.Qpid.Client.Transport; -using Apache.Qpid.Framing; -using Apache.Qpid.Sasl; - -namespace Apache.Qpid.Client.Protocol -{ - public class AMQProtocolSession - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(AMQProtocolSession)); - - private readonly IProtocolWriter _protocolWriter; - private readonly IConnectionCloser _connectionCloser; - - /// - /// Maps from the channel id to the AmqChannel that it represents. - /// - //private ConcurrentMap _channelId2SessionMap = new ConcurrentHashMap(); - private Hashtable _channelId2SessionMap = Hashtable.Synchronized(new Hashtable()); - - //private ConcurrentMap _closingChannels = new ConcurrentHashMap(); - private Hashtable _closingChannels = Hashtable.Synchronized(new Hashtable()); - - /// - /// Maps from a channel id to an unprocessed message. This is used to tie together the - /// JmsDeliverBody (which arrives first) with the subsequent content header and content bodies. - /// - //private ConcurrentMap _channelId2UnprocessedMsgMap = new ConcurrentHashMap(); - private Hashtable _channelId2UnprocessedMsgMap = Hashtable.Synchronized(new Hashtable()); - - private AMQConnection _connection; - - public string ClientID { get { return _connection.ClientID; } } - - public AMQProtocolSession(IProtocolWriter protocolWriter, IConnectionCloser connectionCloser, AMQConnection connection) - { - _protocolWriter = protocolWriter; - _connectionCloser = connectionCloser; - _connection = connection; - } - - public void Init() - { - // start the process of setting up the connection. This is the first place that - // data is written to the server. - _protocolWriter.Write(new ProtocolInitiation()); - } - - public string Username - { - get - { - return AMQConnection.Username; - } - } - - public string Password - { - get - { - return AMQConnection.Password; - } - } - - ConnectionTuneParameters _connectionTuneParameters; // TODO: should be able to have this in the Java too. - - public ConnectionTuneParameters ConnectionTuneParameters - { - get - { - return _connectionTuneParameters; - } - set - { - _connectionTuneParameters = value; - AMQConnection con = AMQConnection; - con.SetMaximumChannelCount(value.ChannelMax); - con.MaximumFrameSize = value.FrameMax; - } - } - - private ISaslClient _saslClient; - public ISaslClient SaslClient - { - get { return _saslClient; } - set { _saslClient = value; } - } - - /// - /// Callback invoked from the BasicDeliverMethodHandler when a message has been received. - /// This is invoked on the MINA dispatcher thread. - /// - /// the unprocessed message - /// if this was not expected - public void UnprocessedMessageReceived(UnprocessedMessage message) - { - _channelId2UnprocessedMsgMap[message.ChannelId] = message; - } - - public void MessageContentHeaderReceived(ushort channelId, ContentHeaderBody contentHeader) - { - UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap[channelId]; - if (msg == null) - { - throw new AMQException("Error: received content header without having received a JMSDeliver frame first"); - } - if (msg.ContentHeader != null) - { - throw new AMQException("Error: received duplicate content header or did not receive correct number of content body frames"); - } - msg.ContentHeader = contentHeader; - if (contentHeader.BodySize == 0) - { - DeliverMessageToAMQSession(channelId, msg); - } - } - - public void MessageContentBodyReceived(ushort channelId, ContentBody contentBody) - { - UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap[channelId]; - if (msg == null) - { - throw new AMQException("Error: received content body without having received a BasicDeliver frame first"); - } - if (msg.ContentHeader == null) - { - _channelId2UnprocessedMsgMap.Remove(channelId); - throw new AMQException("Error: received content body without having received a ContentHeader frame first"); - } - try - { - msg.ReceiveBody(contentBody); - } - catch (UnexpectedBodyReceivedException e) - { - _channelId2UnprocessedMsgMap.Remove(channelId); - throw e; - } - if (msg.IsAllBodyDataReceived()) - { - DeliverMessageToAMQSession(channelId, msg); - } - } - - /// - /// Deliver a message to the appropriate session, removing the unprocessed message - /// from our map - /// the channel id the message should be delivered to - /// the message - private void DeliverMessageToAMQSession(ushort channelId, UnprocessedMessage msg) - { - AmqChannel channel = (AmqChannel) _channelId2SessionMap[channelId]; - channel.MessageReceived(msg); - _channelId2UnprocessedMsgMap.Remove(channelId); - } - - /// - /// Convenience method that writes a frame to the protocol session. Equivalent - /// to calling getProtocolSession().write(). - /// - /// the frame to write - public void WriteFrame(IDataBlock frame) - { - _protocolWriter.Write(frame); - } - - public void AddSessionByChannel(ushort channelId, AmqChannel channel) - { - if (channel == null) - { - throw new ArgumentNullException("Attempt to register a null channel"); - } - _logger.Debug("Add channel with channel id " + channelId); - _channelId2SessionMap[channelId] = channel; - } - - public void RemoveSessionByChannel(ushort channelId) - { - _logger.Debug("Removing session with channelId " + channelId); - _channelId2SessionMap.Remove(channelId); - } - - /// - /// Starts the process of closing a channel - /// - /// - public void CloseSession(AmqChannel channel) - { - _logger.Debug("closeSession called on protocol channel for channel " + channel.ChannelId); - ushort channelId = channel.ChannelId; - - // we need to know when a channel is closing so that we can respond - // with a channel.close frame when we receive any other type of frame - // on that channel - _closingChannels[channelId] = channel; - - } - - /// - /// Called from the ChannelClose handler when a channel close frame is received. - /// This method decides whether this is a response or an initiation. The latter - /// case causes the AmqChannel to be closed and an exception to be thrown if - /// appropriate. - /// - /// the id of the channel (session) - /// true if the client must respond to the server, i.e. if the server - /// initiated the channel close, false if the channel close is just the server - /// responding to the client's earlier request to close the channel. - public bool ChannelClosed(ushort channelId, int code, string text) - { - // if this is not a response to an earlier request to close the channel - if (!_closingChannels.ContainsKey(channelId)) - { - _closingChannels.Remove(channelId); - AmqChannel channel = (AmqChannel) _channelId2SessionMap[channelId]; - channel.ClosedWithException(new AMQException(_logger, code, text)); - return true; - } - else - { - return false; - } - } - - public AMQConnection AMQConnection - { - get - { - return _connection; - } - } - - public void CloseProtocolSession() - { - _logger.Debug("Closing protocol session"); - _connectionCloser.Close(); - } - - internal string GenerateQueueName() - { - return "ntmp_" + System.Guid.NewGuid(); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs deleted file mode 100644 index 2f23a1571d..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs +++ /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. - * - */ - -using System; -using System.Text; - -namespace Apache.Qpid.Client.Protocol -{ - /// - /// Default timeout values for the protocol - /// - sealed class DefaultTimeouts - { - /// - /// Maximum number of milliseconds to wait for a state change - /// in the protocol's state machine - /// - public const int MaxWaitForState = 30* 1000; - /// - /// Maximum number of milliseconds to wait for a reply - /// frame when doing synchronous writer to the broker - /// - public const int MaxWaitForSyncWriter = 30 * 1000; - - private DefaultTimeouts() - { - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs deleted file mode 100644 index e3298200c4..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs +++ /dev/null @@ -1,27 +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. - * - */ -namespace Apache.Qpid.Client.Protocol -{ - public interface IConnectionCloser - { - void Close(); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs deleted file mode 100644 index 3b53f015f8..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs +++ /dev/null @@ -1,36 +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. - * - */ -using System; -using Apache.Qpid.Client.Protocol.Listener; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Protocol -{ - public interface IProtocolListener - { - void OnMessage(IDataBlock message); - void OnException(Exception e); - - // XXX: .NET way of doing listeners? - void AddFrameListener(IAMQMethodListener listener); - void RemoveFrameListener(IAMQMethodListener listener); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs deleted file mode 100644 index 9cc9f8cee5..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs +++ /dev/null @@ -1,110 +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. - * - */ -using System; -using System.Threading; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Protocol.Listener -{ - public abstract class BlockingMethodFrameListener : IAMQMethodListener - { - private ManualResetEvent _resetEvent; - - public abstract bool ProcessMethod(ushort channelId, AMQMethodBody frame); - - /// - /// This is set if there is an exception thrown from processCommandFrame and the - /// exception is rethrown to the caller of blockForFrame() - /// - private volatile Exception _error; - - protected ushort _channelId; - - protected AMQMethodEvent _doneEvt = null; - - public BlockingMethodFrameListener(ushort channelId) - { - _channelId = channelId; - _resetEvent = new ManualResetEvent(false); - } - - /// - /// This method is called by the MINA dispatching thread. Note that it could - /// be called before BlockForFrame() has been called. - /// - /// the frame event - /// true if the listener has dealt with this frame - /// - public bool MethodReceived(AMQMethodEvent evt) - { - AMQMethodBody method = evt.Method; - - try - { - bool ready = (evt.ChannelId == _channelId) && ProcessMethod(evt.ChannelId, method); - if (ready) - { - _doneEvt = evt; - _resetEvent.Set(); - } - - return ready; - } - catch (AMQException e) - { - Error(e); - // we rethrow the error here, and the code in the frame dispatcher will go round - // each listener informing them that an exception has been thrown - throw e; - } - } - - /// - /// This method is called by the thread that wants to wait for a frame. - /// - /// Set the number of milliseconds to wait - public AMQMethodEvent BlockForFrame(int timeout) - { - _resetEvent.WaitOne(timeout, true); - //at this point the event will have been signalled. The error field might or might not be set - // depending on whether an error occurred - if (_error != null) - { - throw _error; - } - - return _doneEvt; - } - - /// - /// This is a callback, called by the MINA dispatcher thread only. It is also called from within this - /// class to avoid code repetition but again is only called by the MINA dispatcher thread. - /// - /// the exception that caused the error - public void Error(Exception e) - { - // set the error so that the thread that is blocking (in BlockForFrame()) - // can pick up the exception and rethrow to the caller - _error = e; - _resetEvent.Set(); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs deleted file mode 100644 index b5450d00f7..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs +++ /dev/null @@ -1,46 +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. - * - */ -using System; - -namespace Apache.Qpid.Client.Protocol.Listener -{ - public interface IAMQMethodListener - { - /// - /// Invoked when a method frame has been received - /// the event - /// true if the handler has processed the method frame, false otherwise. Note - /// that this does not prohibit the method event being delivered to subsequent listeners - /// but can be used to determine if nobody has dealt with an incoming method frame. - /// if an error has occurred. This exception will be delivered - /// to all registered listeners using the error() method (see below) allowing them to - /// perform cleanup if necessary. - bool MethodReceived(AMQMethodEvent evt); - - /// - /// Callback when an error has occurred. Allows listeners to clean up. - /// - /// the exception - void Error(Exception e); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs deleted file mode 100644 index 8cdc1dbba9..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs +++ /dev/null @@ -1,42 +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. - * - */ -using System; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Protocol.Listener -{ - public class SpecificMethodFrameListener : BlockingMethodFrameListener - { - private readonly Type _expectedClass; - - public SpecificMethodFrameListener(ushort channelId, Type expectedClass) : base(channelId) - { - _expectedClass = expectedClass; - } - - public override bool ProcessMethod(ushort channelId, AMQMethodBody frame) - { - return _expectedClass.IsInstanceOfType(frame); - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs b/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs deleted file mode 100644 index 11918f1ea2..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs +++ /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. - * - */ -using System; -using Apache.Qpid.Client.Protocol.Listener; -using Apache.Qpid.Client.Transport; -using Apache.Qpid.Framing; - -using log4net; - -namespace Apache.Qpid.Client.Protocol -{ - /// - /// A convenient interface to writing protocol frames. - /// - public class ProtocolWriter - { - - private ILog _logger = LogManager.GetLogger(typeof(ProtocolWriter)); - - IProtocolWriter _protocolWriter; - IProtocolListener _protocolListener; - - public ProtocolWriter(IProtocolWriter protocolWriter, IProtocolListener protocolListener) - { - _protocolWriter = protocolWriter; - _protocolListener = protocolListener; - } - - public void WriteFrame(IDataBlock frame) - { - _protocolWriter.Write(frame); - } - - /// - /// Convenience method that writes a frame to the protocol session and waits for - /// a particular response. Equivalent to calling getProtocolSession().write() then - /// waiting for the response. - /// - /// the frame - /// the blocking listener. Note the calling thread will block. - /// set the number of milliseconds to wait - private AMQMethodEvent SyncWrite(AMQFrame frame, BlockingMethodFrameListener listener, int timeout) - { - try - { - _protocolListener.AddFrameListener(listener); - _protocolWriter.Write(frame); - - return listener.BlockForFrame(timeout); - } - finally - { - _protocolListener.RemoveFrameListener(listener); - } - // When control resumes before this line, a reply will have been received - // that matches the criteria defined in the blocking listener - } - - /// - /// Convenience method that writes a frame to the protocol session and waits for - /// a particular response. Equivalent to calling getProtocolSession().write() then - /// waiting for the response. - /// - /// the frame - /// the type of method response - public AMQMethodEvent SyncWrite(AMQFrame frame, Type responseType) - { - // TODO: If each frame knew it's response type, then the responseType argument would - // TODO: not be neccesary. - return SyncWrite(frame, responseType, DefaultTimeouts.MaxWaitForSyncWriter); - } - - /// - /// Convenience method that writes a frame to the protocol session and waits for - /// a particular response. Equivalent to calling getProtocolSession().write() then - /// waiting for the response. - /// - /// the frame - /// the type of method response - /// set the number of milliseconds to wait - /// set the number of milliseconds to wait - public AMQMethodEvent SyncWrite(AMQFrame frame, Type responseType, int timeout) - { - return SyncWrite(frame, new SpecificMethodFrameListener(frame.Channel, responseType), timeout); - } - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs b/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs deleted file mode 100644 index ede8966f37..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs +++ /dev/null @@ -1,504 +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. - * - */ -using System; -using System.Collections; -using System.Net; -using System.Text; -using System.Text.RegularExpressions; -using log4net; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client -{ - - public class URLHelper - { - public static char DEFAULT_OPTION_SEPERATOR = '&'; - public static char ALTERNATIVE_OPTION_SEPARATOR = ','; - public static char BROKER_SEPARATOR = ';'; - - /// - /// - /// - /// - /// - public static void parseOptions(IDictionary optionMap, string options) - { - //options looks like this - //brokerlist='tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'',failover='method?option='value',option='value'' - - if (options == null || options.IndexOf('=') == -1) - { - return; - } - - int optionIndex = options.IndexOf('='); - - String option = options.Substring(0, optionIndex); - - int length = options.Length; - - int nestedQuotes = 0; - - // to store index of final "'" - int valueIndex = optionIndex; - - //Walk remainder of url. - while (nestedQuotes > 0 || valueIndex < length) - { - valueIndex++; - - if (valueIndex >= length) - { - break; - } - - if (options[valueIndex] == '\'') - { - if (valueIndex + 1 < options.Length) - { - if (options[valueIndex + 1] == DEFAULT_OPTION_SEPERATOR || - options[valueIndex + 1] == ALTERNATIVE_OPTION_SEPARATOR || - options[valueIndex + 1] == BROKER_SEPARATOR || - options[valueIndex + 1] == '\'') - { - nestedQuotes--; - // System.out.println( - // options + "\n" + "-" + nestedQuotes + ":" + getPositionString(valueIndex - 2, 1)); - if (nestedQuotes == 0) - { - //We've found the value of an option - break; - } - } - else - { - nestedQuotes++; - // System.out.println( - // options + "\n" + "+" + nestedQuotes + ":" + getPositionString(valueIndex - 2, 1)); - } - } - else - { - // We are at the end of the string - // Check to see if we are corectly closing quotes - if (options[valueIndex] == '\'') - { - nestedQuotes--; - } - - break; - } - } - } - - if (nestedQuotes != 0 || valueIndex < (optionIndex + 2)) - { - int sepIndex = 0; - - //Try and identify illegal separator character - if (nestedQuotes > 1) - { - for (int i = 0; i < nestedQuotes; i++) - { - sepIndex = options.IndexOf('\'', sepIndex); - sepIndex++; - } - } - - if (sepIndex >= options.Length || sepIndex == 0) - { - parseError(valueIndex, "Unterminated option", options); - } - else - { - parseError(sepIndex, "Unterminated option. Possible illegal option separator:'" + - options[sepIndex] + "'", options); - } - } - - // optionIndex +2 to skip "='" - int sublen = valueIndex - (optionIndex + 2); - String value = options.Substring(optionIndex + 2, sublen); - - optionMap.Add(option, value); - - if (valueIndex < (options.Length - 1)) - { - //Recurse to get remaining options - parseOptions(optionMap, options.Substring(valueIndex + 2)); - } - } - - - public static void parseError(int index, String error, String url) - { - parseError(index, 1, error, url); - } - - public static void parseError(int index, int length, String error, String url) - { - throw new UrlSyntaxException(url, error, index, length); - } - - public static String printOptions(Hashtable options) - { - if (options.Count == 0) - { - return ""; - } - else - { - StringBuilder sb = new StringBuilder(); - sb.Append('?'); - foreach (String key in options.Keys) - { - sb.AppendFormat("{0}='{1}'{2}", key, options[key], DEFAULT_OPTION_SEPERATOR); - } - - sb.Remove(sb.Length - 1, 1); - return sb.ToString(); - } - } - - } - - public class QpidConnectionUrl - { - internal static IConnectionInfo FromUrl(string fullURL) - { - //_url = fullURL; - IConnectionInfo connectionInfo = new QpidConnectionInfo(); - - - // _options = new HashMap(); - // _brokers = new LinkedList(); - // _failoverOptions = new HashMap(); - - // Connection URL format - //amqp://[user:pass@][clientid]/virtualhost?brokerlist='tcp://host:port?option=\'value\',option=\'value\';vm://:3/virtualpath?option=\'value\'',failover='method?option=\'value\',option='value''" - // Options are of course optional except for requiring a single broker in the broker list. - try - { - Uri connection = new Uri(fullURL); - - if (connection.Scheme == null || !(connection.Scheme.Equals(ConnectionUrlConstants.AMQ_PROTOCOL))) - { - throw new UrlSyntaxException(fullURL, "Not an AMQP URL"); - } - - if (connection.Host != null && connection.Host.Length > 0 && !connection.Host.Equals("default")) - { - connectionInfo.ClientName = connection.Host; - } - - String userInfo = connection.UserInfo; - if (userInfo == null || userInfo.Length == 0) - { - URLHelper.parseError(ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3, - "User information not found on url", fullURL); - } - else - { - parseUserInfo(userInfo, fullURL, connectionInfo); - } - String virtualHost = connection.AbsolutePath; // XXX: is AbsolutePath corrrect? - - if (virtualHost != null && virtualHost.Length > 0) - { - connectionInfo.VirtualHost = virtualHost; - } - else - { - int authLength = connection.Authority.Length; - int start = ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3; - int testIndex = start + authLength; - if (testIndex < fullURL.Length && fullURL[testIndex] == '?') - { - URLHelper.parseError(start, testIndex - start, "Virtual host found", fullURL); - } - else - { - URLHelper.parseError(-1, "Virtual host not specified", fullURL); - } - - } - - QpidConnectionInfo qci = (QpidConnectionInfo)connectionInfo; - string query = connection.Query; - if (query[0] == '?') query = query.Substring(1); - URLHelper.parseOptions(qci.GetOptions(), query); - - processOptions(connectionInfo); - - //Fragment is #string (not used) - //System.out.println(connection.getFragment()); - return connectionInfo; - } - catch (UriFormatException uris) - { - throw uris; - // if (uris is UrlSyntaxException) - // { - // throw uris; - // } - // - // int slash = fullURL.IndexOf("\\"); - // - // if (slash == -1) - // { - // URLHelper.parseError(uris.GetIndex(), uris.getReason(), uris.getInput()); - // } - // else - // { - // if (slash != 0 && fullURL.charAt(slash - 1) == ':') - // { - // URLHelper.parseError(slash - 2, fullURL.indexOf('?') - slash + 2, "Virtual host looks like a windows path, forward slash not allowed in URL", fullURL); - // } - // else - // { - // URLHelper.parseError(slash, "Forward slash not allowed in URL", fullURL); - // } - // } - } - } - - private static void parseUserInfo(String userinfo, string fullUrl, IConnectionInfo connectionInfo) - { - //user info = user:pass - - int colonIndex = userinfo.IndexOf(':'); - - if (colonIndex == -1) - { - URLHelper.parseError(ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3, - userinfo.Length, "Null password in user information not allowed.", fullUrl); - } - else - { - connectionInfo.Username = userinfo.Substring(0, colonIndex); - connectionInfo.Password = userinfo.Substring(colonIndex + 1); - } - } - - private static void processOptions(IConnectionInfo connectionInfo) - { - string brokerlist = connectionInfo.GetOption(ConnectionUrlConstants.OPTIONS_BROKERLIST); - if (brokerlist != null) - { - //brokerlist tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value' - Regex splitter = new Regex("" + URLHelper.BROKER_SEPARATOR); - - foreach (string broker in splitter.Split(brokerlist)) - { - connectionInfo.AddBrokerInfo(new AmqBrokerInfo(broker)); - } - - connectionInfo.SetOption(ConnectionUrlConstants.OPTIONS_BROKERLIST, null); - // _options.remove(OPTIONS_BROKERLIST); - } - - string failover = connectionInfo.GetOption(ConnectionUrlConstants.OPTIONS_FAILOVER); - if (failover != null) - { - // failover='method?option='value',option='value'' - - int methodIndex = failover.IndexOf('?'); - - if (methodIndex > -1) - { - connectionInfo.FailoverMethod = failover.Substring(0, methodIndex); - QpidConnectionInfo qpidConnectionInfo = (QpidConnectionInfo)connectionInfo; - URLHelper.parseOptions(qpidConnectionInfo.GetFailoverOptions(), - failover.Substring(methodIndex + 1)); - } - else - { - connectionInfo.FailoverMethod = failover; - } - - connectionInfo.SetOption(ConnectionUrlConstants.OPTIONS_FAILOVER, null); - // _options.remove(OPTIONS_FAILOVER); - } - } - - internal static IConnectionInfo FromUri(Uri uri) - { - return null; // FIXME - - } - } - - public class QpidConnectionInfo : IConnectionInfo - { - const string DEFAULT_VHOST = "/"; - string _username = "guest"; - string _password = "guest"; - string _virtualHost = DEFAULT_VHOST; - - string _failoverMethod = null; - IDictionary _failoverOptions = new Hashtable(); - IDictionary _options = new Hashtable(); - IList _brokerInfos = new ArrayList(); // List - string _clientName = String.Format("{0}{1:G}", Dns.GetHostName(), DateTime.Now.Ticks); - - public IDictionary GetFailoverOptions() - { - return _failoverOptions; - } - - public IDictionary GetOptions() - { - return _options; - } - - public static IConnectionInfo FromUrl(String url) - { - return QpidConnectionUrl.FromUrl(url); - } - - public string AsUrl() - { - StringBuilder sb = new StringBuilder(); - sb.AppendFormat("{0}://", ConnectionUrlConstants.AMQ_PROTOCOL); - - if (_username != null) - { - sb.Append(_username); - if (_password != null) - { - sb.AppendFormat(":{0}", _password); - } - sb.Append("@"); - } - - sb.Append(_clientName); - sb.Append(_virtualHost); - sb.Append(OptionsToString()); - - return sb.ToString(); - } - - private String OptionsToString() - { - StringBuilder sb = new StringBuilder(); - sb.AppendFormat("?{0}='", ConnectionUrlConstants.OPTIONS_BROKERLIST); - - foreach (IBrokerInfo broker in _brokerInfos) - { - sb.AppendFormat("{0};", broker); - } - - sb.Remove(sb.Length - 1, 1); - sb.Append("'"); - - if (_failoverMethod != null) - { - sb.AppendFormat("{0}{1}='{2}{3}'", URLHelper.DEFAULT_OPTION_SEPERATOR, - ConnectionUrlConstants.OPTIONS_FAILOVER, - _failoverMethod, - URLHelper.printOptions((Hashtable)_failoverOptions)); - } - - return sb.ToString(); - } - - - public string FailoverMethod - { - get { return _failoverMethod; } - set { _failoverMethod = value; } - } - - public string GetFailoverOption(string key) - { - return (string)_failoverOptions[key]; - } - - public int BrokerCount - { - get { return _brokerInfos.Count; } - } - - public IBrokerInfo GetBrokerInfo(int index) - { - return (IBrokerInfo)_brokerInfos[index]; - } - - public void AddBrokerInfo(IBrokerInfo brokerInfo) - { - if (!_brokerInfos.Contains(brokerInfo)) - { - _brokerInfos.Add(brokerInfo); - } - } - - public IList GetAllBrokerInfos() - { - return _brokerInfos; - } - - public string ClientName - { - get { return _clientName; } - set { _clientName = value; } - } - - public string Username - { - get { return _username; } - set { _username = value; } - } - - public string Password - { - get { return _password; } - set { _password = value; } - } - - public string VirtualHost - { - get { return _virtualHost; } - set { - _virtualHost = value; - if ( _virtualHost == null || _virtualHost.Length == 0 ) - _virtualHost = DEFAULT_VHOST; - if ( _virtualHost[0] != '/' ) - _virtualHost = '/' + _virtualHost; - } - } - - public string GetOption(string key) - { - return (string)_options[key]; - } - - public void SetOption(string key, string value) - { - _options[key] = value; - } - - public override string ToString() - { - return AsUrl(); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs b/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs deleted file mode 100644 index 9ac0381850..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs +++ /dev/null @@ -1,129 +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. - * - */ - -using System; -using System.Collections; -using System.Configuration; -using System.Text; -using Apache.Qpid.Sasl; -using Apache.Qpid.Sasl.Mechanisms; - -using Apache.Qpid.Client.Configuration; - -namespace Apache.Qpid.Client.Security -{ - - /// - /// Helper class to map SASL mechanisms to our - /// internal ISaslCallbackHandler implementations. - /// - /// - /// The set of configured callback handlers and their order - /// controls the selection of the SASL mechanism used for authentication. - /// - /// You can either replace the default handler for CRAM-MD5 and PLAIN - /// authentication (the two default options) using the application - /// configuration file. Configuration is done by especifying the SASL - /// mechanism name (e.g PLAIN) and the type implementing the callback handler - /// used to provide any data required by the mechanism like username and password. - /// - /// - /// Callback handler types should implement the IAMQCallbackHandler interface. - /// - /// - /// New callbacks or authentication mechanisms can be configured like this: - /// - /// - /// - /// - ///
- /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public sealed class CallbackHandlerRegistry - { - private static CallbackHandlerRegistry _instance = - new CallbackHandlerRegistry(); - private OrderedHashTable _mechanism2HandlerMap; - private string[] _mechanisms; - - public static CallbackHandlerRegistry Instance - { - get { return _instance; } - } - - public string[] Mechanisms - { - get { return _mechanisms; } - } - - private CallbackHandlerRegistry() - { - _mechanism2HandlerMap = (OrderedHashTable) - ConfigurationSettings.GetConfig("qpid.client/authentication"); - - // configure default options if not available - if ( _mechanism2HandlerMap == null ) - _mechanism2HandlerMap = new OrderedHashTable(); - - if ( !_mechanism2HandlerMap.Contains(ExternalSaslClient.Mechanism) ) - _mechanism2HandlerMap.Add(ExternalSaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler)); - if ( !_mechanism2HandlerMap.Contains(CramMD5SaslClient.Mechanism) ) - _mechanism2HandlerMap.Add(CramMD5SaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler)); - if ( !_mechanism2HandlerMap.Contains(CramMD5HexSaslClient.Mechanism) ) - _mechanism2HandlerMap.Add(CramMD5HexSaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler)); - if ( !_mechanism2HandlerMap.Contains(PlainSaslClient.Mechanism) ) - _mechanism2HandlerMap.Add(PlainSaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler)); - - _mechanisms = new string[_mechanism2HandlerMap.Count]; - _mechanism2HandlerMap.OrderedKeys.CopyTo(_mechanisms, 0); - } - - public bool IsSupportedMechanism(string mechanism) - { - return _mechanism2HandlerMap.Contains(mechanism); - } - - public string ChooseMechanism(string mechanisms) - { - IList mechs = mechanisms.Split(' '); - foreach ( string supportedMech in _mechanisms ) - { - if ( mechs.Contains(supportedMech) ) - return supportedMech; - } - return null; - } - - public Type GetCallbackHandler(string mechanism) - { - return (Type)_mechanism2HandlerMap[mechanism]; - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs b/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs deleted file mode 100644 index 6ff45be04a..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs +++ /dev/null @@ -1,35 +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. - * - */ -using System; -using System.Text; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Sasl; - -namespace Apache.Qpid.Client.Security -{ - public interface IAMQCallbackHandler : ISaslCallbackHandler - { - void Initialize(AMQProtocolSession session); - } - -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs b/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs deleted file mode 100644 index 743ade77c9..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs +++ /dev/null @@ -1,56 +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. - * - */ - -using System; -using System.Collections; -using System.Text; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Sasl; - -namespace Apache.Qpid.Client.Security -{ - internal class UsernamePasswordCallbackHandler : IAMQCallbackHandler - { - private AMQProtocolSession _session; - - public void Initialize(AMQProtocolSession session) - { - if ( session == null ) - throw new ArgumentNullException("session"); - - _session = session; - } - - public void Handle(ISaslCallback[] callbacks) - { - foreach ( ISaslCallback cb in callbacks ) - { - if ( cb is NameCallback ) - { - ((NameCallback)cb).Text = _session.Username; - } else if ( cb is PasswordCallback ) - { - ((PasswordCallback)cb).Text = _session.Password; - } - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/SslOptions.cs b/qpid/dotnet/Qpid.Client/Client/SslOptions.cs deleted file mode 100644 index 4630121828..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/SslOptions.cs +++ /dev/null @@ -1,81 +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. - * - */ -using System; -using System.Security.Cryptography.X509Certificates; - -namespace Apache.Qpid.Client -{ - /// - /// Configures SSL-related options to connect to an AMQP broker. - /// - /// - /// If the server certificate is not trusted by the client, - /// connection will fail. However, you can set the - /// property to true - /// to ignore any certificate verification errors for debugging purposes. - /// - public class SslOptions - { - private X509Certificate _clientCertificate; - private bool _ignoreValidationErrors; - - /// - /// Certificate to present to the broker to authenticate - /// this client connection - /// - public X509Certificate ClientCertificate - { - get { return _clientCertificate; } - } - - /// - /// If true, the validity of the broker certificate - /// will not be verified on connection - /// - public bool IgnoreValidationErrors - { - get { return _ignoreValidationErrors; } - } - - /// - /// Initialize a new instance with default values - /// (No client certificate, don't ignore validation errors) - /// - public SslOptions() - { - } - - /// - /// Initialize a new instance - /// - /// - /// Certificate to use to authenticate the client to the broker - /// - /// - /// If true, ignore any validation errors when validating the server certificate - /// - public SslOptions(X509Certificate clientCertificate, bool ignoreValidationErrors) - { - _clientCertificate = clientCertificate; - _ignoreValidationErrors = ignoreValidationErrors; - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs b/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs deleted file mode 100644 index 67f8427fb2..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs +++ /dev/null @@ -1,35 +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. - * - */ -namespace Apache.Qpid.Client.State -{ - public enum AMQState - { - CONNECTION_NOT_STARTED, - CONNECTION_NOT_TUNED, - CONNECTION_NOT_OPENED, - CONNECTION_OPEN, - CONNECTION_CLOSING, - CONNECTION_CLOSED, - ALL // all is a special state used in the state manager. It is not valid to be "in" the state "all". - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs b/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs deleted file mode 100644 index a464bbb6f5..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs +++ /dev/null @@ -1,52 +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. - * - */ -namespace Apache.Qpid.Client.State -{ - public class AMQStateChangedEvent - { - private readonly AMQState _oldState; - - private readonly AMQState _newState; - - public AMQStateChangedEvent(AMQState oldState, AMQState newState) - { - _oldState = oldState; - _newState = newState; - } - - public AMQState OldState - { - get - { - return _oldState; - } - } - - public AMQState NewState - { - get - { - return _newState; - } - } - - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs b/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs deleted file mode 100644 index 881e01e697..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs +++ /dev/null @@ -1,251 +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. - * - */ -using System; -using System.Collections; -using log4net; -using Apache.Qpid.Client.Handler; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Client.Protocol.Listener; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.State -{ - public class AMQStateManager : IAMQMethodListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(AMQStateManager)); - - const bool InfoLoggingHack = true; - - /// - /// The current state - /// - private AMQState _currentState; - - /// - /// Maps from an AMQState instance to a Map from Class to StateTransitionHandler. - /// The class must be a subclass of AMQFrame. - /// - private readonly IDictionary _state2HandlersMap; - private ArrayList _stateListeners; - private object _syncLock; - - public AMQStateManager() - { - _syncLock = new object(); - _state2HandlersMap = new Hashtable(); - _stateListeners = ArrayList.Synchronized(new ArrayList(5)); - _currentState = AMQState.CONNECTION_NOT_STARTED; - RegisterListeners(); - } - - private void RegisterListeners() - { - IStateAwareMethodListener connectionStart = new ConnectionStartMethodHandler(); - IStateAwareMethodListener connectionClose = new ConnectionCloseMethodHandler(); - IStateAwareMethodListener connectionCloseOk = new ConnectionCloseOkHandler(); - IStateAwareMethodListener connectionTune = new ConnectionTuneMethodHandler(); - IStateAwareMethodListener connectionSecure = new ConnectionSecureMethodHandler(); - IStateAwareMethodListener connectionOpenOk = new ConnectionOpenOkMethodHandler(); - IStateAwareMethodListener channelClose = new ChannelCloseMethodHandler(); - IStateAwareMethodListener basicDeliver = new BasicDeliverMethodHandler(); - IStateAwareMethodListener basicReturn = new BasicReturnMethodHandler(); - IStateAwareMethodListener queueDeleteOk = new QueueDeleteOkMethodHandler(); - IStateAwareMethodListener queuePurgeOk = new QueuePurgeOkMethodHandler(); - - // We need to register a map for the null (i.e. all state) handlers otherwise you get - // a stack overflow in the handler searching code when you present it with a frame for which - // no handlers are registered. - _state2HandlersMap[AMQState.ALL] = new Hashtable(); - - { - Hashtable notStarted = new Hashtable(); - notStarted[typeof(ConnectionStartBody)] = connectionStart; - notStarted[typeof(ConnectionCloseBody)] = connectionClose; - _state2HandlersMap[AMQState.CONNECTION_NOT_STARTED] = notStarted; - } - { - Hashtable notTuned = new Hashtable(); - notTuned[typeof(ConnectionTuneBody)] = connectionTune; - notTuned[typeof(ConnectionSecureBody)] = connectionSecure; - notTuned[typeof(ConnectionCloseBody)] = connectionClose; - _state2HandlersMap[AMQState.CONNECTION_NOT_TUNED] = notTuned; - } - { - Hashtable notOpened = new Hashtable(); - notOpened[typeof(ConnectionOpenOkBody)] = connectionOpenOk; - notOpened[typeof(ConnectionCloseBody)] = connectionClose; - _state2HandlersMap[AMQState.CONNECTION_NOT_OPENED] = notOpened; - } - { - Hashtable open = new Hashtable(); - open[typeof(ChannelCloseBody)] = channelClose; - open[typeof(ConnectionCloseBody)] = connectionClose; - open[typeof(BasicDeliverBody)] = basicDeliver; - open[typeof(BasicReturnBody)] = basicReturn; - open[typeof(QueueDeleteOkBody)] = queueDeleteOk; - open[typeof(QueuePurgeOkBody)] = queuePurgeOk; - _state2HandlersMap[AMQState.CONNECTION_OPEN] = open; - } - { - Hashtable closing = new Hashtable(); - closing[typeof(ConnectionCloseOkBody)] = connectionCloseOk; - _state2HandlersMap[AMQState.CONNECTION_CLOSING] = closing; - } - } - - public AMQState CurrentState - { - get - { - return _currentState; - } - } - - /// - /// Changes the state. - /// - /// The new state. - /// if there is an error changing state - public void ChangeState(AMQState newState) - { - if (InfoLoggingHack) - { - _logger.Debug("State changing to " + newState + " from old state " + _currentState); - } - _logger.Debug("State changing to " + newState + " from old state " + _currentState); - AMQState oldState = _currentState; - _currentState = newState; - - lock ( _syncLock ) - { - foreach ( IStateListener l in _stateListeners ) - { - l.StateChanged(oldState, newState); - } - } - } - - public void Error(Exception e) - { - _logger.Debug("State manager receive error notification: " + e); - lock ( _syncLock ) - { - foreach ( IStateListener l in _stateListeners ) - { - l.Error(e); - } - } - } - - public bool MethodReceived(AMQMethodEvent evt) - { - _logger.Debug(String.Format("Finding method handler. currentState={0} type={1}", _currentState, evt.Method.GetType())); - IStateAwareMethodListener handler = FindStateTransitionHandler(_currentState, evt.Method); - if (handler != null) - { - handler.MethodReceived(this, evt); - return true; - } - return false; - } - - /// - /// Finds the state transition handler. - /// - /// State of the current. - /// The frame. - /// - /// if the state transition if not allowed - private IStateAwareMethodListener FindStateTransitionHandler(AMQState currentState, - AMQMethodBody frame) - { - Type clazz = frame.GetType(); - if (_logger.IsDebugEnabled) - { - _logger.Debug("Looking for state transition handler for frame " + clazz); - } - IDictionary classToHandlerMap = (IDictionary) _state2HandlersMap[currentState]; - - if (classToHandlerMap == null) - { - // if no specialised per state handler is registered look for a - // handler registered for "all" states - return FindStateTransitionHandler(AMQState.ALL, frame); - } - IStateAwareMethodListener handler = (IStateAwareMethodListener) classToHandlerMap[clazz]; - if (handler == null) - { - if (currentState == AMQState.ALL) - { - _logger.Debug("No state transition handler defined for receiving frame " + frame); - return null; - } - else - { - // if no specialised per state handler is registered look for a - // handler registered for "all" states - return FindStateTransitionHandler(AMQState.ALL, frame); - } - } - else - { - return handler; - } - } - - public void AddStateListener(IStateListener listener) - { - _logger.Debug("Adding state listener"); - lock ( _syncLock ) - { - _stateListeners.Add(listener); - } - } - - public void RemoveStateListener(IStateListener listener) - { - lock ( _syncLock ) - { - _stateListeners.Remove(listener); - } - } - - public void AttainState(AMQState s) - { - if (_currentState != s) - { - StateWaiter sw = null; - try - { - _logger.Debug("Adding state wait to reach state " + s); - sw = new StateWaiter(s); - AddStateListener(sw); - sw.WaituntilStateHasChanged(); - // at this point the state will have changed. - } - finally - { - RemoveStateListener(sw); - } - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs b/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs deleted file mode 100644 index 31e4b5046d..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs +++ /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. - * - */ -namespace Apache.Qpid.Client.State -{ - public interface IAMQStateListener - { - void StateChanged(AMQStateChangedEvent evt); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs b/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs deleted file mode 100644 index 0874f39665..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs +++ /dev/null @@ -1,31 +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. - * - */ -using Apache.Qpid.Client.Protocol; - -namespace Apache.Qpid.Client.State -{ - public interface IStateAwareMethodListener - { - void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs b/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs deleted file mode 100644 index edd7382f93..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs +++ /dev/null @@ -1,33 +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. - * - */ -using System; - -namespace Apache.Qpid.Client.State -{ - public interface IStateListener - { - void StateChanged(AMQState oldState, AMQState newState); - - void Error(Exception e); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs b/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs deleted file mode 100644 index 81de622617..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs +++ /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. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Client.State -{ - [Serializable] - public class IllegalStateTransitionException : AMQException - { - private AMQState _originalState; - - private Type _frame; - - public IllegalStateTransitionException(AMQState originalState, Type frame) - : base("No valid state transition defined for receiving frame " + frame + - " from state " + originalState) - { - _originalState = originalState; - _frame = frame; - } - - protected IllegalStateTransitionException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - _originalState = (AMQState)info.GetValue("OriginalState", typeof(AMQState)); - _frame = (Type)info.GetValue("FrameType", typeof(Type)); - } - - public AMQState OriginalState - { - get - { - return _originalState; - } - } - - public Type FrameType - { - get - { - return _frame; - } - } - - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue("OriginalState", OriginalState); - info.AddValue("FrameType", FrameType); - } - } -} - - - diff --git a/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs b/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs deleted file mode 100644 index e739d0cb44..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs +++ /dev/null @@ -1,121 +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. - * - */ -using System; -using System.Threading; -using Apache.Qpid.Client.Protocol; -using log4net; - -namespace Apache.Qpid.Client.State -{ - public class StateWaiter : IStateListener - { - private static readonly ILog _logger = LogManager.GetLogger(typeof(StateWaiter)); - - private readonly AMQState _state; - private AMQState _newState; - - private volatile bool _newStateAchieved; - - private volatile Exception _exception; - - private ManualResetEvent _resetEvent = new ManualResetEvent(false); - - public StateWaiter(AMQState state) - { - _state = state; - } - - public void StateChanged(AMQState oldState, AMQState newState) - { - _newState = newState; - if (_logger.IsDebugEnabled) - { - _logger.Debug("stateChanged called"); - } - if (_state == newState) - { - _newStateAchieved = true; - - if (_logger.IsDebugEnabled) - { - _logger.Debug("New state reached so notifying monitor"); - } - _resetEvent.Set(); - } - } - - public void Error(Exception e) - { - if (_logger.IsDebugEnabled) - { - _logger.Debug("exceptionThrown called"); - } - - _exception = e; - _resetEvent.Set(); - } - - public void WaituntilStateHasChanged() - { - // - // The guard is required in case we are woken up by a spurious - // notify(). - // - - TimeSpan waitTime = TimeSpan.FromMilliseconds(DefaultTimeouts.MaxWaitForState); - DateTime waitUntilTime = DateTime.Now + waitTime; - - while ( !_newStateAchieved - && _exception == null - && waitTime.TotalMilliseconds > 0 ) - { - _logger.Debug("State not achieved so waiting..."); - try - { - _resetEvent.WaitOne(waitTime, true); - } - finally - { - if (!_newStateAchieved) - { - waitTime = waitUntilTime - DateTime.Now; - } - } - } - - if (_exception != null) - { - _logger.Debug("Throwable reached state waiter: " + _exception); - if (_exception is AMQException) - throw _exception; - else - throw new AMQException("Error: " + _exception, _exception); - } - - if (!_newStateAchieved) - { - string error = string.Format("State not achieved within permitted time. Current state: {0}, desired state: {1}", _state, _newState); - _logger.Warn(error); - throw new AMQException(error); - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs b/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs deleted file mode 100644 index dd0bb404cb..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs +++ /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. - * - */ -using Apache.Qpid.Codec; -using Apache.Qpid.Codec.Demux; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Transport -{ - public class AMQProtocolProvider - { - private DemuxingProtocolCodecFactory _factory; - - public AMQProtocolProvider() - { - _factory = new DemuxingProtocolCodecFactory(); - _factory.Register(new AMQDataBlockEncoder()); - _factory.Register(new AMQDataBlockDecoder()); - _factory.Register(new ProtocolInitiation.Decoder()); - } - - public IProtocolCodecFactory CodecFactory - { - get - { - return _factory; - } - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs b/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs deleted file mode 100644 index 1e217e755b..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs +++ /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. - * - */ -using System; -using System.Collections; -using log4net; -using Apache.Qpid.Buffer; -using Apache.Qpid.Codec; -using Apache.Qpid.Codec.Support; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Transport -{ - public class AmqpChannel : IProtocolChannel - { - // Warning: don't use this log for regular logging. - static readonly ILog _protocolTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ProtocolChannel"); - - IByteChannel _byteChannel; - IProtocolEncoder _encoder; - IProtocolDecoder _decoder; - IProtocolDecoderOutput _decoderOutput; - private object _syncLock; - - public AmqpChannel(IByteChannel byteChannel, IProtocolDecoderOutput decoderOutput) - { - _byteChannel = byteChannel; - _decoderOutput = decoderOutput; - _syncLock = new object(); - - AMQProtocolProvider protocolProvider = new AMQProtocolProvider(); - IProtocolCodecFactory factory = protocolProvider.CodecFactory; - _encoder = factory.Encoder; - _decoder = factory.Decoder; - } - - public void Read() - { - ByteBuffer buffer = _byteChannel.Read(); - Decode(buffer); - } - - public IAsyncResult BeginRead(AsyncCallback callback, object state) - { - return _byteChannel.BeginRead(callback, state); - } - - public void EndRead(IAsyncResult result) - { - ByteBuffer buffer = _byteChannel.EndRead(result); - Decode(buffer); - } - - public void Write(IDataBlock o) - { - // TODO: Refactor to decorator. - if (_protocolTraceLog.IsDebugEnabled) - { - _protocolTraceLog.Debug(String.Format("WRITE {0}", o)); - } - // we should be doing an async write, but apparently - // the mentalis library doesn't queue async read/writes - // correctly and throws random IOException's. Stay sync for a while - //_byteChannel.BeginWrite(Encode(o), OnAsyncWriteDone, null); - _byteChannel.Write(Encode(o)); - } - - // not used for now - //private void OnAsyncWriteDone(IAsyncResult result) - //{ - // _byteChannel.EndWrite(result); - //} - - private void Decode(ByteBuffer buffer) - { - // make sure we don't try to decode more than - // one buffer at the same time - lock ( _syncLock ) - { - _decoder.Decode(buffer, _decoderOutput); - } - } - - private ByteBuffer Encode(object o) - { - SingleProtocolEncoderOutput output = new SingleProtocolEncoderOutput(); - _encoder.Encode(o, output); - return output.buffer; - } - - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs b/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs deleted file mode 100644 index 35806f2a6e..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs +++ /dev/null @@ -1,71 +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. - * - */ -using System; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Transport -{ - /// - /// Represents input/output channels that read - /// and write instances - /// - public interface IByteChannel - { - /// - /// Read a from the underlying - /// network stream and any configured filters - /// - /// A ByteBuffer, if available - ByteBuffer Read(); - /// - /// Begin an asynchronous read operation - /// - /// Callback method to call when read operation completes - /// State object - /// An object - IAsyncResult BeginRead(AsyncCallback callback, object state); - /// - /// End an asynchronous read operation - /// - /// The object returned from - /// The read - ByteBuffer EndRead(IAsyncResult result); - /// - /// Write a to the underlying network - /// stream, going through any configured filters - /// - /// - void Write(ByteBuffer buffer); - /// - /// Begin an asynchronous write operation - /// - /// Buffer to write - /// A callback to call when the operation completes - /// State object - /// An object - IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state); - /// - /// End an asynchronous write operation - /// - /// The object returned by - void EndWrite(IAsyncResult result); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs b/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs deleted file mode 100644 index 0b59ee8799..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs +++ /dev/null @@ -1,32 +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. - * - */ -using System; -using System.Collections; - -namespace Apache.Qpid.Client.Transport -{ - public interface IProtocolChannel : IProtocolWriter - { - void Read(); - IAsyncResult BeginRead(AsyncCallback callback, object state); - void EndRead(IAsyncResult result); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs b/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs deleted file mode 100644 index 592dff3a19..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs +++ /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. - * - */ -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Transport -{ - public interface IProtocolWriter - { - void Write(IDataBlock o); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs b/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs deleted file mode 100644 index e0e890fc5a..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs +++ /dev/null @@ -1,38 +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. - * - */ -using System.IO; - -namespace Apache.Qpid.Client.Transport -{ - /// - /// Defines a way to introduce an arbitrary filtering - /// stream into the stream chain managed by - /// - public interface IStreamFilter - { - /// - /// Creates a new filtering stream on top of another - /// - /// Next stream on the stack - /// A new filtering stream - Stream CreateFilterStream(Stream lowerStream); - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs b/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs deleted file mode 100644 index 693a9a9534..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs +++ /dev/null @@ -1,32 +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. - * - */ -using Apache.Qpid.Client.Qms; -using Apache.Qpid.Client.Protocol; - -namespace Apache.Qpid.Client.Transport -{ - public interface ITransport : IConnectionCloser - { - void Connect(IBrokerInfo broker, AMQConnection connection); - string LocalEndpoint { get; } - IProtocolWriter ProtocolWriter { get; } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs b/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs deleted file mode 100644 index 0475236d92..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs +++ /dev/null @@ -1,322 +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. - * - */ -using System; -using System.IO; -using System.Threading; -using log4net; -using Apache.Qpid.Buffer; -using Apache.Qpid.Client.Protocol; - -namespace Apache.Qpid.Client.Transport -{ - /// - /// Responsible for reading and writing - /// ByteBuffers from/to network streams, and handling - /// the stream filters - /// - public class IoHandler : IByteChannel, IDisposable - { - private static readonly ILog _log = LogManager.GetLogger(typeof(IoHandler)); - private const int DEFAULT_BUFFER_SIZE = 32 * 1024; - - private Stream _topStream; - private IProtocolListener _protocolListener; - private int _readBufferSize; - - public int ReadBufferSize - { - get { return _readBufferSize; } - set { _readBufferSize = value; } - } - - /// - /// Initialize a new instance - /// - /// Underlying network stream - /// Protocol listener to report exceptions to - public IoHandler(Stream stream, IProtocolListener protocolListener) - { - if ( stream == null ) - throw new ArgumentNullException("stream"); - if ( protocolListener == null ) - throw new ArgumentNullException("protocolListener"); - - // initially, the stream at the top of the filter - // chain is the underlying network stream - _topStream = stream; - _protocolListener = protocolListener; - _readBufferSize = DEFAULT_BUFFER_SIZE; - } - - /// - /// Adds a new filter on the top of the chain - /// - /// Stream filter to put on top of the chain - /// - /// This should *only* be called during initialization. We don't - /// support changing the filter change after the first read/write - /// has been done and it's not thread-safe to boot! - /// - public void AddFilter(IStreamFilter filter) - { - _topStream = filter.CreateFilterStream(_topStream); - } - - #region IByteChannel Implementation - // - // IByteChannel Implementation - // - - /// - /// Read a from the underlying - /// network stream and any configured filters - /// - /// A ByteBuffer, if available - public ByteBuffer Read() - { - byte[] bytes = AllocateBuffer(); - - int numOctets = _topStream.Read(bytes, 0, bytes.Length); - - return WrapByteArray(bytes, numOctets); - } - - /// - /// Begin an asynchronous read operation - /// - /// Callback method to call when read operation completes - /// State object - /// An object - public IAsyncResult BeginRead(AsyncCallback callback, object state) - { - byte[] bytes = AllocateBuffer(); - ReadData rd = new ReadData(callback, state, bytes); - - // only put a callback if the caller wants one. - AsyncCallback myCallback = null; - if ( callback != null ) - myCallback = new AsyncCallback(OnAsyncReadDone); - - IAsyncResult result = _topStream.BeginRead( - bytes, 0, bytes.Length, myCallback,rd - ); - return new WrappedAsyncResult(result, bytes); - } - - /// - /// End an asynchronous read operation - /// - /// The object returned from - /// The read - public ByteBuffer EndRead(IAsyncResult result) - { - WrappedAsyncResult theResult = (WrappedAsyncResult)result; - int bytesRead = _topStream.EndRead(theResult.InnerResult); - return WrapByteArray(theResult.Buffer, bytesRead); - } - - /// - /// Write a to the underlying network - /// stream, going through any configured filters - /// - /// - public void Write(ByteBuffer buffer) - { - try - { - _topStream.Write(buffer.Array, buffer.Position, buffer.Limit); // FIXME - } - catch (Exception e) - { - _log.Warn("Write caused exception", e); - _protocolListener.OnException(e); - } - } - - /// - /// Begin an asynchronous write operation - /// - /// Buffer to write - /// A callback to call when the operation completes - /// State object - /// An object - public IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state) - { - try - { - return _topStream.BeginWrite( - buffer.Array, buffer.Position, buffer.Limit, - callback, state - ); - } catch ( Exception e ) - { - _log.Error("BeginWrite caused exception", e); - // not clear if an exception here should be propagated? we still - // need to propagate it upwards anyway! - _protocolListener.OnException(e); - throw; - } - } - - /// - /// End an asynchronous write operation - /// - /// The object returned by - public void EndWrite(IAsyncResult result) - { - try - { - _topStream.EndWrite(result); - } catch ( Exception e ) - { - _log.Error("EndWrite caused exception", e); - // not clear if an exception here should be propagated? - _protocolListener.OnException(e); - //throw; - } - } - #endregion // IByteChannel Implementation - - #region IDisposable Implementation - // - // IDisposable Implementation - // - - public void Dispose() - { - if ( _topStream != null ) - { - _topStream.Close(); - } - } - - #endregion // IDisposable Implementation - - #region Private and Helper Classes/Methods - // - // Private and Helper Classes/Methods - // - - private byte[] AllocateBuffer() - { - return new byte[ReadBufferSize]; - } - - private static ByteBuffer WrapByteArray(byte[] bytes, int size) - { - ByteBuffer byteBuffer = ByteBuffer.Wrap(bytes); - byteBuffer.Limit = size; - byteBuffer.Flip(); - - return byteBuffer; - } - - - private static void OnAsyncReadDone(IAsyncResult result) - { - ReadData rd = (ReadData) result.AsyncState; - IAsyncResult wrapped = new WrappedAsyncResult(result, rd.Buffer); - rd.Callback(wrapped); - } - - class ReadData - { - private object _state; - private AsyncCallback _callback; - private byte[] _buffer; - - public object State - { - get { return _state; } - } - - public AsyncCallback Callback - { - get { return _callback; } - } - - public byte[] Buffer - { - get { return _buffer; } - } - - public ReadData(AsyncCallback callback, object state, byte[] buffer) - { - _callback = callback; - _state = state; - _buffer = buffer; - } - } - - class WrappedAsyncResult : IAsyncResult - { - private IAsyncResult _innerResult; - private byte[] _buffer; - - #region IAsyncResult Properties - // - // IAsyncResult Properties - // - public bool IsCompleted - { - get { return _innerResult.IsCompleted; } - } - - public WaitHandle AsyncWaitHandle - { - get { return _innerResult.AsyncWaitHandle; } - } - - public object AsyncState - { - get { return _innerResult.AsyncState; } - } - - public bool CompletedSynchronously - { - get { return _innerResult.CompletedSynchronously; } - } - #endregion // IAsyncResult Properties - - public IAsyncResult InnerResult - { - get { return _innerResult; } - } - public byte[] Buffer - { - get { return _buffer; } - } - - public WrappedAsyncResult(IAsyncResult result, byte[] buffer) - { - if ( result == null ) - throw new ArgumentNullException("result"); - if ( buffer == null ) - throw new ArgumentNullException("buffer"); - - _innerResult = result; - _buffer = buffer; - } - } - - #endregion // Private and Helper Classes/Methods - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs b/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs deleted file mode 100644 index 9fa313152f..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs +++ /dev/null @@ -1,60 +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. - * - */ -using System; -using System.Threading; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Codec; -using Apache.Qpid.Framing; -using log4net; - -namespace Apache.Qpid.Client.Transport -{ - /// - /// implementation that forwards - /// each as it is decoded to the - /// protocol listener - /// - internal class ProtocolDecoderOutput : IProtocolDecoderOutput - { - private IProtocolListener _protocolListener; - static readonly ILog _protocolTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ProtocolChannel"); - - public ProtocolDecoderOutput(IProtocolListener protocolListener) - { - if ( protocolListener == null ) - throw new ArgumentNullException("protocolListener"); - - _protocolListener = protocolListener; - } - - public void Write(object message) - { - IDataBlock block = message as IDataBlock; - if ( block != null ) - { - _protocolTraceLog.Debug(String.Format("READ {0}", block)); - _protocolListener.OnMessage(block); - } - } - } -} // namespace Apache.Qpid.Client.Transport - - diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs b/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs deleted file mode 100644 index a1aa889ba0..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs +++ /dev/null @@ -1,40 +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. - * - */ -using System; -using Apache.Qpid.Buffer; -using Apache.Qpid.Codec; - -namespace Apache.Qpid.Client.Transport -{ - public class SingleProtocolEncoderOutput : IProtocolEncoderOutput - { - public ByteBuffer buffer; - - public void Write(ByteBuffer buf) - { - if (buffer != null) - { - throw new InvalidOperationException("{0} does not allow the writing of more than one buffer"); - } - buffer = buf; - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs b/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs deleted file mode 100644 index f336d8a80a..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs +++ /dev/null @@ -1,150 +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. - * - */ -using System; -using System.Collections; -using System.IO; -using System.Threading; -using Apache.Qpid.Client.Qms; -using Apache.Qpid.Client.Protocol; -using Apache.Qpid.Codec; -using Apache.Qpid.Framing; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - /// - /// TCP Socket transport supporting both - /// SSL and non-SSL connections. - /// - public class BlockingSocketTransport : ITransport - { - // Configuration variables. - IProtocolListener _protocolListener; - - // Runtime variables. - private ISocketConnector _connector; - private IoHandler _ioHandler; - private AmqpChannel _amqpChannel; - private ManualResetEvent _stopEvent; - - public IProtocolWriter ProtocolWriter - { - get { return _amqpChannel; } - } - public string LocalEndpoint - { - get { return _connector.LocalEndpoint; } - } - - - /// - /// Connect to the specified broker - /// - /// The broker to connect to - /// The AMQ connection - public void Connect(IBrokerInfo broker, AMQConnection connection) - { - _stopEvent = new ManualResetEvent(false); - _protocolListener = connection.ProtocolListener; - - _ioHandler = MakeBrokerConnection(broker, connection); - // todo: get default read size from config! - - IProtocolDecoderOutput decoderOutput = - new ProtocolDecoderOutput(_protocolListener); - _amqpChannel = - new AmqpChannel(new ByteChannel(_ioHandler), decoderOutput); - - // post an initial async read - _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), this); - } - - /// - /// Close the broker connection - /// - public void Close() - { - StopReading(); - CloseBrokerConnection(); - } - - private void StopReading() - { - _stopEvent.Set(); - } - - private void CloseBrokerConnection() - { - if ( _ioHandler != null ) - { - _ioHandler.Dispose(); - _ioHandler = null; - } - if ( _connector != null ) - { - _connector.Dispose(); - _connector = null; - } - } - - private IoHandler MakeBrokerConnection(IBrokerInfo broker, AMQConnection connection) - { - if ( broker.UseSSL ) - { - _connector = new SslSocketConnector(); - } else - { - _connector = new SocketConnector(); - } - - Stream stream = _connector.Connect(broker); - return new IoHandler(stream, connection.ProtocolListener); - } - - private void OnAsyncReadDone(IAsyncResult result) - { - try - { - _amqpChannel.EndRead(result); - - bool stopping = _stopEvent.WaitOne(0, false); - if ( !stopping ) - _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), null); - } catch ( Exception e ) - { - // ignore any errors during closing - bool stopping = _stopEvent.WaitOne(0, false); - if ( !stopping ) - _protocolListener.OnException(e); - } - } - - #region IProtocolDecoderOutput Members - - public void Write(object message) - { - _protocolListener.OnMessage((IDataBlock)message); - } - - #endregion - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs b/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs deleted file mode 100644 index 4540f01f4e..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs +++ /dev/null @@ -1,92 +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. - * - */ -using System; -using log4net; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - class ByteChannel : IByteChannel - { - // Warning: don't use this log for regular logging. - private static readonly ILog _ioTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ByteChannel"); - - private IByteChannel _lowerChannel; - - public ByteChannel(IByteChannel lowerChannel) - { - _lowerChannel = lowerChannel; - } - - public ByteBuffer Read() - { - ByteBuffer result = _lowerChannel.Read(); - - // TODO: Move into decorator. - if (_ioTraceLog.IsDebugEnabled) - { - _ioTraceLog.Debug(String.Format("READ {0}", result)); - } - - return result; - } - - public IAsyncResult BeginRead(AsyncCallback callback, object state) - { - return _lowerChannel.BeginRead(callback, state); - } - - public ByteBuffer EndRead(IAsyncResult result) - { - ByteBuffer buffer = _lowerChannel.EndRead(result); - if ( _ioTraceLog.IsDebugEnabled ) - { - _ioTraceLog.Debug(String.Format("READ {0}", buffer)); - } - return buffer; - } - - public void Write(ByteBuffer buffer) - { - // TODO: Move into decorator. - if (_ioTraceLog.IsDebugEnabled) - { - _ioTraceLog.Debug(String.Format("WRITE {0}", buffer)); - } - - _lowerChannel.Write(buffer); - } - - public IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state) - { - if ( _ioTraceLog.IsDebugEnabled ) - { - _ioTraceLog.Debug(String.Format("WRITE {0}", buffer)); - } - return _lowerChannel.BeginWrite(buffer, callback, state); - } - - public void EndWrite(IAsyncResult result) - { - _lowerChannel.EndWrite(result); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs b/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs deleted file mode 100644 index 137fa19c0d..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs +++ /dev/null @@ -1,34 +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. - * - */ -using System; -using System.IO; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - interface ISocketConnector : IDisposable - { - string LocalEndpoint { get; } - Stream Connect(IBrokerInfo broker); - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs b/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs deleted file mode 100644 index b6dd8c3be1..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs +++ /dev/null @@ -1,71 +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. - * - */ -using System.IO; -using System.Net; -using System.Net.Sockets; -using Apache.Qpid.Client.Qms; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - /// - /// Implements a TCP connection over regular sockets. - /// - class SocketConnector : ISocketConnector - { - private MyTcpClient _tcpClient; - - public string LocalEndpoint - { - get { return _tcpClient.LocalEndpoint.ToString(); } - } - - public Stream Connect(IBrokerInfo broker) - { - _tcpClient = new MyTcpClient(broker.Host, broker.Port); - return _tcpClient.GetStream(); - } - - public void Dispose() - { - if ( _tcpClient != null ) - { - _tcpClient.Close(); - _tcpClient = null; - } - } - - class MyTcpClient : TcpClient - { - public MyTcpClient(string host, int port) - : base(host, port) - { - } - - public EndPoint LocalEndpoint - { - get { return Client.LocalEndPoint; } - } - } - - } -} - - diff --git a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs b/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs deleted file mode 100644 index 8436e6fc4f..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs +++ /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. - * - */ -using System.IO; -using System.Net; -using log4net; -using Apache.Qpid.Client.Qms; -using Org.Mentalis.Security.Ssl; -using MCertificate = Org.Mentalis.Security.Certificates.Certificate; -using MCertificateChain = Org.Mentalis.Security.Certificates.CertificateChain; - -namespace Apache.Qpid.Client.Transport.Socket.Blocking -{ - /// - /// Implements a TLS v1.0 connection using the Mentalis.org library - /// - /// - /// It would've been easier to implement this at the StreamFilter - /// level, but unfortunately the Mentalis library doesn't support - /// a passthrough SSL stream class and is tied directly - /// to socket-like classes. - /// - class SslSocketConnector : ISocketConnector - { - private static ILog _logger = LogManager.GetLogger(typeof(SslSocketConnector)); - private MyTcpClient _tcpClient; - - public string LocalEndpoint - { - get { return _tcpClient.LocalEndpoint.ToString(); } - } - - public Stream Connect(IBrokerInfo broker) - { - MCertificate cert = GetClientCert(broker); - SecurityOptions options = new SecurityOptions( - SecureProtocol.Tls1, cert, ConnectionEnd.Client - ); - if ( broker.SslOptions != null - && broker.SslOptions.IgnoreValidationErrors ) - { - _logger.Warn("Ignoring any certificate validation errors during SSL handshake..."); - options.VerificationType = CredentialVerification.None; - } - - _tcpClient = new MyTcpClient(broker.Host, broker.Port, options); - return _tcpClient.GetStream(); - } - - public void Dispose() - { - if ( _tcpClient != null ) - { - _tcpClient.Close(); - _tcpClient = null; - } - } - - private static MCertificate GetClientCert(IBrokerInfo broker) - { - // if a client certificate is configured, - // use that to enable mutual authentication - MCertificate cert = null; - if ( broker.SslOptions != null - && broker.SslOptions.ClientCertificate != null ) - { - cert = MCertificate.CreateFromX509Certificate( - broker.SslOptions.ClientCertificate - ); - _logger.DebugFormat("Using Client Certificate for SSL '{0}'", cert.ToString(true)); - } - return cert; - } - - class MyTcpClient : SecureTcpClient - { - public MyTcpClient(string host, int port, SecurityOptions options) - : base(host, port, options) - { - } - - public EndPoint LocalEndpoint - { - get { return Client.LocalEndPoint; } - } - - } - - } -} diff --git a/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs b/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs deleted file mode 100644 index a06de9eac8..0000000000 --- a/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs +++ /dev/null @@ -1,98 +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. - * - */ -using System; -using System.Collections; -using System.Text; -using System.Threading; -using Apache.Qpid.Collections; -using Apache.Qpid.Common; - -namespace Apache.Qpid.Client.Util -{ - internal delegate void ThresholdMethod(int currentCount); - - /// - /// Basic bounded queue used to implement prefetching. - /// Notice we do the callbacks here asynchronously to - /// avoid adding more complexity to the channel impl. - /// - internal class FlowControlQueue - { - private BlockingQueue _queue = new LinkedBlockingQueue(); - private int _itemCount; - private int _lowerBound; - private int _upperBound; - private ThresholdMethod _underThreshold; - private ThresholdMethod _overThreshold; - - public FlowControlQueue( - int lowerBound, - int upperBound, - ThresholdMethod underThreshold, - ThresholdMethod overThreshold - ) - { - _lowerBound = lowerBound; - _upperBound = upperBound; - _underThreshold = underThreshold; - _overThreshold = overThreshold; - } - - public void Enqueue(object item) - { - _queue.EnqueueBlocking(item); - int count = Interlocked.Increment(ref _itemCount); - if ( _overThreshold != null ) - { - if ( count == _upperBound ) - { - _overThreshold.BeginInvoke( - count, new AsyncCallback(OnAsyncCallEnd), - _overThreshold - ); - } - } - } - - public object Dequeue() - { - object item = _queue.DequeueBlocking(); - int count = Interlocked.Decrement(ref _itemCount); - if ( _underThreshold != null ) - { - if ( count == _lowerBound ) - { - _underThreshold.BeginInvoke( - count, new AsyncCallback(OnAsyncCallEnd), - _underThreshold - ); - } - } - return item; - } - - private void OnAsyncCallEnd(IAsyncResult res) - { - ThresholdMethod method = (ThresholdMethod)res.AsyncState; - method.EndInvoke(res); - } - } -} diff --git a/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs b/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs deleted file mode 100644 index 670a4f90b2..0000000000 --- a/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,52 +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. - * - */ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.Client")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("Apache.Qpid.Client")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("380cb124-07a8-40c2-b67d-69a0d94cb620")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.0.0")] diff --git a/qpid/dotnet/Qpid.Client/Qpid.Client.csproj b/qpid/dotnet/Qpid.Client/Qpid.Client.csproj deleted file mode 100644 index 303f885149..0000000000 --- a/qpid/dotnet/Qpid.Client/Qpid.Client.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {68987C05-3768-452C-A6FC-6BA1D372852F} - Library - Properties - Apache.Qpid.Client - Apache.Qpid.Client - - - 2.0 - - - - - true - full - false - ..\bin\net-2.0\debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\bin\net-2.0\release\ - TRACE - prompt - 4 - - - - False - ..\Qpid.Common\lib\log4net\log4net.dll - - - False - ..\Qpid.Common\lib\seclib-1.0.0\Org.Mentalis.Security.dll - - - - - - - - - - - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Qpid.Buffer - - - {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88} - Qpid.Codec - - - {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07} - Qpid.Messaging - - - {77064C42-24D2-4CEB-9EA2-0EF481A43205} - Qpid.Common - - - {1465B0EE-6452-42A6-AB73-B2F9EABEEE75} - Qpid.Sasl - - - - - diff --git a/qpid/dotnet/Qpid.Client/default.build b/qpid/dotnet/Qpid.Client/default.build deleted file mode 100644 index 9a0ec2ea6d..0000000000 --- a/qpid/dotnet/Qpid.Client/default.build +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs b/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs deleted file mode 100644 index 93c00af6e0..0000000000 --- a/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs +++ /dev/null @@ -1,55 +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. - * - */ -using System; - -namespace Apache.Qpid.Client.Qms -{ - /// - /// Know URL option names. - /// - /// - public class BrokerInfoConstants - { - public const String OPTIONS_RETRY = "retries"; - public const String OPTIONS_SSL = ConnectionUrlConstants.OPTIONS_SSL; - public const String OPTIONS_CONNECT_TIMEOUT = "connecttimeout"; - public const int DEFAULT_PORT = 5672; - public const String DEFAULT_TRANSPORT = "tcp"; - - public readonly string URL_FORMAT_EXAMPLE = - "://[:][?