Skip to content

Commit

Permalink
IManagement XML docs
Browse files Browse the repository at this point in the history
* Also add docs to implementing classes.
* Re-order methods in classes to be public, protected, internal, private.
  • Loading branch information
lukebakken committed Dec 16, 2024
1 parent afa3c82 commit e6cf579
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 255 deletions.
63 changes: 38 additions & 25 deletions RabbitMQ.AMQP.Client/IManagement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,64 @@
// and the Mozilla Public License, version 2.0.
// Copyright (c) 2017-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace RabbitMQ.AMQP.Client
{
public class ModelException : Exception
{
public ModelException(string message) : base(message)
{
}
}

public class PreconditionFailedException : Exception
{
public PreconditionFailedException(string message) : base(message)
{
}
}

public class BadRequestException : Exception
{
public BadRequestException(string message) : base(message)
{
}
}

/// <summary>
/// IManagement interface and is responsible for managing the AMQP resources.
/// RabbitMQ uses AMQP end point: "/management" to manage the resources like queues, exchanges, and bindings.
/// The management endpoint works like an HTTP RPC endpoint where the client sends a request to the server.
/// The <see cref="IManagement"/> interface is used to manage the
/// <see href="https://www.rabbitmq.com/tutorials/amqp-concepts">AMQP 0.9.1 model</see>
/// topology (exchanges, queues, and bindings).
/// </summary>
public interface IManagement : ILifeCycle
{
/// <summary>
/// Create an <see cref="IQueueSpecification"/>, with an auto-generated name.
/// </summary>
/// <returns>A builder for <see cref="IQueueSpecification"/></returns>
IQueueSpecification Queue();

/// <summary>
/// Create an <see cref="IQueueSpecification"/>, with the given name.
/// </summary>
/// <returns>A builder for <see cref="IQueueSpecification"/></returns>
IQueueSpecification Queue(string name);

/// <summary>
/// Get the <see cref="IQueueInfo"/> for the given queue specification.
/// </summary>
/// <param name="queueSpec">The <see cref="IQueueSpecification"/></param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/></param>
/// <returns>The <see cref="IQueueInfo"/> for the given spec.</returns>
Task<IQueueInfo> GetQueueInfoAsync(IQueueSpecification queueSpec,
CancellationToken cancellationToken = default);

/// <summary>
/// Get the <see cref="IQueueInfo"/> for the given queue name.
/// </summary>
/// <param name="queueName">The queue name</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/></param>
/// <returns>The <see cref="IQueueInfo"/> for the given spec.</returns>
Task<IQueueInfo> GetQueueInfoAsync(string queueName,
CancellationToken cancellationToken = default);

/// <summary>
/// Create an <see cref="IExchangeSpecification"/>, with an auto-generated name.
/// </summary>
/// <returns>A builder for <see cref="IExchangeSpecification"/></returns>
IExchangeSpecification Exchange();

/// <summary>
/// Create an <see cref="IExchangeSpecification"/>, with the given name.
/// </summary>
/// <returns>A builder for <see cref="IExchangeSpecification"/></returns>
IExchangeSpecification Exchange(string name);

/// <summary>
/// Create an <see cref="IBindingSpecification"/>.
/// </summary>
/// <returns>A builder for <see cref="IBindingSpecification"/></returns>
IBindingSpecification Binding();
}

Expand Down
Loading

0 comments on commit e6cf579

Please sign in to comment.