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.Bus.BusHelper Class Reference

A helper for command and event buses that also caches IConfigurationManager look ups. More...

+ Inheritance diagram for Cqrs.Bus.BusHelper:

Public Member Functions

 BusHelper (IConfigurationManager configurationManager, IContextItemCollectionFactory factory)
 Instantiates a new instance of BusHelper More...
 
virtual bool IsEventRequired (Type messageType)
 Checks if a white-list or black-list approach is taken, then checks the IConfigurationManager to see if a key exists defining if the event is required or not. If the event is required and it cannot be resolved, an error will be raised. Otherwise the event will be marked as processed. More...
 
virtual bool IsEventRequired (string configurationKey)
 Checks if a white-list or black-list approach is taken, then checks the IConfigurationManager to see if a key exists defining if the event is required or not. If the event is required and it cannot be resolved, an error will be raised. Otherwise the event will be marked as processed. More...
 
virtual ? bool IsPrivateBusRequired (Type messageType)
 Checks if the private bus is required to send the message. Note, this does not imply the public bus is not required as well. More...
 
virtual ? bool IsPublicBusRequired (Type messageType)
 Checks if the public bus is required to send the message. Note, this does not imply the public bus is not required as well. More...
 
virtual Action< TMessage > BuildTelemeteredActionHandler< TMessage, TAuthenticationToken > (ITelemetryHelper telemetryHelper, Action< TMessage > handler, bool holdMessageLock, string source)
 Build a message handler that implements telemetry capturing as well as off thread handling. More...
 
virtual Action< TMessage > BuildActionHandler< TMessage > (Action< TMessage > handler, bool holdMessageLock)
 Build a message handler that implements telemetry capturing as well as off thread handling. More...
 
bool GetWasPrivateBusUsed ()
 Indicates if the message was received via the private bus or not. If false, this implies the public was use used. More...
 
bool SetWasPrivateBusUsed (bool wasPrivate)
 Set whether the message was received via the private bus or not. If false, this indicates the public was use used. More...
 

Protected Member Functions

virtual void RefreshCachedChecks ()
 Refreshes EventBlackListProcessing and every item currently in CachedChecks. More...
 
virtual void StartRefreshCachedChecks ()
 Starts RefreshCachedChecks in a Task on a one second loop. More...
 
virtual ? bool IsABusRequired (Type messageType, bool checkPublic)
 Checks if the particular bus is required to send the message. Note, this does not imply the public bus is not required as well. More...
 

Protected Attributes

string CacheKey = "WasPrivateBusUsed"
 The key used to store the authentication token in the Cache. More...
 

Properties

IConfigurationManager ConfigurationManager [get]
 Gets or sets the IConfigurationManager. More...
 
IDictionary< string, Tuple< bool, DateTime > > CachedChecks [get]
 A collection of Tuple<T1, T2> holding the configurations value (always a bool) and the DateTime The value was last checked, keyed by it's configuration key. More...
 
IDictionary< string, Tuple< bool?, DateTime > > NullableCachedChecks [get]
 A collection of Tuple<T1, T2> holding the configurations value (always a bool) and the DateTime The value was last checked, keyed by it's configuration key. More...
 
bool EventBlackListProcessing [get]
 The current value of "Cqrs.MessageBus.BlackListProcessing" from ConfigurationManager. More...
 
IContextItemCollection Cache [get]
 Get or set the Cache. More...
 

Detailed Description

A helper for command and event buses that also caches IConfigurationManager look ups.