The main StreamLink Class.
To create an instance of this class, use the caplin.streamlink.StreamLinkFactory.
Attributes | Name and Description |
---|---|
|
caplin.streamlink.StreamLink()
|
Attributes | Name and Description |
---|---|
|
void
addConnectionListener(caplin.streamlink.ConnectionListener connectionListener)
Adds a caplin.streamlink.ConnectionListener to this StreamLink instance. |
|
void
connect()
Instructs this |
|
caplin.streamlink.CommandSubscription
createSubject(String subject, caplin.streamlink.SubjectType subjectType, caplin.streamlink.CommandListener commandListener, Map
Creates a subject in the Liberator. |
|
void
deleteSubject(String subject, caplin.streamlink.CommandListener commandListener)
Deletes a subject in the Liberator. |
|
void
disconnect()
Instructs this |
|
caplin.streamlink.Logger
getLogger()
Returns the StreamLink logger object. |
|
void
getVersion()
Returns the version number and build identifier for this version of the StreamLink library. |
|
caplin.streamlink.CommandSubscription
publishToSubject(String subject, Map
Publishes data to a subject. |
|
void
removeConnectionListener(caplin.streamlink.ConnectionListener connectionListener)
Removes a previously added caplin.streamlink.ConnectionListener from this StreamLink instance. |
|
caplin.streamlink.Subscription
subscribe(String subject, caplin.streamlink.SubscriptionListener subscriptionListener, Map
Subscribes to a subject to receive updates. |
|
caplin.streamlink.CommandSubscription
throttleEverything(caplin.streamlink.ThrottleCommand throttleCommand, caplin.streamlink.CommandListener commandListener, Map
Throttles all the currently subscribed subjects, reducing the number of updates that are sent every second. |
|
caplin.streamlink.CommandSubscription
throttleSubject(String subject, caplin.streamlink.ThrottleCommand throttleCommand, caplin.streamlink.CommandListener commandListener, Map
Throttles the specified subject, reducing the number of updates that are sent every second. |
►
caplin.streamlink.StreamLink()
►
void
addConnectionListener(caplin.streamlink.ConnectionListener connectionListener)
Adds a caplin.streamlink.ConnectionListener to this StreamLink instance. This connectionListener is called whenever a connection event occurs.
caplin.streamlink.ConnectionListener | connectionListener | The ConnectionListener to be added. |
►
void
connect()
Instructs this StreamLink
instance to attempt to connect to the Liberator.
►
caplin.streamlink.CommandSubscription
createSubject(String subject, caplin.streamlink.SubjectType subjectType, caplin.streamlink.CommandListener commandListener, Map
Creates a subject in the Liberator.
The commandParameters argument takes the following JSON configuration attributes:Attribute name | Type | Default | Optional | Description |
---|---|---|---|---|
persistent | boolean | false | Yes | When true, the throttle setting for this command persists across a failure of the connection to Liberator and subsequent reconnection. When false, the throttle setting only applies to the current Liberator session and does not persist following a connection failure. For a fuller explanation, see the 'Persistence' section of the StreamLink Overview document. |
String | subject | The name of the subject to create. |
caplin.streamlink.SubjectType | subjectType | The type of subject to create. |
caplin.streamlink.CommandListener | commandListener | A listener that is called to provide information about the result of the "create subject" command. |
Map |
commandParameters | Optional JSON configuration attributes. |
commandParameters
made the command persistent, you can subsequently cancel this by calling the CommandSubscription
's unPersist()
method.
►
void
deleteSubject(String subject, caplin.streamlink.CommandListener commandListener)
Deletes a subject in the Liberator.
String | subject | The name of the subject to delete. |
caplin.streamlink.CommandListener | commandListener | A listener that is called to provide information about the result of the 'delete subject' command. |
►
void
disconnect()
Instructs this StreamLink
instance to disconnect from the Liberator.
►
caplin.streamlink.Logger
getLogger()
Returns the StreamLink logger object. You can receive StreamLink log messages by adding your own caplin.streamlink.LogListener to this object.
Logger
object of this StreamLink instance.
►
void
getVersion()
Returns the version number and build identifier for this version of the StreamLink library.
►
caplin.streamlink.CommandSubscription
publishToSubject(String subject, Map
Publishes data to a subject.
The commandParameters argument takes the following JSON configuration attributes:Attribute name | Type | Default | Optional | Description |
---|---|---|---|---|
persistent | boolean | false | Yes | When true, if the connection to the Liberator fails after publication, the data is resent when StreamLink reconnects. When false, if the connection to the Liberator fails after publication, the data is not resent when StreamLink reconnects. |
String | subject | The subject to publish to. |
Map |
fieldData | The data, as key-value pairs, to be published to the subject. |
caplin.streamlink.CommandListener | commandListener | A listener that receives notification of the publish command's success or failure. |
Map |
commandParameters | Optional JSON configuration attributes. |
commandParameters
made the command persistent, you can subsequently cancel this by calling the CommandSubscription
's unPersist()
method.
►
void
removeConnectionListener(caplin.streamlink.ConnectionListener connectionListener)
Removes a previously added caplin.streamlink.ConnectionListener from this StreamLink instance. After removal, no further callbacks are received by this ConnectionListener.
caplin.streamlink.ConnectionListener | connectionListener | The ConnectionListener to be removed. |
►
caplin.streamlink.Subscription
subscribe(String subject, caplin.streamlink.SubscriptionListener subscriptionListener, Map
Subscribes to a subject to receive updates.
The subscriptionParameters argument takes the following JSON configuration attributes:Attribute name | Type | Default | Optional | Description |
---|---|---|---|---|
fields | [string] | All fields are subscribed to. | Yes | An array of the the fields to subscribe to.
For example: |
filter | {value: string, image: boolean} | No filter is applied. | Yes | A filter that restricts the number of field updates that will be received.
The When the |
window | {start: int, size: int} | Updates are returned for the whole container (subject to any filter applied). | Yes | When the subscription is to a container, this attribute defines a window that begins at the element defined by start ,
and is size elements long. Liberator only returns updates for the elements that are in the window.
The first element in a container starts at position 0 (zero). |
String | subject | The subject to subscribe to. |
caplin.streamlink.SubscriptionListener | subscriptionListener | A listener that is called to provide information about the result of the subscription request, the subscribed data, and subsequent updates to that data. |
Map |
subscriptionParameters | Optional JSON configuration attributes. |
unsubcribe()
method.
►
caplin.streamlink.CommandSubscription
throttleEverything(caplin.streamlink.ThrottleCommand throttleCommand, caplin.streamlink.CommandListener commandListener, Map
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.
caplin.streamlink.ThrottleCommand | throttleCommand | The throttle command to apply. |
caplin.streamlink.CommandListener | commandListener | A listener that is called to provide information about the result of the throttle command. |
Map |
commandParameters | Optional JSON configuration attributes; for details, see the commandParameters parameter of throttleSubject(). |
commandParameters
made the command persistent, you can subsequently cancel this by calling the CommandSubscription
's unPersist()
method.
►
caplin.streamlink.CommandSubscription
throttleSubject(String subject, caplin.streamlink.ThrottleCommand throttleCommand, caplin.streamlink.CommandListener commandListener, Map
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.
The commandParameters argument takes the following JSON configuration attributes:Attribute name | Type | Default | Optional | Description |
---|---|---|---|---|
persistent | boolean | false | Yes | When true, the throttle setting for this command persists across a failure of the connection to Liberator and subsequent reconnection. When false, the throttle setting only applies to the current Liberator session and does not persist following a connection failure. For a fuller explanation, see the 'Persistence' section of the StreamLink Overview document. |
String | subject | The subject for which received data updates are to be throttled. |
caplin.streamlink.ThrottleCommand | throttleCommand | The Throttle command to apply. |
caplin.streamlink.CommandListener | commandListener | A listener that is called to provide information about the result of the throttle command. |
Map |
commandParameters | Optional JSON configuration attributes. |
commandParameters
made the command persistent, you can subsequently cancel this by calling the CommandSubscription
's unPersist()
method.