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.setBinaryHandler(BinaryHandler handler) Sets a BinaryHandler that will be used to parse and patch Binary objects.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 aKeymasterPollResponseListenerto 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.setUrlParameters(String urlParameters) Sets a string that will be appended to the Liberator url when making a connection.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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.For more information on defining Liberator URL groups see
StreamLinkFactoryand the "Resilience, failover, and load balancing" section of the StreamLink Overview.
-
setUrlParameters
Sets a string that will be appended to the Liberator url when making a connection.
- Parameters:
urlParameters- the url parameter string (example: token=value)- Returns:
- The current
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
setPollInterval
Sets the time interval in milliseconds between polls of the Liberator.
- Parameters:
milliseconds- The poll interval.- Returns:
- The current
StreamLinkConfigurationinstance.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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
setReconnectDelay
Delay in milliseconds before retrying, after failing to connect (default 1000 milliseconds).
- Parameters:
milliseconds- The reconnect delay in milliseconds.- Returns:
- The current
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
setClockOffsetInterval
Sets the interval between successive calculations of clock offset value(default 10000 milliseconds). For more information, see the
clock_offset_intervalJSON attribute incaplin.streamlink.StreamLinkFactory.- Parameters:
milliseconds- The clock offset interval in milliseconds.- Returns:
- The current
StreamLinkConfigurationinstance.
-
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_windowJSON attribute incaplin.streamlink.StreamLinkFactory.- Parameters:
milliseconds- The clock offset window in milliseconds.- Returns:
- The current
StreamLinkConfigurationinstance.
-
setLatencyInterval
Sets the time between successive calculations of average latency (default 10000 milliseconds). For more information, see the
latency_intervalJSON attribute incaplin.streamlink.StreamLinkFactory.- Parameters:
milliseconds- The latency interval in milliseconds.- Returns:
- The current
StreamLinkConfigurationinstance.
-
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_windowJSON attribute incaplin.streamlink.StreamLinkFactory.- Parameters:
milliseconds- The latency window in milliseconds.- Returns:
- The current
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
ClockOffsetconfiguration 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
StreamLinkConfigurationinstance.
-
setKeymasterPollResponseListener
StreamLinkConfiguration setKeymasterPollResponseListener(KeymasterPollResponseListener keymasterPollListener) Sets a
KeymasterPollResponseListenerto receive information about responses to keep-alive requests made to KeyMaster.- Parameters:
keymasterPollListener- The implementation ofKeymasterPollResponseListener.- Returns:
- The current
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
setKeymasterUrl
Sets the URL of KeyMaster for secure authentication of Liberator login requests.<//p>
- Parameters:
url- The KeyMaster URL- Returns:
- The current
StreamLinkConfigurationinstance.
-
setKeymasterHttpUser
Sets the username used for HTTP KeyMaster sessions.
- Parameters:
httpUser- The username that will be sent to KeyMaster.- Returns:
- The current
StreamLinkConfigurationinstance.
-
setKeymasterHttpPass
Sets the password used for HTTP KeyMaster sessions.
- Parameters:
httpPass- The password that will be sent to KeyMaster.- Returns:
- The current
StreamLinkConfigurationinstance.
-
setKeymasterCrossDomainAuthentication
Sets whether Cross Domain Authentication is enabled for KeyMaster sessions.
- Parameters:
enable- Whether Cross Domain Authentication is enabled or not- Returns:
- The current
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
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
StreamLinkConfigurationinstance.
-
setJsonHandler
Sets a JsonHandler that will be used to parse and patch JSON objects.
- Parameters:
handler- the class that implements the JsonHandler interface.
-
setBinaryHandler
Sets a BinaryHandler that will be used to parse and patch Binary objects.
- Parameters:
handler- the class that implements the BinaryHandler 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
StreamLinkConfigurationinstance.
-