C# Class Microsoft.AspNet.WebHooks.WebHookManager

Provides an implementation of IWebHookManager for managing notifications and mapping them to registered WebHooks.
Inheritance: IWebHookManager, IDisposable
Exibir arquivo Open project: aspnet/WebHooks Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
NotifyAllAsync ( IEnumerable notifications, Func predicate ) : Task
NotifyAsync ( string user, IEnumerable notifications, Func predicate ) : Task
VerifyWebHookAsync ( WebHook webHook ) : System.Threading.Tasks.Task
WebHookManager ( IWebHookStore webHookStore, IWebHookSender webHookSender, ILogger logger ) : System

Initialize a new instance of the WebHookManager with a default retry policy.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources and optionally releases the managed resources.

VerifyEchoAsync ( WebHook webHook ) : System.Threading.Tasks.Task

Verifies the WebHook by submitting a GET request with a query token intended by the echoed back.

VerifySecret ( string secret ) : void

Verifies that the WebHook secret is between 32 and 64 characters long.

VerifyUri ( Uri webHookUri ) : void

Verifies that the webHookUri has either an 'http' or 'https' scheme.

Private Methods

Method Description
GetWorkItems ( ICollection webHooks, ICollection notifications ) : IEnumerable
WebHookManager ( IWebHookStore webHookStore, IWebHookSender webHookSender, ILogger logger, HttpClient httpClient ) : System

Initialize a new instance of the WebHookManager with the given httpClient. This constructor is intended for unit testing purposes.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

NotifyAllAsync() public method

public NotifyAllAsync ( IEnumerable notifications, Func predicate ) : Task
notifications IEnumerable
predicate Func
return Task

NotifyAsync() public method

public NotifyAsync ( string user, IEnumerable notifications, Func predicate ) : Task
user string
notifications IEnumerable
predicate Func
return Task

VerifyEchoAsync() protected method

Verifies the WebHook by submitting a GET request with a query token intended by the echoed back.
protected VerifyEchoAsync ( WebHook webHook ) : System.Threading.Tasks.Task
webHook WebHook The to verify.
return System.Threading.Tasks.Task

VerifySecret() protected method

Verifies that the WebHook secret is between 32 and 64 characters long.
protected VerifySecret ( string secret ) : void
secret string The secret to validate.
return void

VerifyUri() protected method

Verifies that the webHookUri has either an 'http' or 'https' scheme.
protected VerifyUri ( Uri webHookUri ) : void
webHookUri System.Uri The URI to verify.
return void

VerifyWebHookAsync() public method

public VerifyWebHookAsync ( WebHook webHook ) : System.Threading.Tasks.Task
webHook WebHook
return System.Threading.Tasks.Task

WebHookManager() public method

Initialize a new instance of the WebHookManager with a default retry policy.
public WebHookManager ( IWebHookStore webHookStore, IWebHookSender webHookSender, ILogger logger ) : System
webHookStore IWebHookStore The current .
webHookSender IWebHookSender The current .
logger ILogger The current .
return System