From 509d48d3a12c3477c893456549e0d052d9e5e9f9 Mon Sep 17 00:00:00 2001 From: Robert Greig Date: Mon, 29 Jan 2007 11:05:20 +0000 Subject: (Patch supplied by Tomas Restrepo) QPID-312.diff applied. This converts Javadoc copied accross from the orignal Java code to .Net format. Renames some files/classes/methods to use .Net conventions. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@501006 13f79535-47bb-0310-9956-ffa450edef68 --- dotnet/Qpid.Client/Client/AMQConnection.cs | 30 +++--- dotnet/Qpid.Client/Client/AmqBrokerInfo.cs | 118 +++++++++++------------- dotnet/Qpid.Client/Client/QpidConnectionInfo.cs | 92 ++++++++---------- 3 files changed, 105 insertions(+), 135 deletions(-) (limited to 'dotnet/Qpid.Client/Client') diff --git a/dotnet/Qpid.Client/Client/AMQConnection.cs b/dotnet/Qpid.Client/Client/AMQConnection.cs index 3192b0018d..1a342f0b15 100644 --- a/dotnet/Qpid.Client/Client/AMQConnection.cs +++ b/dotnet/Qpid.Client/Client/AMQConnection.cs @@ -26,7 +26,7 @@ using System.Threading; using log4net; using Qpid.Client.Failover; using Qpid.Client.Protocol; -using Qpid.Client.qms; +using Qpid.Client.Qms; using Qpid.Client.State; using Qpid.Client.Transport; using Qpid.Client.Transport.Socket.Blocking; @@ -40,7 +40,7 @@ namespace Qpid.Client { private static readonly ILog _log = LogManager.GetLogger(typeof(AMQConnection)); - ConnectionInfo _connectionInfo; + IConnectionInfo _connectionInfo; private int _nextChannelId = 0; // _Connected should be refactored with a suitable wait object. @@ -121,7 +121,7 @@ namespace Qpid.Client get { return _protocolWriter; } } - public AMQConnection(ConnectionInfo connectionInfo) + public AMQConnection(IConnectionInfo connectionInfo) { if (connectionInfo == null) { @@ -129,7 +129,7 @@ namespace Qpid.Client } _log.Info("ConnectionInfo: " + connectionInfo); _connectionInfo = connectionInfo; - _log.Info("password = " + _connectionInfo.GetPassword()); + _log.Info("password = " + _connectionInfo.Password); _failoverPolicy = new FailoverPolicy(connectionInfo); // We are not currently connected. @@ -140,7 +140,7 @@ namespace Qpid.Client { try { - BrokerInfo brokerInfo = _failoverPolicy.GetNextBrokerInfo(); + IBrokerInfo brokerInfo = _failoverPolicy.GetNextBrokerInfo(); _log.Info("Connecting to " + brokerInfo); MakeBrokerConnection(brokerInfo); break; @@ -220,12 +220,12 @@ namespace Qpid.Client get { CheckNotClosed(); - return _connectionInfo.GetClientName(); + return _connectionInfo.ClientName; } set { CheckNotClosed(); - _connectionInfo.SetClientName(value); + _connectionInfo.ClientName = value; } } @@ -505,7 +505,7 @@ namespace Qpid.Client { get { - return _failoverPolicy.GetCurrentBrokerInfo().getHost(); + return _failoverPolicy.GetCurrentBrokerInfo().Host; } } @@ -513,7 +513,7 @@ namespace Qpid.Client { get { - return _failoverPolicy.GetCurrentBrokerInfo().getPort(); + return _failoverPolicy.GetCurrentBrokerInfo().Port; } } @@ -521,7 +521,7 @@ namespace Qpid.Client { get { - return _connectionInfo.GetUsername(); + return _connectionInfo.Username; } } @@ -529,7 +529,7 @@ namespace Qpid.Client { get { - return _connectionInfo.GetPassword(); + return _connectionInfo.Password; } } @@ -537,7 +537,7 @@ namespace Qpid.Client { get { - return _connectionInfo.GetVirtualHost(); + return _connectionInfo.VirtualHost; } } @@ -674,7 +674,7 @@ namespace Qpid.Client public bool AttemptReconnection(String host, int port, bool useSSL) { - BrokerInfo bd = new AmqBrokerInfo("amqp", host, port, useSSL); + IBrokerInfo bd = new AmqBrokerInfo("amqp", host, port, useSSL); _failoverPolicy.setBroker(bd); @@ -691,7 +691,7 @@ namespace Qpid.Client return false; } - private void MakeBrokerConnection(BrokerInfo brokerDetail) + private void MakeBrokerConnection(IBrokerInfo brokerDetail) { try { @@ -708,7 +708,7 @@ namespace Qpid.Client _transport = LoadTransportFromAssembly(brokerDetail.getHost(), brokerDetail.getPort(), assemblyName, transportType); */ - _transport = new BlockingSocketTransport(brokerDetail.getHost(), brokerDetail.getPort(), this); + _transport = new BlockingSocketTransport(brokerDetail.Host, brokerDetail.Port, this); // Connect. _transport.Open(); diff --git a/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs b/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs index 81a5f10647..f26756ccad 100644 --- a/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs +++ b/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs @@ -21,11 +21,11 @@ using System; using System.Collections; using System.Text; -using Qpid.Client.qms; +using Qpid.Client.Qms; namespace Qpid.Client { - public class AmqBrokerInfo : BrokerInfo + public class AmqBrokerInfo : IBrokerInfo { public readonly string URL_FORMAT_EXAMPLE = "://[:][?