CQRS.NET  2.2
A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.WebApi.SignalR.Hubs.NotificationHub Class Reference

Sends events to different groups of users via a SignalR Hub. More...

+ Inheritance diagram for Cqrs.WebApi.SignalR.Hubs.NotificationHub:

Public Member Functions

 NotificationHub (ILogger logger, ICorrelationIdHelper correlationIdHelper)
 Instantiates a new instance of NotificationHub. More...
 
 NotificationHub ()
 Instantiates a new instance of NotificationHub. More...
 
override Task OnConnected ()
 When the connection connects to this hub instance we register the connection so we can respond back to it. More...
 
override Task OnReconnected ()
 When the connection reconnects to this hub instance we register the connection so we can respond back to it. More...
 
- Public Member Functions inherited from Cqrs.WebApi.SignalR.Hubs.INotificationHub
void SendUsersEvent< TAuthenticationToken > (IEvent< TAuthenticationToken > eventData, params Guid[] userRsnCollection)
 Send out an event to specific user RSNs More...
 
void SendUserEvent< TAuthenticationToken > (IEvent< TAuthenticationToken > eventData, string userToken)
 Send out an event to specific user token More...
 
void SendAllUsersEvent< TAuthenticationToken > (IEvent< TAuthenticationToken > eventData)
 Send out an event to all users More...
 
void SendExceptThisUserEvent< TAuthenticationToken > (IEvent< TAuthenticationToken > eventData, string userToken)
 Send out an event to all users except the specific user token More...
 

Protected Member Functions

virtual string UserToken ()
 Gets the authentication token for the user from the incoming hub request looking at first the HubCallerContext.RequestCookies and then the HubCallerContext.QueryString. The authentication token should have a name matching the value of "Cqrs.Web.AuthenticationTokenName" from IConfigurationManager.GetSetting. More...
 
virtual Task Join ()
 Join the authenticated user to their relevant IHubContext.Groups. More...
 
virtual IDictionary< string, object > GetAdditionalDataForLogging (Guid userRsn)
 Create additional data containing the provided userRsn . More...
 
virtual IDictionary< string, object > GetAdditionalDataForLogging (string userToken)
 Create additional data containing the provided userToken . More...
 

Properties

ILogger Logger [get, set]
 Gets or sets the ILogger. More...
 
ICorrelationIdHelper CorrelationIdHelper [get, set]
 Gets or sets the ICorrelationIdHelper. More...
 
Func< string, Guid > ConvertUserTokenToUserRsn [get, set]
 The Func<String, Guid> that can convert a string based authentication token into the Guid based user identifier. More...
 
virtual IHubContext CurrentHub [get]
 Gets the current IHubContext. More...
 

Detailed Description

Sends events to different groups of users via a SignalR Hub.