public interface KeymasterPollResponseListener
Defines the interface that should be implemented by the application to receive KeyMaster keep alive Responses.
The KeymasterPollResponseListener needs to be added to the StreamLinkFactory
create method in order to receive callbacks.
Typically an application would notify the user when onKeymasterError
is called and ask them to sign in again.
A trivial implementation would be as follows :
import com.caplin.streamlink.KeymasterPollResponseListener;
import com.caplin.streamlink.StreamLinkFactory;
public class KeymasterResponseListenerSnippet
{
public KeymasterResponseListenerSnippet()
{
String config = "{" +
"liberator_urls: 'http://liberator.caplin.com'," +
"username: 'user1@caplin.com'," +
"password: 'admin'" +
"}";
StreamLinkFactory.create(config, new KeymasterPollResponseListener() {
public void onKeymasterResponse(String response) {
System.out.println(response);
}
public void onKeymasterError(String reason) {
System.out.println(reason);
}
});
}
}
Modifier and Type | Method and Description |
---|---|
void |
onKeymasterError(java.lang.String reason)
Returns an unsuccessful KeyMaster keep alive Response.
|
void |
onKeymasterResponse(java.lang.String response)
Returns a successful KeyMaster keep alive Response.
|
void onKeymasterResponse(java.lang.String response)
Returns a successful KeyMaster keep alive Response. Implementing this method is optional.
response
- The response text.void onKeymasterError(java.lang.String reason)
Returns an unsuccessful KeyMaster keep alive Response.
reason
- The error text.Please send bug reports and comments to Caplin support