CQRS.NET  4.0
A lightweight enterprise Function as a Service (FaaS) framework to write function based serverless and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.Azure.ServiceBus.AzureBusHelper< TAuthenticationToken > Class Template Reference

A helper for Azure Service Bus and Event Hub. More...

+ Inheritance diagram for Cqrs.Azure.ServiceBus.AzureBusHelper< TAuthenticationToken >:

Public Member Functions

 AzureBusHelper (IAuthenticationTokenHelper< TAuthenticationToken > authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IMessageSerialiser< TAuthenticationToken > messageSerialiser, IBusHelper busHelper, IHashAlgorithmFactory hashAlgorithmFactory, IConfigurationManager configurationManager, IDependencyResolver dependencyResolver)
 Instantiates a new instance of AzureBusHelper<TAuthenticationToken>. More...
 
virtual void PrepareCommand< TCommand > (TCommand command, string framework)
 Prepares a ICommand<TAuthenticationToken> to be sent specifying the framework it is sent via. More...
 
virtual bool PrepareAndValidateCommand< TCommand > (TCommand command, string framework)
 Prepares and validates a ICommand<TAuthenticationToken> to be sent specifying the framework it is sent via. More...
 
virtual ICommand< TAuthenticationToken > ReceiveCommand (string messageBody, Func< ICommand< TAuthenticationToken >, bool?> receiveCommandHandler, string messageId, string signature, string signingTokenConfigurationKey, Action skippedAction=null, Action lockRefreshAction=null)
 Deserialises and processes the messageBody received from the network through the provided receiveCommandHandler . More...
 
virtual ? bool DefaultReceiveCommand (ICommand< TAuthenticationToken > command, RouteManager routeManager, string framework)
 The default command handler that check if the ICommand<TAuthenticationToken> has already been processed by this framework, checks if the ICommand<TAuthenticationToken> is required, finds the handler from the provided routeManager . More...
 
virtual void PrepareEvent< TEvent > (TEvent @event, string framework)
 Prepares an IEvent<TAuthenticationToken> to be sent specifying the framework it is sent via. More...
 
virtual bool PrepareAndValidateEvent< TEvent > (TEvent @event, string framework)
 Prepares and validates an IEvent<TAuthenticationToken> to be sent specifying the framework it is sent via. More...
 
virtual IEvent< TAuthenticationToken > ReceiveEvent (string messageBody, Func< IEvent< TAuthenticationToken >, bool?> receiveEventHandler, string messageId, string signature, string signingTokenConfigurationKey, Action skippedAction=null, Action lockRefreshAction=null)
 Deserialises and processes the messageBody received from the network through the provided receiveEventHandler . More...
 
virtual ? bool DefaultReceiveEvent (IEvent< TAuthenticationToken > @event, RouteManager routeManager, string framework)
 The default event handler that check if the IEvent<TAuthenticationToken> has already been processed by this framework, checks if the IEvent<TAuthenticationToken> is required, finds the handler from the provided routeManager . More...
 
virtual void RegisterHandler< TMessage > (ITelemetryHelper telemetryHelper, RouteManager routeManger, Action< TMessage > handler, Type targetedType, bool holdMessageLock=true)
 Manually registers the provided handler on the provided routeManger More...
 
virtual void RegisterGlobalEventHandler< TMessage > (ITelemetryHelper telemetryHelper, RouteManager routeManger, Action< TMessage > handler, bool holdMessageLock=true)
 Register an event handler that will listen and respond to all events. More...
 

Protected Member Functions

virtual void VerifySignature (string signingTokenConfigurationKey, string signature, string messagetype, string messageId, string typeName, object identifyMessage, string messageBody)
 Verifies that the signature is authorised. More...
 

Static Protected Attributes

const string DefaultMessagesShouldRefreshConfigurationKey = "Cqrs.Azure.Messages.ShouldRefresh"
 The configuration key for the default message refreshing setting as used by IConfigurationManager. More...
 

Properties

IAuthenticationTokenHelper< TAuthenticationToken > AuthenticationTokenHelper [get]
 Gets or sets the IAuthenticationTokenHelper<TAuthenticationToken>. More...
 
ICorrelationIdHelper CorrelationIdHelper [get]
 Gets or sets the ICorrelationIdHelper. More...
 
ILogger Logger [get]
 Gets or sets the ILogger. More...
 
IMessageSerialiser< TAuthenticationToken > MessageSerialiser [get]
 Gets or sets the IMessageSerialiser<TAuthenticationToken>. More...
 
IBusHelper BusHelper [get]
 Gets or sets the IBusHelper. More...
 
IConfigurationManager ConfigurationManager [get]
 Gets or sets the IConfigurationManager. More...
 
IDependencyResolver DependencyResolver [get]
 Gets or sets the IDependencyResolver. More...
 
IHashAlgorithmFactory Signer [get]
 The IHashAlgorithmFactory to use to sign messages. More...
 

Detailed Description

A helper for Azure Service Bus and Event Hub.

Template Parameters
TAuthenticationTokenThe Type of the authentication token.