Skip to end of metadata
Go to start of metadata

Represents base class for push service object.

Definition

public abstract class PushServiceBase : IPushService

Summary

The following table summarizes the members exposed in this class.

Protected Constructors

Public Properties

AverageQueueWaitTime Gets the average queue wait time.
AverageSendTime Gets the average send time.
BlockOnMessageResult Gets a value indicating whether the service should block on message result.
ChannelCount Gets the channel count.
ChannelSettings Gets the channel settings.
IsStopping Gets a value indicating whether the push service is stopping.
PushChannelFactory Gets the push channel factory.
QueueLength Gets the length of the queue.
ServiceSettings Gets the service settings.

Public Methods

Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
QueueNotification(INotification) Queues the notification.
RaiseServiceException(Exception) Raises the service exception.
Stop(bool) Stops the service.

Protected Methods

Events

OnChannelCreated Occurs when push channel is created.
OnChannelDestroyed Occurs when push channel is destroyed.
OnChannelException Occurs when an exception thrown from push channel.
OnDeviceSubscriptionChanged Occurs when device subscription changed.
OnDeviceSubscriptionExpired Occurs when device subscription expired.
OnNotificationFailed Occurs when notification failed.
OnNotificationRequeue Occurs when notification is requeued.
OnNotificationSent Occurs when notification sent.
OnServiceException Occurs when an exception thrown from push service.

Protected Constructors

protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings)

Initializes a new instance of the PushServiceBase class.

Parameters

pushChannelFactory The push channel factory.
channelSettings The channel settings.

protected PushServiceBase(IPushChannelFactory pushChannelFactory, IPushChannelSettings channelSettings, IPushServiceSettings serviceSettings)

Initializes a new instance of the PushServiceBase class.

Parameters

pushChannelFactory The push channel factory.
channelSettings The channel settings.
serviceSettings The service settings.

Public Properties

public TimeSpan AverageQueueWaitTime { get; }

Gets the average queue wait time.

public TimeSpan AverageSendTime { get; }

Gets the average send time.

public bool BlockOnMessageResult { get; }

Gets a value indicating whether the service should block on message result.

public long ChannelCount { get; }

Gets the channel count.

public IPushChannelSettings ChannelSettings { get; }

Gets the channel settings.

public bool IsStopping { get; }

Gets a value indicating whether the push service is stopping.

public IPushChannelFactory PushChannelFactory { get; }

Gets the push channel factory.

public long QueueLength { get; }

Gets the length of the queue.

public IPushServiceSettings ServiceSettings { get; }

Gets the service settings.

Public Methods

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void QueueNotification(INotification notification)

Queues the notification.

Parameters

notification The notification.

public void RaiseServiceException(Exception error)

Raises the service exception.

Parameters

error The error.

public void Stop(bool waitForQueueToFinish)

Stops the service.

Parameters

waitForQueueToFinish if set to true wait for queue to finish.

Protected Methods

protected void RaiseSubscriptionExpired(string expiredSubscriptionId, DateTime expirationDateUtc, INotification notification)

Raises the subscription expired.

Parameters

expiredSubscriptionId The expired subscription identifier.
expirationDateUtc The expiration date UTC.
notification The notification.

Events

public event ChannelCreatedDelegate OnChannelCreated

Occurs when push channel is created.

public event ChannelDestroyedDelegate OnChannelDestroyed

Occurs when push channel is destroyed.

public event ChannelExceptionDelegate OnChannelException

Occurs when an exception thrown from push channel.

public event DeviceSubscriptionChangedDelegate OnDeviceSubscriptionChanged

Occurs when device subscription changed.

public event DeviceSubscriptionExpiredDelegate OnDeviceSubscriptionExpired

Occurs when device subscription expired.

public event NotificationFailedDelegate OnNotificationFailed

Occurs when notification failed.

public event NotificationRequeueDelegate OnNotificationRequeue

Occurs when notification is requeued.

public event NotificationSentDelegate OnNotificationSent

Occurs when notification sent.

public event ServiceExceptionDelegate OnServiceException

Occurs when an exception thrown from push service.

  • No labels