Interface KeymasterPollResponseListener


  • 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);
                            }
                            
                    });
            }
            
    }
    

    • Method Detail

      • onKeymasterResponse

        void onKeymasterResponse​(java.lang.String response)

        Returns a successful KeyMaster keep alive Response. Implementing this method is optional.

        Parameters:
        response - The response text.
      • onKeymasterError

        void onKeymasterError​(java.lang.String reason)

        Returns an unsuccessful KeyMaster keep alive Response.

        Parameters:
        reason - The error text.