Class NotificationProcessor
The notification processor class.
Namespace: Microsoft.Graph.Communications.Core.Notifications
Assembly: Microsoft.Graph.Communications.Core.dll
Syntax
public class NotificationProcessor : Disposable, INotificationProcessor, IDisposable
Constructors
NotificationProcessor(IAuthenticationProvider, ISerializer)
Initializes a new instance of the NotificationProcessor class.
Declaration
public NotificationProcessor(IAuthenticationProvider authenticationProvider, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IAuthenticationProvider | authenticationProvider | The authentication provider. |
ISerializer | serializer | The serializer. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the authentication provider is null. |
Properties
AuthenticationProvider
Gets the authentication provider. TODO: This should probably not be a part of the INotificationProcessor. Ideally the request is already validated prior to making it in here. This means that 1) Already sanitized by authentication provider and 2) The tenant/scenario id parameters extracted into the IGraphRequest.
Declaration
public IAuthenticationProvider AuthenticationProvider { get; }
Property Value
Type | Description |
---|---|
IAuthenticationProvider | The authentication provider. |
Methods
ExtractNotifications(String, ISerializer)
Extracts the notifications from the specified content string.
Declaration
public static CommsNotifications ExtractNotifications(string content, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
String | content | The content. |
ISerializer | serializer | The serializer. |
Returns
Type | Description |
---|---|
CommsNotifications | The deserialized CommsNotifications. |
Exceptions
Type | Condition |
---|---|
ServiceException | If the specified content is invalid. |
ProcessNotifications(Uri, String, String, Guid, Guid, IEnumerable<KeyValuePair<String, Object>>)
Processes the notifications and raise the required callbacks. This function should be called in order for the SDK to raise any required events and process state changes.
Declaration
public void ProcessNotifications(Uri callbackUri, string content, string tenantId, Guid requestId, Guid scenarioId, IEnumerable<KeyValuePair<string, object>> additionalData = null)
Parameters
Type | Name | Description |
---|---|---|
Uri | callbackUri | The callback URI. |
String | content | The notifications content. |
String | tenantId | The tenant identifier. |
Guid | requestId | The request identifier. |
Guid | scenarioId | The scenario identifier. |
IEnumerable<KeyValuePair<String, Object>> | additionalData | Additional data associated with the notification. |
Events
OnCollectionNotificationReceived
Occurs when a collection notification is received.
Declaration
public event Action<CollectionNotificationEventArgs> OnCollectionNotificationReceived
Event Type
Type | Description |
---|---|
Action<CollectionNotificationEventArgs> |
OnNotificationReceived
Occurs when a notification is received. This is a global hook for all notifications.
Declaration
public event Action<NotificationEventArgs> OnNotificationReceived
Event Type
Type | Description |
---|---|
Action<NotificationEventArgs> |
OnResourceNotificationReceived
Occurs when a single resource notification is received.
Declaration
public event Action<NotificationEventArgs> OnResourceNotificationReceived
Event Type
Type | Description |
---|---|
Action<NotificationEventArgs> |