Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions RabbitMQ.AMQP.Client/ConnectionExceptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This source code is dual-licensed under the Apache License, version 2.0,
// 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;

namespace RabbitMQ.AMQP.Client
{
/// <summary>
/// Exception related to <see cref="IConnection"/>
/// </summary>
public class ConnectionException : Exception
{
/// <summary>
/// Create a <see cref="ConnectionException"/> with the specified message.
/// </summary>
public ConnectionException(string message) : base(message)
{
}

/// <summary>
/// Create a <see cref="ConnectionException"/> with the specified message and inner <see cref="Exception"/>.
/// </summary>
public ConnectionException(string message, Exception innerException) : base(message, innerException)
{
}
}
}
47 changes: 35 additions & 12 deletions RabbitMQ.AMQP.Client/IConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,63 @@
// 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.Collections.Generic;

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

public ConnectionException(string message, Exception innerException) : base(message, innerException)
{
}
}

public interface IConnection : ILifeCycle
{
/// <summary>
/// The <see cref="IManagement"/> instance for this connection.
/// </summary>
/// <returns><see cref="IManagement"/> instance for this connection.</returns>
IManagement Management();

/// <summary>
/// Create an <see cref="IPublisherBuilder"/> instance for this connection.
/// </summary>
/// <returns><see cref="IPublisherBuilder"/> instance for this connection.</returns>
IPublisherBuilder PublisherBuilder();

/// <summary>
/// Create an <see cref="IConsumerBuilder"/> instance for this connection.
/// </summary>
/// <returns><see cref="IConsumerBuilder"/> instance for this connection.</returns>
IConsumerBuilder ConsumerBuilder();

/// <summary>
/// Create an <see cref="IRpcServerBuilder"/> instance for this connection.
/// </summary>
/// <returns><see cref="IRpcServerBuilder"/> instance for this connection.</returns>
IRpcServerBuilder RpcServerBuilder();

/// <summary>
/// Create an <see cref="IRpcClientBuilder"/> instance for this connection.
/// </summary>
/// <returns><see cref="IRpcClientBuilder"/> instance for this connection.</returns>
IRpcClientBuilder RpcClientBuilder();

/// <summary>
/// Get the properties for this connection.
/// </summary>
/// <returns><see cref="IReadOnlyDictionary{TKey, TValue}"/> of connection properties.</returns>
public IReadOnlyDictionary<string, object> Properties { get; }

/// <summary>
/// Get the <see cref="IPublisher"/> instances associated with this connection.
/// </summary>
/// <returns><see cref="IEnumerable{T}"/> of <see cref="IPublisher"/> instances.</returns>
public IEnumerable<IPublisher> Publishers { get; }

/// <summary>
/// Get the <see cref="IConsumer"/> instances associated with this connection.
/// </summary>
/// <returns><see cref="IEnumerable{T}"/> of <see cref="IConsumer"/> instances.</returns>
public IEnumerable<IConsumer> Consumers { get; }

/// <summary>
/// Get or set the Connection ID. Used by <see cref="IEnvironment"/>
/// </summary>
public long Id { get; set; }
}
}
Loading
Loading