Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using Cqrs.Authentication;
11 : using Cqrs.Configuration;
12 : using cdmdotnet.Logging;
13 : using Cqrs.Bus;
14 :
15 : namespace Cqrs.Azure.ServiceBus
16 : {
17 : /// <summary>
18 : /// A event bus based on <see cref="AzureServiceBus{TAuthenticationToken}"/>.
19 : /// </summary>
20 : /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
21 : public abstract class AzureEventBus<TAuthenticationToken>
22 : : AzureServiceBus<TAuthenticationToken>
23 1 : {
24 : #region Overrides of AzureServiceBus<TAuthenticationToken>
25 :
26 : /// <summary>
27 : /// The configuration key for the message bus connection string as used by <see cref="IConfigurationManager"/>.
28 : /// </summary>
29 : protected override string MessageBusConnectionStringConfigurationKey
30 : {
31 : get { return "Cqrs.Azure.EventBus.ConnectionString"; }
32 : }
33 :
34 : /// <summary>
35 : /// The configuration key for the signing token as used by <see cref="IConfigurationManager"/>.
36 : /// </summary>
37 : protected override string SigningTokenConfigurationKey
38 : {
39 : get { return "Cqrs.Azure.EventBus.SigningToken"; }
40 : }
41 :
42 : /// <summary>
43 : /// The configuration key for the name of the private topic as used by <see cref="IConfigurationManager"/>.
44 : /// </summary>
45 : protected override string PrivateTopicNameConfigurationKey
46 : {
47 : get { return "Cqrs.Azure.EventBus.PrivateEvent.TopicName"; }
48 : }
49 :
50 : /// <summary>
51 : /// The configuration key for the name of the public topic as used by <see cref="IConfigurationManager"/>.
52 : /// </summary>
53 : protected override string PublicTopicNameConfigurationKey
54 : {
55 : get { return "Cqrs.Azure.EventBus.PublicEvent.TopicName"; }
56 : }
57 :
58 : /// <summary>
59 : /// The configuration key for the name of the subscription in the private topic as used by <see cref="IConfigurationManager"/>.
60 : /// </summary>
61 : protected override string PrivateTopicSubscriptionNameConfigurationKey
62 : {
63 : get { return "Cqrs.Azure.EventBus.PrivateEvent.TopicName.SubscriptionName"; }
64 : }
65 :
66 : /// <summary>
67 : /// The configuration key for the name of the subscription in the public topic as used by <see cref="IConfigurationManager"/>.
68 : /// </summary>
69 : protected override string PublicTopicSubscriptionNameConfigurationKey
70 : {
71 : get { return "Cqrs.Azure.EventBus.PublicEvent.TopicName.SubscriptionName"; }
72 : }
73 :
74 : /// <summary>
75 : /// The default name of the private topic if no <see cref="IConfigurationManager"/> value is set.
76 : /// </summary>
77 : protected override string DefaultPrivateTopicName
78 : {
79 : get { return "Cqrs.EventBus.Private"; }
80 : }
81 :
82 : /// <summary>
83 : /// The default name of the public topic if no <see cref="IConfigurationManager"/> value is set.
84 : /// </summary>
85 : protected override string DefaultPublicTopicName
86 : {
87 : get { return "Cqrs.EventBus"; }
88 : }
89 :
90 : /// <summary>
91 : /// The configuration key that
92 : /// specifies if an <see cref="Exception"/> is thrown if the network lock is lost
93 : /// as used by <see cref="IConfigurationManager"/>.
94 : /// </summary>
95 : protected override string ThrowExceptionOnReceiverMessageLockLostExceptionDuringCompleteConfigurationKey
96 : {
97 : get { return "Cqrs.Azure.EventBus.ThrowExceptionOnReceiverMessageLockLostExceptionDuringComplete"; }
98 : }
99 :
100 : #endregion
101 :
102 : /// <summary>
103 : /// Instantiate a new instance of <see cref="AzureEventBus{TAuthenticationToken}"/>.
104 : /// </summary>
105 1 : protected AzureEventBus(IConfigurationManager configurationManager, IMessageSerialiser<TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper<TAuthenticationToken> azureBusHelper, IBusHelper busHelper, IHashAlgorithmFactory hashAlgorithmFactory, bool isAPublisher)
106 : : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, hashAlgorithmFactory, isAPublisher)
107 : {
108 : }
109 : }
110 : }
|