DataSource Notification.NET  6.2.4-347-7da6b22
 All Classes Namespaces Functions Properties Pages
Public Member Functions | Public Attributes | Properties | List of all members
Caplin.DataSource.Notification.Notification Class Reference

Notification represents a single notification to be sent to a client. It is identified by the uniqueId passed into the constructor. Methods are provided for setting field access. More...

Public Member Functions

virtual string GetField (string name)
 
 Notification (string uniqueId)
 
virtual void SetField (string name, string value)
 
virtual void SetFields (IDictionary< string, string > fieldMap)
 
virtual
Caplin.XLang.Container.RecordItem 
ToRecordItem (string username, string sourceName)
 
override string ToString ()
 

Public Attributes

IDictionary< string, string > fields
 
string uniqueId
 

Properties

virtual IDictionary< string,
string > 
Fields [get]
 
virtual string UniqueId [get]
 

Detailed Description

Notification represents a single notification to be sent to a client. It is identified by the uniqueId passed into the constructor. Methods are provided for setting field access.

Notifications are passed into the INotificationChannel.SendNotification(Notification ) and INotificationChannel.SendNotifications methods on the INotificationChannel received on INotificationApplicationListener callbacks.

The uniqueId is used in the subject in place of the 'i' in the '/PRIVATE/NOTIFICATIONS/DATASOURCES/u/NOTIFY/[sourceName]-i' notification namespace to create the record subject for this Notification. These notifications will be received by any listeners registered with a StreamLink Alerts API's NotificationService whereupon the uniqueId can be extracted.

When the Notification is sent on the INotificationChannel three fields are added to the notification. They include NotificationId, NotificationSource and NotificationTime. The NotificationSource is the source name that has been configured on the NotificationProvider. The NotificationId is set to "[source-name]-[uniqueId-of-notification]". The NotificationTime field will be set to the time in millis since 1970/01/01 at which the Notification is sent, however if this field has been set already using Notification.tField(string , string ) then this set will be respected and the fields value won't be automatically replaced.

Constructor & Destructor Documentation

Caplin.DataSource.Notification.Notification.Notification ( string  uniqueId)
inline
Parameters
uniqueIdUnique identifier for this Notification. This id is used when removing items from the INotificationChannel

and in the callback in INotificationChannelListener.

Member Function Documentation

virtual string Caplin.DataSource.Notification.Notification.GetField ( string  name)
inlinevirtual
Parameters
nameKey associated with a value.
Returns
Value of this field.
virtual void Caplin.DataSource.Notification.Notification.SetField ( string  name,
string  value 
)
inlinevirtual
Parameters
nameField name associate with a value. These must be present in the fields.conf used to configure the DataSource.
valueValue to send associated with this field name.
virtual void Caplin.DataSource.Notification.Notification.SetFields ( IDictionary< string, string >  fieldMap)
inlinevirtual
Parameters
fieldMapMap of fields and values for this Notification. The field names must be present in the fields.conf used to configure the DataSource.
override string Caplin.DataSource.Notification.Notification.ToString ( )
inline

String containing this Notification's uniqueId and fields.

Property Documentation

virtual IDictionary<string,string> Caplin.DataSource.Notification.Notification.Fields
get

A map containing all fields present on this Notification.

virtual string Caplin.DataSource.Notification.Notification.UniqueId
get

uniqueId The uniqueId this Notification was instantiated with.


Generated on Thu Apr 6 2017 14:38:06 for DataSource Notification.NET