summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Messaging
diff options
context:
space:
mode:
authorTomas Restrepo <tomasr@apache.org>2007-05-18 00:51:12 +0000
committerTomas Restrepo <tomasr@apache.org>2007-05-18 00:51:12 +0000
commitdbe349500e458cdf38cd4e561d27c9fa24dff7ca (patch)
tree2390c50d9a0d31506b6e9007ab7dfed5bb51ad16 /dotnet/Qpid.Messaging
parentee94c939a9d77f0de6ae0cb33c782a9015bb8452 (diff)
downloadqpid-python-dbe349500e458cdf38cd4e561d27c9fa24dff7ca.tar.gz
Merged revisions 537954-538078,538080-538083,538085-538097,538099-538108,538110-538239,538241-538881,538883-538906,538908-538911,538913-538921,538923-539191 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r537954 | tomasr | 2007-05-14 14:10:59 -0500 (Mon, 14 May 2007) | 4 lines * QPID-487 (Contributed by Carlos Medina) Fix QpidConnectionInfo.ToString() * QPID-485 (Contributed by Carlos Medina) Fix AmqBrokerInfo.Equals() * QPID-456 Enforce virtual host names start with '/' ........ r538035 | tomasr | 2007-05-14 20:33:00 -0500 (Mon, 14 May 2007) | 6 lines * QPID-452 Improve message classes API * Add XML documentation to IChannel and IMessage * Add missing BrokerDetailTests * Add new tests for message creation and message factories * Fix wrong default encoding for text messages ........ r539178 | tomasr | 2007-05-17 18:50:50 -0500 (Thu, 17 May 2007) | 6 lines * QPID-492 Fix Race condition in message decoding * QPID-249 Make ServiceRequestingClient and ServiceProvidingClient a single, self contained test * Fix incorrect exception message in Qpid.Buffers, improve tests * Make ContentBody use an sliced buffer to avoid extra data copy * Remove useless tests in Qpid.Client (Blocking IO tests) ........ r539191 | tomasr | 2007-05-17 19:18:26 -0500 (Thu, 17 May 2007) | 1 line QPID-490 (Contributed by Carlos Medina) Implement PurgeQueue and DeleteQueue ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@539198 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Messaging')
-rw-r--r--dotnet/Qpid.Messaging/IChannel.cs150
-rw-r--r--dotnet/Qpid.Messaging/IHeaders.cs2
-rw-r--r--dotnet/Qpid.Messaging/IMessage.cs76
3 files changed, 200 insertions, 28 deletions
diff --git a/dotnet/Qpid.Messaging/IChannel.cs b/dotnet/Qpid.Messaging/IChannel.cs
index 7fceb1a532..7ff1e4b82d 100644
--- a/dotnet/Qpid.Messaging/IChannel.cs
+++ b/dotnet/Qpid.Messaging/IChannel.cs
@@ -23,42 +23,135 @@ using System;
namespace Qpid.Messaging
{
public delegate void MessageReceivedDelegate(IMessage msg);
-
+
+ /// <summary>
+ /// Interface used to manipulate an AMQP channel.
+ /// </summary>
+ /// <remarks>
+ /// You can create a channel by using the CreateChannel() method
+ /// of the connection object.
+ /// </remarks>
public interface IChannel : IDisposable
{
+ /// <summary>
+ /// Acknowledge mode for messages received
+ /// </summary>
AcknowledgeMode AcknowledgeMode { get; }
+ /// <summary>
+ /// True if the channel should use transactions
+ /// </summary>
bool Transacted { get; }
/// <summary>
/// Prefetch value to be used as the default for consumers created on this channel.
/// </summary>
- int DefaultPrefetch
- {
- get;
- set;
- }
-
+ int DefaultPrefetch { get; set; }
+
+ /// <summary>
+ /// Declare a new exchange
+ /// </summary>
+ /// <param name="exchangeName">Name of the exchange</param>
+ /// <param name="exchangeClass">Class of the exchange, from <see cref="ExchangeClassConstants"/></param>
void DeclareExchange(string exchangeName, string exchangeClass);
+ /// <summary>
+ /// Declare a new exchange using the default exchange class
+ /// </summary>
+ /// <param name="exchangeName">Name of the exchange</param>
void DeleteExchange(string exchangeName);
+ /// <summary>
+ /// Declare a new queue with the specified set of arguments
+ /// </summary>
+ /// <param name="queueName">Name of the queue</param>
+ /// <param name="isDurable">True if the queue should be durable</param>
+ /// <param name="isExclusive">True if the queue should be exclusive to this channel</param>
+ /// <param name="isAutoDelete">True if the queue should be deleted when the channel closes</param>
void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete);
- void DeleteQueue();
-
+ /// <summary>
+ /// Delete a queue with the specifies arguments
+ /// </summary>
+ /// <param name="queueName">Name of the queue to delete</param>
+ /// <param name="ifUnused">If true, the queue will not deleted if it has no consumers</param>
+ /// <param name="ifEmpty">If true, the queue will not deleted if it has no messages</param>
+ /// <param name="noWait">If true, the server will not respond to the method</param>
+ void DeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait);
+ /// <summary>
+ /// Generate a new Unique name to use for a queue
+ /// </summary>
+ /// <returns>A unique name to this channel</returns>
string GenerateUniqueName();
- IFieldTable CreateFieldTable();
+ /// <summary>
+ /// Removes all messages from a queue
+ /// </summary>
+ /// <param name="queueName">Name of the queue to delete</param>
+ /// <param name="noWait">If true, the server will not respond to the method</param>
+ void PurgeQueue(string queueName, bool noWait);
+
+ /// <summary>
+ /// Bind a queue to the specified exchange
+ /// </summary>
+ /// <param name="queueName">Name of queue to bind</param>
+ /// <param name="exchangeName">Name of exchange to bind to</param>
+ /// <param name="routingKey">Routing key</param>
void Bind(string queueName, string exchangeName, string routingKey);
+ /// <summary>
+ /// Bind a queue to the specified exchange
+ /// </summary>
+ /// <param name="queueName">Name of queue to bind</param>
+ /// <param name="exchangeName">Name of exchange to bind to</param>
+ /// <param name="routingKey">Routing key</param>
+ /// <param name="args">Table of arguments for the binding. Used to bind with a Headers Exchange</param>
void Bind(string queueName, string exchangeName, string routingKey, IFieldTable args);
+ /// <summary>
+ /// Create a new empty message with no body
+ /// </summary>
+ /// <returns>The new message</returns>
IMessage CreateMessage();
+ /// <summary>
+ /// Create a new message of the specified MIME type
+ /// </summary>
+ /// <param name="mimeType">The mime type to create</param>
+ /// <returns>The new message</returns>
+ IMessage CreateMessage(string mimeType);
+ /// <summary>
+ /// Creates a new message for bytes (application/octet-stream)
+ /// </summary>
+ /// <returns>The new message</returns>
IBytesMessage CreateBytesMessage();
+ /// <summary>
+ /// Creates a new text message (text/plain) with empty content
+ /// </summary>
+ /// <returns>The new message</returns>
ITextMessage CreateTextMessage();
+ /// <summary>
+ /// Creates a new text message (text/plain) with a body
+ /// </summary>
+ /// <param name="initialValue">Initial body of the message</param>
+ /// <returns>The new message</returns>
ITextMessage CreateTextMessage(string initialValue);
#region Consuming
-
+
+ /// <summary>
+ /// Creates a new Consumer using the builder pattern
+ /// </summary>
+ /// <param name="queueName">Name of queue to receive messages from</param>
+ /// <returns>The builder object</returns>
MessageConsumerBuilder CreateConsumerBuilder(string queueName);
+ /// <summary>
+ /// Creates a new consumer
+ /// </summary>
+ /// <param name="queueName">Name of queue to receive messages from</param>
+ /// <param name="prefetchLow">Low prefetch value</param>
+ /// <param name="prefetchHigh">High prefetch value</param>
+ /// <param name="noLocal">If true, messages sent on this channel will not be received by this consumer</param>
+ /// <param name="exclusive">If true, the consumer opens the queue in exclusive mode</param>
+ /// <param name="durable">If true, create a durable subscription</param>
+ /// <param name="subscriptionName">Subscription name</param>
+ /// <returns>The new consumer</returns>
IMessageConsumer CreateConsumer(string queueName,
int prefetchLow,
int prefetchHigh,
@@ -66,15 +159,35 @@ namespace Qpid.Messaging
bool exclusive,
bool durable,
string subscriptionName);
-
+
+ /// <summary>
+ /// Unsubscribe from a queue
+ /// </summary>
+ /// <param name="subscriptionName">Subscription name</param>
void Unsubscribe(string subscriptionName);
#endregion
#region Publishing
+ /// <summary>
+ /// Create a new message publisher using the builder pattern
+ /// </summary>
+ /// <returns>The builder object</returns>
MessagePublisherBuilder CreatePublisherBuilder();
-
+
+ /// <summary>
+ /// Create a new message publisher
+ /// </summary>
+ /// <param name="exchangeName">Name of exchange to publish to</param>
+ /// <param name="routingKey">Routing key</param>
+ /// <param name="deliveryMode">Default delivery mode</param>
+ /// <param name="timeToLive">Default TTL time of messages</param>
+ /// <param name="immediate">If true, sent immediately</param>
+ /// <param name="mandatory">If true, the broker will return an error
+ /// (as a connection exception) if the message cannot be delivered</param>
+ /// <param name="priority">Default message priority</param>
+ /// <returns>The new message publisher</returns>
IMessagePublisher CreatePublisher(string exchangeName,
string routingKey,
DeliveryMode deliveryMode,
@@ -86,9 +199,18 @@ namespace Qpid.Messaging
#endregion
#region Transactions
-
+
+ /// <summary>
+ /// Recover after transaction failure
+ /// </summary>
void Recover();
+ /// <summary>
+ /// Commit the transaction
+ /// </summary>
void Commit();
+ /// <summary>
+ /// Rollback the transaction
+ /// </summary>
void Rollback();
#endregion
diff --git a/dotnet/Qpid.Messaging/IHeaders.cs b/dotnet/Qpid.Messaging/IHeaders.cs
index aa2d0278f7..edd0ef989b 100644
--- a/dotnet/Qpid.Messaging/IHeaders.cs
+++ b/dotnet/Qpid.Messaging/IHeaders.cs
@@ -35,7 +35,7 @@ namespace Qpid.Messaging
{
bool Contains(string name);
- string this[string name] { get; set; }
+ object this[string name] { get; set; }
bool GetBoolean(string name);
void SetBoolean(string name, bool value);
diff --git a/dotnet/Qpid.Messaging/IMessage.cs b/dotnet/Qpid.Messaging/IMessage.cs
index 60febc942a..d63662f7e3 100644
--- a/dotnet/Qpid.Messaging/IMessage.cs
+++ b/dotnet/Qpid.Messaging/IMessage.cs
@@ -22,25 +22,75 @@ namespace Qpid.Messaging
{
public interface IMessage
{
- string ContentType { get; set;}
- string ContentEncoding { get; set; }
- string CorrelationId { get; set; }
- byte[] CorrelationIdAsBytes { get; set; }
- DeliveryMode DeliveryMode { get; set; }
- long Expiration { get; set; }
- string MessageId { get; set; }
- int Priority { get; set; }
+ /// <summary>
+ /// The MIME Content Type
+ /// </summary>
+ string ContentType { get; set;}
+ /// <summary>
+ /// The MIME Content Encoding
+ /// </summary>
+ string ContentEncoding { get; set; }
+ /// <summary>
+ /// The application correlation identifier
+ /// </summary>
+ string CorrelationId { get; set; }
+ /// <summary>
+ /// The application correlation identifier, as an array of bytes
+ /// </summary>
+ byte[] CorrelationIdAsBytes { get; set; }
+ /// <summary>
+ /// Non-persistent (1) or persistent (2)
+ /// </summary>
+ DeliveryMode DeliveryMode { get; set; }
+ /// <summary>
+ /// Message expiration specification
+ /// </summary>
+ long Expiration { get; set; }
+ /// <summary>
+ /// The application message identifier
+ /// </summary>
+ string MessageId { get; set; }
+ /// <summary>
+ /// The message priority, 0 to 9
+ /// </summary>
+ byte Priority { get; set; }
+ /// <summary>
+ /// True if the message has been redelivered
+ /// </summary>
bool Redelivered { get; set; }
+ /// <summary>
+ /// Exchange name of the reply-to address
+ /// </summary>
string ReplyToExchangeName { get; set; }
+ /// <summary>
+ /// Routing key of the reply-to address
+ /// </summary>
string ReplyToRoutingKey { get; set; }
+ /// <summary>
+ /// The message timestamp
+ /// </summary>
long Timestamp { get; set; }
+ /// <summary>
+ /// The message type name
+ /// </summary>
string Type { get; set; }
+ /// <summary>
+ /// Message headers
+ /// </summary>
IHeaders Headers { get; }
-
- // XXX: UserId?
- // XXX: AppId?
- // XXX: ClusterId?
-
+ /// <summary>
+ /// The creating user id
+ /// </summary>
+ string UserId { get; set; }
+ /// <summary>
+ /// The creating application id
+ /// </summary>
+ string AppId { get; set; }
+ /// <summary>
+ /// Intra-cluster routing identifier
+ /// </summary>
+ string ClusterId { get; set; }
+
void Acknowledge();
void ClearBody();
}