Class NotificationHub
Inheritance
System.Object
Microsoft.AspNet.SignalR.Hubs.HubBase
Microsoft.AspNet.SignalR.Hub
NotificationHub
Inherited Members
Microsoft.AspNet.SignalR.Hub.Clients
Microsoft.AspNet.SignalR.Hubs.HubBase.OnDisconnected(System.Boolean)
Microsoft.AspNet.SignalR.Hubs.HubBase.Dispose(System.Boolean)
Microsoft.AspNet.SignalR.Hubs.HubBase.Dispose()
Microsoft.AspNet.SignalR.Hubs.HubBase.Microsoft.AspNet.SignalR.Hubs.IHub.Clients
Microsoft.AspNet.SignalR.Hubs.HubBase.Context
Microsoft.AspNet.SignalR.Hubs.HubBase.Groups
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Cqrs.WebApi.dll
Syntax
public class NotificationHub : Hub, IHub, IUntrackedDisposable, IDisposable, INotificationHub, ISingleSignOnTokenNotificationHub
Constructors
NotificationHub()
Declaration
NotificationHub(ILogger, ICorrelationIdHelper)
Declaration
public NotificationHub(ILogger logger, ICorrelationIdHelper correlationIdHelper)
Parameters
Type |
Name |
Description |
cdmdotnet.Logging.ILogger |
logger |
|
cdmdotnet.Logging.ICorrelationIdHelper |
correlationIdHelper |
|
Properties
ConvertUserTokenToUserRsn
The System.Func<T, TResult> that can convert a System.String based authentication token into the System.Guid based user identifier.
Declaration
public Func<string, Guid> ConvertUserTokenToUserRsn { get; set; }
Property Value
Type |
Description |
System.Func<System.String, System.Guid> |
|
CorrelationIdHelper
Gets or sets the cdmdotnet.Logging.ICorrelationIdHelper.
Declaration
public ICorrelationIdHelper CorrelationIdHelper { get; set; }
Property Value
Type |
Description |
cdmdotnet.Logging.ICorrelationIdHelper |
|
CurrentHub
Gets the current Microsoft.AspNet.SignalR.IHubContext.
Declaration
protected virtual IHubContext CurrentHub { get; }
Property Value
Type |
Description |
Microsoft.AspNet.SignalR.IHubContext |
|
Logger
Gets or sets the cdmdotnet.Logging.ILogger.
Declaration
public ILogger Logger { get; set; }
Property Value
Type |
Description |
cdmdotnet.Logging.ILogger |
|
Methods
GetAdditionalDataForLogging(Guid)
Create additional data containing the provided userRsn
.
Declaration
protected virtual IDictionary<string, object> GetAdditionalDataForLogging(Guid userRsn)
Parameters
Type |
Name |
Description |
System.Guid |
userRsn |
|
Returns
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
GetAdditionalDataForLogging(String)
Create additional data containing the provided userToken
.
Declaration
protected virtual IDictionary<string, object> GetAdditionalDataForLogging(string userToken)
Parameters
Type |
Name |
Description |
System.String |
userToken |
|
Returns
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
Join()
Join the authenticated user to their relevant Microsoft.AspNet.SignalR.IHubContext.Groups.
Declaration
protected virtual Task Join()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
OnConnected()
When the connection connects to this hub instance we register the connection so we can respond back to it.
Declaration
public override Task OnConnected()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Microsoft.AspNet.SignalR.Hubs.HubBase.OnConnected()
OnReconnected()
When the connection reconnects to this hub instance we register the connection so we can respond back to it.
Declaration
public override Task OnReconnected()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Microsoft.AspNet.SignalR.Hubs.HubBase.OnReconnected()
UserToken()
Gets the authentication token for the user from the incoming hub request looking at first the
Microsoft.AspNet.SignalR.Hubs.HubCallerContext.RequestCookies and then the Microsoft.AspNet.SignalR.Hubs.HubCallerContext.QueryString.
The authentication token should have a name matching the value of "Cqrs.Web.AuthenticationTokenName" from GetSetting(String).
Declaration
protected virtual string UserToken()
Returns
Type |
Description |
System.String |
|
Explicit Interface Implementations
INotificationHub.SendAllUsersEvent<TAuthenticationToken>(IEvent<TAuthenticationToken>)
Send out an event to all users
Declaration
void INotificationHub.SendAllUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData)
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
INotificationHub.SendExceptThisUserEvent<TAuthenticationToken>(IEvent<TAuthenticationToken>, String)
Send out an event to all users except the specific user token
Declaration
void INotificationHub.SendExceptThisUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, string userToken)
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.String |
userToken |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
INotificationHub.SendUserEvent<TAuthenticationToken>(IEvent<TAuthenticationToken>, String)
Send out an event to specific user token
Declaration
void INotificationHub.SendUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, string userToken)
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.String |
userToken |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
INotificationHub.SendUsersEvent<TAuthenticationToken>(IEvent<TAuthenticationToken>, Guid[])
Send out an event to specific user RSNs
Declaration
void INotificationHub.SendUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, params Guid[] userRsnCollection)
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.Guid[] |
userRsnCollection |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
ISingleSignOnTokenNotificationHub.SendAllUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken>)
Send out an event to all users
Declaration
void ISingleSignOnTokenNotificationHub.SendAllUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData)where TSingleSignOnToken : ISingleSignOnToken
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
ISingleSignOnTokenNotificationHub.SendExceptThisUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken>, String)
Send out an event to all users except the specific user token
Declaration
void ISingleSignOnTokenNotificationHub.SendExceptThisUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, string userToken)where TSingleSignOnToken : ISingleSignOnToken
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.String |
userToken |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
ISingleSignOnTokenNotificationHub.SendUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken>, String)
Send out an event to specific user token
Declaration
void ISingleSignOnTokenNotificationHub.SendUserEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, string userToken)where TSingleSignOnToken : ISingleSignOnToken
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.String |
userToken |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements
ISingleSignOnTokenNotificationHub.SendUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken>, Guid[])
Send out an event to specific user RSNs
Declaration
void ISingleSignOnTokenNotificationHub.SendUsersEvent<TSingleSignOnToken>(IEvent<TSingleSignOnToken> eventData, params Guid[] userRsnCollection)where TSingleSignOnToken : ISingleSignOnToken
Parameters
Type |
Name |
Description |
IEvent<TSingleSignOnToken> |
eventData |
|
System.Guid[] |
userRsnCollection |
|
Type Parameters
Name |
Description |
TSingleSignOnToken |
|
Implements