-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIMessagingClientFactory.cs
More file actions
285 lines (273 loc) · 13.1 KB
/
IMessagingClientFactory.cs
File metadata and controls
285 lines (273 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Core;
using System;
using System.Collections.Generic;
namespace RapidField.SolidInstruments.Messaging
{
/// <summary>
/// Represents an appliance that creates manages implementation-specific messaging clients.
/// </summary>
/// <typeparam name="TSender">
/// The type of the implementation-specific send client.
/// </typeparam>
/// <typeparam name="TReceiver">
/// The type of the implementation-specific receive client.
/// </typeparam>
/// <typeparam name="TAdaptedMessage">
/// The type of implementation-specific adapted messages.
/// </typeparam>
public interface IMessagingClientFactory<TSender, TReceiver, TAdaptedMessage> : IAsyncDisposable, IDisposable
where TAdaptedMessage : class
{
/// <summary>
/// Returns a queue entity path for the specified message type.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message.
/// </typeparam>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// A queue entity path for the specified message type.
/// </returns>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
public IMessagingEntityPath GetQueuePath<TMessage>(IEnumerable<String> pathLabels)
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message receiver for a type-defined queue.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <returns>
/// The managed, implementation-specific message receiver.
/// </returns>
/// <exception cref="MessageListeningException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TReceiver GetQueueReceiver<TMessage>()
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message receiver for a type-defined queue.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// The managed, implementation-specific message receiver.
/// </returns>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
/// <exception cref="MessageListeningException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TReceiver GetQueueReceiver<TMessage>(IEnumerable<String> pathLabels)
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message sender for a type-defined queue.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <returns>
/// The managed, implementation-specific message sender.
/// </returns>
/// <exception cref="MessageTransmissionException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TSender GetQueueSender<TMessage>()
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message sender for a type-defined queue.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// The managed, implementation-specific message sender.
/// </returns>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
/// <exception cref="MessageTransmissionException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TSender GetQueueSender<TMessage>(IEnumerable<String> pathLabels)
where TMessage : class;
/// <summary>
/// Returns a subscription name for the specified message type.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message.
/// </typeparam>
/// <param name="receiverIdentifier">
/// A unique textual identifier for the message receiver, or <see langword="null" /> if the receiver is unspecified.
/// </param>
/// <param name="entityPath">
/// The unique path for the entity.
/// </param>
/// <returns>
/// A subscription name for the specified message type.
/// </returns>
/// <exception cref="ArgumentEmptyException">
/// <paramref name="receiverIdentifier" /> is empty.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="receiverIdentifier" /> is <see langword="null" /> -or- <paramref name="entityPath" /> is
/// <see langword="null" />.
/// </exception>
public String GetSubscriptionName<TMessage>(String receiverIdentifier, IMessagingEntityPath entityPath)
where TMessage : class;
/// <summary>
/// Returns a topic entity path for the specified message type.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message.
/// </typeparam>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// A topic entity path for the specified message type.
/// </returns>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
public IMessagingEntityPath GetTopicPath<TMessage>(IEnumerable<String> pathLabels)
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message receiver for a type-defined topic.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <param name="receiverIdentifier">
/// A unique textual identifier for the message receiver.
/// </param>
/// <returns>
/// The managed, implementation-specific message receiver.
/// </returns>
/// <exception cref="ArgumentEmptyException">
/// <paramref name="receiverIdentifier" /> is empty.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="receiverIdentifier" /> is <see langword="null" />.
/// </exception>
/// <exception cref="MessageListeningException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TReceiver GetTopicReceiver<TMessage>(String receiverIdentifier)
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message receiver for a type-defined topic.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <param name="receiverIdentifier">
/// A unique textual identifier for the message receiver.
/// </param>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// The managed, implementation-specific message receiver.
/// </returns>
/// <exception cref="ArgumentEmptyException">
/// <paramref name="receiverIdentifier" /> is empty.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="receiverIdentifier" /> is <see langword="null" />.
/// </exception>
/// <exception cref="MessageListeningException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TReceiver GetTopicReceiver<TMessage>(String receiverIdentifier, IEnumerable<String> pathLabels)
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message sender for a type-defined topic.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <returns>
/// The managed, implementation-specific message sender.
/// </returns>
/// <exception cref="MessageTransmissionException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TSender GetTopicSender<TMessage>()
where TMessage : class;
/// <summary>
/// Gets a shared, managed, implementation-specific message sender for a type-defined topic.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message that the client handles.
/// </typeparam>
/// <param name="pathLabels">
/// An ordered collection of as many as three non-null, non-empty alphanumeric textual labels to append to the path, or
/// <see langword="null" /> to omit path labels. The default value is <see langword="null" />.
/// </param>
/// <returns>
/// The managed, implementation-specific message sender.
/// </returns>
/// <exception cref="ArgumentException">
/// <paramref name="pathLabels" /> contains one or more null or empty labels and/or labels with non-alphanumeric characters,
/// or contains more than three elements.
/// </exception>
/// <exception cref="MessageTransmissionException">
/// An exception was raised while creating the client.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public TSender GetTopicSender<TMessage>(IEnumerable<String> pathLabels)
where TMessage : class;
}
}