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

Defines the StreamLink interface. More...

Public Member Functions

void AddConnectionListener (IConnectionListener listener)
 
void Connect ()
 
IChannel CreateChannel (string subject, IChannelListener listener, ICommandParameters parameters)
 
ICommandParameters CreateCommandParameters ()
 
IContainerSubscriptionParameters CreateContainerSubscriptionParameters ()
 
IFreeFormSubscriptionParameters CreateFreeFormSubscriptionParameters ()
 
IJsonSubscriptionParameters CreateJsonSubscriptionParameters ()
 
IRecordSubscriptionParameters CreateRecordSubscriptionParameters ()
 
ICommandSubscription CreateSubject (string subject, SubjectType subjectType, ICommandListener commandListener, ICommandParameters commandParameters)
 
void CreateSubject (string subject, SubjectType subjectType, ICommandListener commandListener)
 
IWebRequestParameters CreateWebRequestParameters (String moduleName, IDictionary< String, String > options)
 
void DeleteSubject (string subject, ICommandListener commandListener)
 
void Disconnect ()
 
void NetworkAvailable ()
 
void NetworkUnavailable ()
 
void Pause ()
 
ICommandSubscription PublishToSubject (string subject, IDictionary< string, string > fieldData, ICommandListener commandListener, ICommandParameters commandParameters)
 
ICommandSubscription PublishToSubject (string subject, List< Caplin.StreamLink.STuple > fieldData, ICommandListener commandListener, ICommandParameters commandParameters)
 
void PublishToSubject (string subject, IDictionary< string, string > fieldData, ICommandListener commandListener)
 
void PublishToSubject (string subject, List< Caplin.StreamLink.STuple > fieldData, ICommandListener commandListener)
 
void RemoveConnectionListener (IConnectionListener listener)
 
void Resume ()
 
void Snapshot (string subject, ISubscriptionListener subscriptionListener, ISubscriptionParameters subscriptionParameters)
 
void Snapshot (string subject, ISubscriptionListener subscriptionListener)
 
ISubscription Subscribe (string subject, ISubscriptionListener subscriptionListener, ISubscriptionParameters subscriptionParameters)
 
ISubscription Subscribe (string subject, ISubscriptionListener subscriptionListener)
 
ICommandSubscription ThrottleEverything (ThrottleCommand command, ICommandListener commandListener, ICommandParameters commandParameters)
 
void ThrottleEverything (ThrottleCommand command, ICommandListener commandListener)
 
ICommandSubscription ThrottleSubject (string subject, ThrottleCommand command, ICommandListener commandListener, ICommandParameters commandParameters)
 
void ThrottleSubject (string subject, ThrottleCommand command, ICommandListener commandListener)
 

Properties

IAdvancedConfiguration AdvancedConfiguration [get]
 Gets the advanced configuration for this StreamLink instance. More...
 
ReadOnlyDictionary< string,
string > 
CustomAttributes [get]
 Custom attributes as a read only dictionary
 
IList< ILogInfoLastLog [get]
 
ILogger Logger [get]
 
string Version [get]
 

Detailed Description

Defines the StreamLink interface.

You can obtain an instance of this interface by calling one of the StreamLinkFactory.Create methods on the StreamLinkFactory object.

Member Function Documentation

void Caplin.StreamLink.IStreamLink.AddConnectionListener ( IConnectionListener  listener)

Adds a connection listener with this StreamLink instance. This listener is called whenever a connection event occurs.

Parameters
listenerThe IConnectionListener to be added.
void Caplin.StreamLink.IStreamLink.Connect ( )

Instructs this StreamLink instance to attempt to connect to the Liberator.

When a IConnectionListener has been registered with this StreamLink instance, the listener's methods are called when the status of the connection changes.

IChannel Caplin.StreamLink.IStreamLink.CreateChannel ( string  subject,
IChannelListener  listener,
ICommandParameters  parameters 
)

Creates a Channel for the specified subject on the Liberator.

Use the returned channel to send and receive data as maps of name/value pairs.

Parameters
subjectthe Liberator subject that will be used for this channel.
channelListenerto receive data, status and error messages from the channel.
commandParameterscommand parameters object that will be used on all sends to the channel, can be null.
Returns
channel object that can be used to send and receive data as maps of name/value pairs.
ICommandParameters Caplin.StreamLink.IStreamLink.CreateCommandParameters ( )

Creates a set of ICommandParameters which can be used to set a command to be persistent.

Returns
A new set of ICommandParameters.
IContainerSubscriptionParameters Caplin.StreamLink.IStreamLink.CreateContainerSubscriptionParameters ( )

Creates a parameters object for a container subscription.

An IContainerSubscriptionParameters allows the container window to be set, restricting the number of elements that are subscribed to.

Returns
A new set of IContainerSubscriptionParameters
IFreeFormSubscriptionParameters Caplin.StreamLink.IStreamLink.CreateFreeFormSubscriptionParameters ( )

Creates a parameters object for subscriptions.

Most of the SubjectTypes supported by the Liberator can be subscribed to with parameters. A set of IFreeFormSubscriptionParameters can be used to pass parameters to subscription requests for SubjectTypes that do not have a dedicated subscription parameters implementation. At present, these would be used for News headline subject. For details on the format please consult the news filtering subsection of the StreamLink Overview document.

Returns
A new set of IFreeFormSubscriptionParameters.
IJsonSubscriptionParameters Caplin.StreamLink.IStreamLink.CreateJsonSubscriptionParameters ( )

Creates a parameters object for a json subscription.

A IJsonSubscriptionParameters allows a subscription to a json subject to be restricted to filter so that they are only received when the specified condition has been met.

Returns
A new set of IJsonSubscriptionParameters.
IRecordSubscriptionParameters Caplin.StreamLink.IStreamLink.CreateRecordSubscriptionParameters ( )

Creates a parameters object for a record subscription.

A IRecordSubscriptionParameters allows a subscription to a record subject to be restricted to a specified set of fields. It can also filter updates so that they are only received when the specified condition has been met.

Returns
A new set of IRecordSubscriptionParameters.
ICommandSubscription Caplin.StreamLink.IStreamLink.CreateSubject ( string  subject,
SubjectType  subjectType,
ICommandListener  commandListener,
ICommandParameters  commandParameters 
)

Creates a subject on the Liberator.

Parameters
subjectThe name of the subject to create.
subjectTypeThe type of subject to create.
commandListenerA listener that is called to provide information about the result of the "create subject" command.
commandParametersAdditional parameters for the command (for example to make the command persistent).
Returns
Information about the 'create subject' command. If the ICommandParameters made the command persistent, you can subsequently cancel this by calling the ICommandSubscription's ICommandSubscription.UnPersist method.
void Caplin.StreamLink.IStreamLink.CreateSubject ( string  subject,
SubjectType  subjectType,
ICommandListener  commandListener 
)

Creates a subject on the Liberator.

Parameters
subjectThe name of the subject to create.
subjectTypeThe type of subject to create.
commandListenerA listener that is called to provide information about the result of the "create subject" command.
IWebRequestParameters Caplin.StreamLink.IStreamLink.CreateWebRequestParameters ( String  moduleName,
IDictionary< String, String >  options 
)

Creates a IWebRequestParameters object for the specified Liberator web module.

The returned IWebRequestParameters object contains the URL and HTTP post body that should be used to access the required web module.

The following example shows how the IWebRequestParameters can be used to obtain the response text from a web module.

using System;
using System.Net;
using System.Text;
using System.IO;
using System.Collections.Generic;
using Caplin.StreamLink;
namespace Caplin.StreamLink.ExampleSnippets.General
{
public class WebRequestParametersSnippet
{
public WebRequestParametersSnippet(IStreamLink streamLink)
{
Dictionary<String, String> options = new Dictionary<string, string>();
options.Add("export", "/container");
options.Add("fields", "FIELD1,FIELD2");
options.Add("filename", "export.csv");
IWebRequestParameters wrp = streamLink.CreateWebRequestParameters("blotterexport", options);
if (wrp != null)
{
HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(wrp.Url);
httpRequest.ContentType = "text/plain";
httpRequest.Method = "POST";
UTF8Encoding encoding = new UTF8Encoding();
byte[] data = encoding.GetBytes(wrp.PostBody);
httpRequest.GetRequestStream().Write(data, 0, data.Length);
StreamReader reader = new StreamReader(httpRequest.GetResponse().GetResponseStream(), System.Text.Encoding.UTF8);
string response = reader.ReadToEnd();
Console.WriteLine(response);
}
}
}
}
Parameters
moduleNamethe name of the Liberator web module.
optionsa map of named options that the web module accepts.
Returns
a ServiceParameters object or null if the module is not available or the options are invalid.
void Caplin.StreamLink.IStreamLink.DeleteSubject ( string  subject,
ICommandListener  commandListener 
)

Deletes a subject on the Liberator.

Parameters
subjectThe name of the subject to delete.
commandListenerA listener that is called to provide information about the result of the "delete subject" command.
void Caplin.StreamLink.IStreamLink.Disconnect ( )

Instructs this StreamLink instance to disconnect from the Liberator.

void Caplin.StreamLink.IStreamLink.NetworkAvailable ( )

Informs StreamLink the network is available.

void Caplin.StreamLink.IStreamLink.NetworkUnavailable ( )

Informs StreamLink the network is unavailable. If StreamLink is connected to the Liberator, it will disconnect.

void Caplin.StreamLink.IStreamLink.Pause ( )

Pauses StreamLink so it does not receive new updates from the Liberator. The KeyMaster session will be kept alive.

This method can be used as part of your application's lifecycle to conserve battery life and reduce data usage by not receiving data when your application is in the background.

ICommandSubscription Caplin.StreamLink.IStreamLink.PublishToSubject ( string  subject,
IDictionary< string, string >  fieldData,
ICommandListener  commandListener,
ICommandParameters  commandParameters 
)

Publishes data to a subject.

Parameters
subjectThe subject to publish to.
fieldDataThe data, as key-value pairs, to be published to the subject. TO allo
commandListenerA listener that receives notification of the publish command's success or failure.
commandParametersAdditional parameters for the command (for example to make the command persistent).
Returns
Information about the 'publish' command. If the parameters made the command persistent, you can subsequently cancel this by calling the ICommandSubscription's ICommandSubscription.UnPersist method.
ICommandSubscription Caplin.StreamLink.IStreamLink.PublishToSubject ( string  subject,
List< Caplin.StreamLink.STuple fieldData,
ICommandListener  commandListener,
ICommandParameters  commandParameters 
)

Publishes data to a subject.

Parameters
subjectThe subject to publish to.
fieldDataThe data, as a list of key-value pairs, to be published to the subject. The list allows for multiple values for the same key to be sent
commandListenerA listener that receives notification of the publish command's success or failure.
commandParametersAdditional parameters for the command (for example to make the command persistent).
Returns
Information about the 'publish' command. If the parameters made the command persistent, you can subsequently cancel this by calling the ICommandSubscription's ICommandSubscription.UnPersist method.
void Caplin.StreamLink.IStreamLink.PublishToSubject ( string  subject,
IDictionary< string, string >  fieldData,
ICommandListener  commandListener 
)

Publishes data to a subject.

Parameters
subjectThe subject to publish to.
fieldDataThe data, as key-value pairs, to be published to the subject.
commandListenerA listener that receives notification of the publish command's success or failure.
void Caplin.StreamLink.IStreamLink.PublishToSubject ( string  subject,
List< Caplin.StreamLink.STuple fieldData,
ICommandListener  commandListener 
)

Publishes data to a subject.

Parameters
subjectThe subject to publish to.
fieldDataThe data, as a list of key-value pairs, to be published to the subject.
commandListenerA listener that receives notification of the publish command's success or failure.
void Caplin.StreamLink.IStreamLink.RemoveConnectionListener ( IConnectionListener  listener)

Removes a previously added listener from this StreamLink instance. After removal, no further callbacks are received by this listener.

Parameters
listenerThe IConnectionListener to remove.
void Caplin.StreamLink.IStreamLink.Resume ( )

Re-establishes the connection to the Liberator to receive updates.

This method can be used as part of your application's lifecycle to conserve battery life and reduce data usage by not receiving data when your application is in the background.

void Caplin.StreamLink.IStreamLink.Snapshot ( string  subject,
ISubscriptionListener  subscriptionListener,
ISubscriptionParameters  subscriptionParameters 
)

Requests a single update from a subject.

Parameters
subjectThe subject to subscribe to.
subscriptionListenerA listener that is called to provide information about the result of the subscription request, the subscribed data.
subscriptionParametersA set of parameters for this subscription.

A ISubscriptionParameters object can be obtained by calling one of the following methods:

void Caplin.StreamLink.IStreamLink.Snapshot ( string  subject,
ISubscriptionListener  subscriptionListener 
)

Requests a single update from a subject.

Parameters
subjectThe subject to subscribe to.
subscriptionListenerA listener that is called to provide information about the result of the subscription request, the subscribed data.
ISubscription Caplin.StreamLink.IStreamLink.Subscribe ( string  subject,
ISubscriptionListener  subscriptionListener,
ISubscriptionParameters  subscriptionParameters 
)

Subscribes to a subject to receive updates.

Parameters
subjectThe subject to subscribe to.
subscriptionListenerA listener that is called to provide information about the result of the subscription request, the subscribed data, and subsequent updates to that data.
subscriptionParametersA set of parameters for this subscription.
Returns
Information about the subscription. You can unsubscribe (stop receiving updates) from a subscription using the ISubscription.Unsubscribe method on the returned ISubscription object.

A ISubscriptionParameters object can be obtained by calling one of the following methods:

ISubscription Caplin.StreamLink.IStreamLink.Subscribe ( string  subject,
ISubscriptionListener  subscriptionListener 
)

Subscribes to a subject to receive updates.

Parameters
subjectThe subject to subscribe to.
subscriptionListenerA listener that is called to provide information about the result of the subscription request, the subscribed data, and subsequent updates to that data.
Returns
Information about the subscription. You can unsubscribe (stop receiving updates) from a subscription using the ISubscription.Unsubscribe method on the returned ISubscription object.
ICommandSubscription Caplin.StreamLink.IStreamLink.ThrottleEverything ( ThrottleCommand  command,
ICommandListener  commandListener,
ICommandParameters  commandParameters 
)

Throttles all the currently subscribed subjects, reducing the number of updates that are sent every second.

For a fuller explanation of throttling, refer to the 'Throttling' section of the document StreamLink Overview.

Parameters
commandThe throttle command to apply.
commandListenerA listener that is called to provide information about the result of the throttle command.
commandParametersAdditional parameters for the command (for example to make the command persistent).
Returns
Information about the 'throttle' command. If the parameters made the command persistent, you can subsequently cancel this by calling the ICommandSubscription's ICommandSubscription.UnPersist method.
void Caplin.StreamLink.IStreamLink.ThrottleEverything ( ThrottleCommand  command,
ICommandListener  commandListener 
)

Throttles all the currently subscribed subjects, reducing the number of updates that are sent every second.

For a fuller explanation of throttling, refer to the 'Throttling' section of the document StreamLink Overview.

Parameters
commandThe throttle command to apply.
listenerA listener that is called to provide information about the result of the throttle command.
ICommandSubscription Caplin.StreamLink.IStreamLink.ThrottleSubject ( string  subject,
ThrottleCommand  command,
ICommandListener  commandListener,
ICommandParameters  commandParameters 
)

Throttles the specified subject, reducing the number of updates that are sent every second.

For a fuller explanation of throttling, refer to the 'Throttling' section of the document StreamLink Overview.

Parameters
subjectThe subject for which received data updates are to be throttled.
commandThe Throttle command to apply.
commandListenerA listener that is called to provide information about the result of the throttle command.
commandParametersAdditional parameters for the command (for example to make the command persistent).
Returns
Information about the 'throttle' command. If the parameters made the command persistent, you can subsequently cancel this by calling the ICommandSubscription's ICommandSubscription.UnPersist method.
void Caplin.StreamLink.IStreamLink.ThrottleSubject ( string  subject,
ThrottleCommand  command,
ICommandListener  commandListener 
)

Throttles the specified subject, reducing the number of updates that are sent every second.

For a fuller explanation of throttling, refer to the 'Throttling' section of the document StreamLink Overview.

Parameters
subjectThe subject for which received data updates are to be throttled.
commandThe Throttle command to apply.
commandListenerA listener that is called to provide information about the result of the throttle command.

Property Documentation

IAdvancedConfiguration Caplin.StreamLink.IStreamLink.AdvancedConfiguration
get

Gets the advanced configuration for this StreamLink instance.

See Also
IAdvancedConfiguration
IList<ILogInfo> Caplin.StreamLink.IStreamLink.LastLog
get

Returns a List containing the last "log_buffer_size" log lines written by the current StreamLink instance. If log_buffer_size is not set or less than or equal to 0 then the log buffer is disabled and this method will always return an empty array

A List containing the last "log_buffer_size" log lines written by this instance, or an empty array if "log_buffer_size" is not set

ILogger Caplin.StreamLink.IStreamLink.Logger
get

Returns the StreamLink logger object. You can receive StreamLink log messages by adding your own ILogListener to this object.

Returns
The StreamLink logger.
string Caplin.StreamLink.IStreamLink.Version
get

Gets the version of StreamLink.

Returns
The version number and build identifier for this version of the StreamLink library.

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