StreamLink.NET  7.1.5-7.1.5-3946-4e293d0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Caplin.StreamLink.Alerts.TriggerService Class Reference

A TriggerService subscribes to the Triggers of a StreamLink user and allows the user to register a listener to be called back when triggers are added, removed or modified. More...

Public Member Functions

void AddListener (ITriggerListener listener)
 Adds a trigger listener that will be called back when triggers are added and removed. More...
 
ITrigger AddTrigger (string subject, string condition, IDictionary< string, string > extraParams, IResultListener listener)
 Add a new trigger for the current user. More...
 
void DisableTrigger (ITrigger trigger, IResultListener listener)
 Disables a trigger in the system. More...
 
void EnableTrigger (ITrigger trigger, IResultListener listener)
 Enables a trigger in the system. More...
 
void RemoveListener (ITriggerListener listener)
 Removes a previously added trigger listener, callbacks to this listener will be stopped. More...
 
void RemoveTrigger (ITrigger trigger, IResultListener listener)
 Removes a trigger from the system. More...
 
 TriggerService (IStreamLink streamLink)
 Creates a new TriggerService for the given StreamLink instance. More...
 

Detailed Description

A TriggerService subscribes to the Triggers of a StreamLink user and allows the user to register a listener to be called back when triggers are added, removed or modified.

The TriggerService also allows the user to add and remove triggers.

When trigger conditions are met, notifications will be fired. Notifications can be handled by creating a NotificationService and registering for notification callbacks.

The service itself does not subscribe to anything unless listeners are added to it. For every listener added one subscription is being issued. These subscriptions induce the service state for the associated listeners. Therefore the service states can vary for different listeners. If the reference to the service is removed without removing all listeners beforehand, open subscriptions will stay around forever. To avoid that, remove all listeners before removing the service.

Constructor & Destructor Documentation

Caplin.StreamLink.Alerts.TriggerService.TriggerService ( IStreamLink  streamLink)
inline

Creates a new TriggerService for the given StreamLink instance.

Parameters
streamLinkthe StreamLink that will be used to send and retrieve triggers from the Liberator.

Member Function Documentation

void Caplin.StreamLink.Alerts.TriggerService.AddListener ( ITriggerListener  listener)
inline

Adds a trigger listener that will be called back when triggers are added and removed.

Parameters
listenerThe TriggerListener to be added.
ITrigger Caplin.StreamLink.Alerts.TriggerService.AddTrigger ( string  subject,
string  condition,
IDictionary< string, string >  extraParams,
IResultListener  listener 
)
inline

Add a new trigger for the current user.

Parameters
subjectthe rttp subject of this trigger.
conditionthe trigger condition, for more details on the format of the condition string, please see the StreamLink Overview document.
extraParamsa dictionary of extra parameters to be added to the trigger.
listenera ResultListener that will be called back to notify the user code of the result of this operation.
Returns
the trigger that has been created.
void Caplin.StreamLink.Alerts.TriggerService.DisableTrigger ( ITrigger  trigger,
IResultListener  listener 
)
inline

Disables a trigger in the system.

Parameters
triggertrigger the Trigger that should be disabled.
listenera ResultListener that will be called back to notify the user code of the result of this operation.
void Caplin.StreamLink.Alerts.TriggerService.EnableTrigger ( ITrigger  trigger,
IResultListener  listener 
)
inline

Enables a trigger in the system.

Parameters
triggertrigger the Trigger that should be enabled.
listenera ResultListener that will be called back to notify the user code of the result of this operation.
void Caplin.StreamLink.Alerts.TriggerService.RemoveListener ( ITriggerListener  listener)
inline

Removes a previously added trigger listener, callbacks to this listener will be stopped.

Parameters
listenerThe TriggerListener to be removed.
void Caplin.StreamLink.Alerts.TriggerService.RemoveTrigger ( ITrigger  trigger,
IResultListener  listener 
)
inline

Removes a trigger from the system.

Parameters
triggertrigger the Trigger that should be removed.
listenera ResultListener that will be called back to notify the user code of the result of this operation.

Generated on Tue Mar 24 2020 11:57:50 for StreamLink.NET