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="AzureEventHub{TAuthenticationToken}"/>.
19 : /// </summary>
20 : /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
21 : public abstract class AzureEventHubBus<TAuthenticationToken>
22 : : AzureEventHub<TAuthenticationToken>
23 1 : {
24 : /// <summary>
25 : /// The configuration key for the event hub connection string as used by <see cref="IConfigurationManager"/>.
26 : /// </summary>
27 : protected override string EventHubConnectionStringNameConfigurationKey
28 : {
29 : get { return "Cqrs.Azure.EventHub.EventBus.ConnectionStringName"; }
30 : }
31 :
32 : /// <summary>
33 : /// The configuration key for the event hub storage connection string as used by <see cref="IConfigurationManager"/>.
34 : /// </summary>
35 : protected override string EventHubStorageConnectionStringNameConfigurationKey
36 : {
37 : get { return "Cqrs.Azure.EventHub.EventBus.StorageConnectionStringName"; }
38 : }
39 :
40 : /// <summary>
41 : /// The configuration key for the signing token as used by <see cref="IConfigurationManager"/>.
42 : /// </summary>
43 : protected override string SigningTokenConfigurationKey
44 : {
45 : get { return "Cqrs.Azure.EventHub.EventBus.SigningToken"; }
46 : }
47 :
48 : /// <summary>
49 : /// The configuration key for the name of the private event hub as used by <see cref="IConfigurationManager"/>.
50 : /// </summary>
51 : protected override string PrivateEventHubNameConfigurationKey
52 : {
53 : get { return "Cqrs.Azure.EventHub.EventBus.PrivateEvent.EventHubName"; }
54 : }
55 :
56 : /// <summary>
57 : /// The configuration key for the name of the public event hub as used by <see cref="IConfigurationManager"/>.
58 : /// </summary>
59 : protected override string PublicEventHubNameConfigurationKey
60 : {
61 : get { return "Cqrs.Azure.EventHub.EventBus.PublicEvent.EventHubName"; }
62 : }
63 :
64 : /// <summary>
65 : /// The configuration key for the name of the consumer group name of the private event hub as used by <see cref="IConfigurationManager"/>.
66 : /// </summary>
67 : protected override string PrivateEventHubConsumerGroupNameConfigurationKey
68 : {
69 : get { return "Cqrs.Azure.EventHub.EventBus.PrivateEvent.EventHubName.ConsumerGroupName"; }
70 : }
71 :
72 : /// <summary>
73 : /// The configuration key for the name of the consumer group name of the public event hub as used by <see cref="IConfigurationManager"/>.
74 : /// </summary>
75 : protected override string PublicEventHubConsumerGroupNameConfigurationKey
76 : {
77 : get { return "Cqrs.Azure.EventHub.EventBus.PublicEvent.EventHubName.ConsumerGroupName"; }
78 : }
79 :
80 : /// <summary>
81 : /// The default name of the private event hub if no <see cref="IConfigurationManager"/> value is set.
82 : /// </summary>
83 : protected override string DefaultPrivateEventHubName
84 : {
85 : get { return "Cqrs.EventHub.EventBus.Private"; }
86 : }
87 :
88 : /// <summary>
89 : /// The default name of the public event hub if no <see cref="IConfigurationManager"/> value is set.
90 : /// </summary>
91 : protected override string DefaultPublicEventHubName
92 : {
93 : get { return "Cqrs.EventHub.EventBus"; }
94 : }
95 :
96 : /// <summary>
97 : /// Gets the <see cref="IAzureBusHelper{TAuthenticationToken}"/>.
98 : /// </summary>
99 : protected IAzureBusHelper<TAuthenticationToken> AzureBusHelper { get; private set; }
100 :
101 : /// <summary>
102 : /// Instantiate a new instance of <see cref="AzureEventHubBus{TAuthenticationToken}"/>.
103 : /// </summary>
104 1 : protected AzureEventHubBus(IConfigurationManager configurationManager, IMessageSerialiser<TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IHashAlgorithmFactory hashAlgorithmFactory, IAzureBusHelper<TAuthenticationToken> azureBusHelper, bool isAPublisher)
105 : : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, hashAlgorithmFactory, isAPublisher)
106 : {
107 : AzureBusHelper = azureBusHelper;
108 : }
109 : }
110 : }
|