Class WebhookTransmitter
Inheritance
WebhookTransmitter
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class WebhookTransmitter : IWebhookTransmitter
Constructors
WebhookTransmitter(IDelayedAsyncQueue<RetryWebhook>, ICustomProxyConfiguration, ILogger<WebhookTransmitter>)
Declaration
public WebhookTransmitter(IDelayedAsyncQueue<RetryWebhook> retryList, ConfigFile.ICustomProxyConfiguration customProxyConfig, ILogger<WebhookTransmitter> logger)
Parameters
Methods
Declaration
protected void AddHeadersToWebHookRequest(Webhook webhook, WebhookPayload eventInfo, HttpRequestMessage request, JObject body, int retryCount, bool isTest)
Parameters
CallWebhookAsync(Webhook, WebhookPayload, CancellationToken, int, bool)
Broadcast the event to all subscribers, and mark failures/success status on the passed webhook objects.
Declaration
public Task<WebhookResponse> CallWebhookAsync(Webhook webhook, WebhookPayload eventInfo, CancellationToken cancellationToken, int maxRetries = 3, bool isTest = false)
Parameters
Returns
CreateWebHookRequestBody(Webhook, WebhookPayload)
Declaration
protected JObject CreateWebHookRequestBody(Webhook webhook, WebhookPayload payload)
Parameters
Returns
ProcessRetryAttemptAsync(IAsyncQueueProcessItemContext<DelayedItem<RetryWebhook>>, CancellationToken)
Process retry attempts, that has been added to a queue.
Declaration
public Task<WebhookResponse> ProcessRetryAttemptAsync(IAsyncQueueProcessItemContext<DelayedItem<RetryWebhook>> context, CancellationToken cancellationToken)
Parameters
Returns
RetryWebhookAsync(RetryWebhook, CancellationToken)
Declaration
public Task<WebhookResponse> RetryWebhookAsync(RetryWebhook retry, CancellationToken cancellationToken)
Parameters
Returns
SendHttpRequestAsync(WebhookPayload, HttpRequestMessage, WebhookResponse, CancellationToken)
Declaration
protected virtual Task SendHttpRequestAsync(WebhookPayload eventInfo, HttpRequestMessage request, WebhookResponse result, CancellationToken cancellationToken)
Parameters
Returns
SendWebhookAsync(RetryWebhook, WebhookResponse, CancellationToken)
Declaration
protected Task SendWebhookAsync(RetryWebhook retry, WebhookResponse result, CancellationToken cancellationToken)
Parameters
Returns
ServerCertificateCustomValidationCallback(object, X509Certificate, X509Chain, SslPolicyErrors)
Verify SSL certificate is ok, deny bogus SSL certs
Declaration
protected static bool ServerCertificateCustomValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
Parameters
Returns
Type |
Description |
bool |
True if SSL cert is ok
|
SignWebHookRequest(Webhook, WebhookPayload, HttpRequestMessage, JObject)
Declaration
protected void SignWebHookRequest(Webhook webhook, WebhookPayload eventInfo, HttpRequestMessage request, JObject body)
Parameters
Implements
Extension Methods