Interface StreamLinkConfiguration
Interface that allows the configuration of StreamLink to be defined programmatically.
You can obtain an instance of this interface by calling {@link com.caplin.streamlink.StreamLinkFactory.createConfiguration()}.
-
Method Summary
Modifier and TypeMethodDescriptionaddCustomAttribute
(String key, String value) Sets custom attributes.addLiberatorUrlGroup
(String... urls) Adds a group of URLs that define possible Liberator connections.Gets a map of the customer attributes set on this StreamLink instance to.setAcceptAllCertificates
(boolean acceptAllCertificates) StreamLink Java Only Set this option in StreamLink Java to accept all certificates when using secure websockets (wss)setApplicationId
(String applicationId) Sets the application identifier.setClockOffsetInterval
(int milliseconds) Sets the interval between successive calculations of clock offset value(default 10000 milliseconds).setClockOffsetWindow
(int milliseconds) Sets the time a calculated clock offset is valid for use in producing statistics (default 120000 milliseconds).setDisablePolling
(Boolean disablePolling) Set to true if you don't want to use polling connection when the rttp(s) protocol is specified.setDisableSseConnection
(Boolean disableSseConnection) Set to true if you don't want to use server side events connection when the rttp(s) protocol is specified.setForeverFrameReconnectCount
(int count) Not used in this version of StreamLink.setHttpPadLength
(int httpPadLength) Sets the http pad length to be used for http and Forever Frame connections.setHttpTimeout
(int timeout) Sets the time allowed for an HTTP Request to finish successfully before StreamLink times out (default 3000 milliseconds).setInactivityTimeout
(int milliseconds) Maximum time in milliseconds that Liberator waits to receive messages from this StreamLink client.setJsonHandler
(JsonHandler handler) Sets a JsonHandler that will be used to parse and patch JSON objects.Sets a KeymasterCookieProvider that will provide the cookies used when making KeyMaster connections.setKeymasterCrossDomainAuthentication
(boolean enable) Sets whether Cross Domain Authentication is enabled for KeyMaster sessions.Sets a KeymasterHttpHeaderProvider that will provide the http headers used when making KeyMaster connections.setKeymasterHttpPass
(String httpPass) Sets the password used for HTTP KeyMaster sessions.setKeymasterHttpUser
(String httpUser) Sets the username used for HTTP KeyMaster sessions.setKeymasterPollInterval
(int interval) Interval in milliseconds at which StreamLink will poll KeyMaster (on the KeyMaster poll URL) to keep the KeyMaster session open.setKeymasterPollResponseListener
(KeymasterPollResponseListener keymasterPollListener) Sets aKeymasterPollResponseListener
to receive information about responses to keep-alive requests made to KeyMaster.setKeymasterPollUrl
(String... url) Sets the URL that StreamLink uses to check the connection to KeyMaster every KeyMaster poll interval milliseconds.setKeymasterUrl
(String... url) Sets the URL of KeyMaster for secure authentication of Liberator login requests.<//p>setLatencyInterval
(int milliseconds) Sets the time between successive calculations of average latency (default 10000 milliseconds).setLatencyWindow
(int milliseconds) Sets the time for which a calculated latency value is valid for use in producing statistics (default 120000 milliseconds).setLiberatorUrlProvider
(LiberatorUrlProvider provider) Sets a LiberatorUrlProvider that will be used to get the next Liberator URL to connect to.setLogBufferSize
(int size) Sets the size of the log buffer to be used in Streamlink.setLogWindowLogLevel
(LogLevel level) Not used in this version of StreamLink.setLogWindowVisible
(boolean show) Not used in this version of StreamLink.setPassword
(String password) Sets the Liberator login password to use if logins are not being managed by KeyMaster or a customCredentialsProvider
.setPollInterval
(int milliseconds) Sets the time interval in milliseconds between polls of the Liberator.Sets the proxy to be used for ws(s), http(s), poll(s) and tcp(s) connection protocols.setReconnectAttempts
(int value) Sets the number of times that Streamlink should retry a connection attempt for each connection type (eg.setReconnectCycleDelays
(Integer... milliseconds) Delay in milliseconds before retrying, after failing to connect with all available connection options.setReconnectDelay
(int milliseconds) Delay in milliseconds before retrying, after failing to connect (default 1000 milliseconds).setRequestTimeout
(int milliseconds) Time in milliseconds allowed for the response to each command before StreamLink reconnects to the Liberator.setUsername
(String username) Sets the Liberator login user-name to use if logins are not being managed by KeyMaster or a customCredentialsProvider
.
-
Method Details
-
addCustomAttribute
Sets custom attributes. These are recorded in StreamLink log files
- Parameters:
key
- The attribute name.value
- The attribute value.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setApplicationId
Sets the application identifier. This is used by the Caplin Platform to distinguish StreamLink requests from different client applications. It is recorded in StreamLink log files, and is used by Liberator in monitoring software licence compliance and by the Caplin Permissioning Service to restrict the applicability of permissioning rules to specific applications.
- Parameters:
applicationId
- The application identifier.- Returns:
- The current
StreamLinkConfiguration
instance.
-
addLiberatorUrlGroup
Adds a group of URLs that define possible Liberator connections.
- Parameters:
urls
- A set of URLs defining a Liberator connection group.- Returns:
- The current
StreamLinkConfiguration
instance.For more information on defining Liberator URL groups see
StreamLinkFactory
and the "Resilience, failover, and load balancing" section of the StreamLink Overview.
-
setUsername
Sets the Liberator login user-name to use if logins are not being managed by KeyMaster or a custom
CredentialsProvider
.- Parameters:
username
- The Liberator login user-name.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setPassword
Sets the Liberator login password to use if logins are not being managed by KeyMaster or a custom
CredentialsProvider
.- Parameters:
password
- The Liberator login password.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setPollInterval
Sets the time interval in milliseconds between polls of the Liberator.
- Parameters:
milliseconds
- The poll interval.- Returns:
- The current
StreamLinkConfiguration
instance.This only applies to HTTP polling type connections (see 'RTTP connection types' in the document StreamLink Overview).
-
setForeverFrameReconnectCount
Not used in this version of StreamLink.
-
setDisablePolling
Set to true if you don't want to use polling connection when the rttp(s) protocol is specified.
- Parameters:
disablePolling
- Set to true to disable polling connection in rttp(s) protocol.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setDisableSseConnection
Set to true if you don't want to use server side events connection when the rttp(s) protocol is specified.
- Parameters:
disablePolling
- Set to true to disable server side events connection in rttp(s) protocol.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setRequestTimeout
Time in milliseconds allowed for the response to each command before StreamLink reconnects to the Liberator.
- Parameters:
milliseconds
- The request timeout period in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setReconnectDelay
Delay in milliseconds before retrying, after failing to connect (default 1000 milliseconds).
- Parameters:
milliseconds
- The reconnect delay in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setReconnectAttempts
Sets the number of times that Streamlink should retry a connection attempt for each connection type (eg. ws, https, poll etc.) Defaults to 0 i.e. only one connection attempt is made per connection type.
- Parameters:
value
- The number of reconnect attempts to make for each connection type.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setReconnectCycleDelays
Delay in milliseconds before retrying, after failing to connect with all available connection options. The entries are treated as a backoff where each entry is used once and the last entry is the delay that will keep getting used forever (default 2000, 4000, 8000, 16000 milliseconds).
- Parameters:
milliseconds
- Array of reconnect delays.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setClockOffsetInterval
Sets the interval between successive calculations of clock offset value(default 10000 milliseconds). For more information, see the
clock_offset_interval
JSON attribute incaplin.streamlink.StreamLinkFactory
.- Parameters:
milliseconds
- The clock offset interval in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setClockOffsetWindow
Sets the time a calculated clock offset is valid for use in producing statistics (default 120000 milliseconds). For more information, see the
clock_offset_window
JSON attribute incaplin.streamlink.StreamLinkFactory
.- Parameters:
milliseconds
- The clock offset window in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setLatencyInterval
Sets the time between successive calculations of average latency (default 10000 milliseconds). For more information, see the
latency_interval
JSON attribute incaplin.streamlink.StreamLinkFactory
.- Parameters:
milliseconds
- The latency interval in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setLatencyWindow
Sets the time for which a calculated latency value is valid for use in producing statistics (default 120000 milliseconds). For more information, see the
latency_window
JSON attribute incaplin.streamlink.StreamLinkFactory
.- Parameters:
milliseconds
- The latency window in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setHttpTimeout
Sets the time allowed for an HTTP Request to finish successfully before StreamLink times out (default 3000 milliseconds).
- Parameters:
timeout
- The timeout period in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setInactivityTimeout
Maximum time in milliseconds that Liberator waits to receive messages from this StreamLink client.
If the Liberator fails to receive a message from StreamLink within this interval, it disconnects the session and waits for a reconnection attempt.
The clock offset between Liberator and StreamLink is determined periodically by StreamLink sending a message to the Liberator. It is therefore recommended that this option should be configured to be greater than the
ClockOffset
configuration value. If it is configured to be smaller, more reconnections than required will take place.Note: This feature is only supported by Liberator 6.0 and newer. To determine if your Liberator installation supports this feature, refer to the Liberator's release note.
- Parameters:
milliseconds
- The inactivity period in milliseconds.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterPollResponseListener
StreamLinkConfiguration setKeymasterPollResponseListener(KeymasterPollResponseListener keymasterPollListener) Sets a
KeymasterPollResponseListener
to receive information about responses to keep-alive requests made to KeyMaster.- Parameters:
keymasterPollListener
- The implementation ofKeymasterPollResponseListener
.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterPollUrl
Sets the URL that StreamLink uses to check the connection to KeyMaster every KeyMaster poll interval milliseconds.
- Parameters:
url
- The URL that StreamLink uses to check the connection.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterPollInterval
Interval in milliseconds at which StreamLink will poll KeyMaster (on the KeyMaster poll URL) to keep the KeyMaster session open.
- Parameters:
interval
- The interval in at which StreamLink will poll KeyMaster (default 600000 milliseconds).- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterUrl
Sets the URL of KeyMaster for secure authentication of Liberator login requests.<//p>
- Parameters:
url
- The KeyMaster URL- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterHttpUser
Sets the username used for HTTP KeyMaster sessions.
- Parameters:
httpUser
- The username that will be sent to KeyMaster.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterHttpPass
Sets the password used for HTTP KeyMaster sessions.
- Parameters:
httpPass
- The password that will be sent to KeyMaster.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterCrossDomainAuthentication
Sets whether Cross Domain Authentication is enabled for KeyMaster sessions.
- Parameters:
enable
- Whether Cross Domain Authentication is enabled or not- Returns:
- The current
StreamLinkConfiguration
instance.
-
setLogWindowLogLevel
Not used in this version of StreamLink.
-
setLogWindowVisible
Not used in this version of StreamLink.
-
setProxy
Sets the proxy to be used for ws(s), http(s), poll(s) and tcp(s) connection protocols.
- Parameters:
proxy
- The proxy to be used.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setLogBufferSize
Sets the size of the log buffer to be used in Streamlink. If the size is less than or equal to 0, the log buffer will be disabled. (default -1).
- Parameters:
size
- The size of the log buffer to be used- Returns:
- The current
StreamLinkConfiguration
instance.
-
setHttpPadLength
Sets the http pad length to be used for http and Forever Frame connections.
- Parameters:
proxy
- The pad length to be used.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setLiberatorUrlProvider
Sets a LiberatorUrlProvider that will be used to get the next Liberator URL to connect to.
If this option is set then it will override any urls added via the addLiberatorUrlGroup method.
- Parameters:
provider
- the class that will provide the name of the next Liberator URL to try.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterCookieProvider
Sets a KeymasterCookieProvider that will provide the cookies used when making KeyMaster connections.
- Parameters:
provider
- The class that will provide the set of cookies.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setKeymasterHttpHeaderProvider
Sets a KeymasterHttpHeaderProvider that will provide the http headers used when making KeyMaster connections.
- Parameters:
provider
- The class that will provide the set of headers.- Returns:
- The current
StreamLinkConfiguration
instance.
-
setJsonHandler
Sets a JsonHandler that will be used to parse and patch JSON objects.
- Parameters:
handler
- the class that implements the JsonHandler interface.
-
getCustomAttributes
Gets a map of the customer attributes set on this StreamLink instance to.
- Returns:
- A read only reference to the custom attribute map
-
setAcceptAllCertificates
StreamLink Java Only Set this option in StreamLink Java to accept all certificates when using secure websockets (wss)- Parameters:
acceptAllCertificates
- set true to accept all certificates- Returns:
- The current
StreamLinkConfiguration
instance.
-