Class EventSource

  • All Implemented Interfaces:
    Service, java.lang.AutoCloseable, okhttp3.Callback

    public class EventSource
    extends java.lang.Object
    implements okhttp3.Callback, java.lang.AutoCloseable, Service
    • Constructor Summary

      Constructors 
      Constructor Description
      EventSource​(@NonNull java.lang.String url, java.util.Map<java.lang.String,​java.lang.String> headers, @NonNull Updater updater, long sseReadTimeoutMins)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected okhttp3.OkHttpClient makeStreamClient​(long sseReadTimeoutMins, java.util.List<java.security.cert.X509Certificate> trustedCAs)  
      void onFailure​(okhttp3.Call call, java.io.IOException e)  
      void onResponse​(okhttp3.Call call, okhttp3.Response response)  
      void start()  
      void stop()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventSource

        public EventSource​(@NonNull
                           @NonNull java.lang.String url,
                           java.util.Map<java.lang.String,​java.lang.String> headers,
                           @NonNull
                           @NonNull Updater updater,
                           long sseReadTimeoutMins)
                    throws ConnectorException
        Throws:
        ConnectorException
    • Method Detail

      • makeStreamClient

        protected okhttp3.OkHttpClient makeStreamClient​(long sseReadTimeoutMins,
                                                        java.util.List<java.security.cert.X509Certificate> trustedCAs)
                                                 throws ConnectorException
        Throws:
        ConnectorException
      • stop

        public void stop()
        Specified by:
        stop in interface Service
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Service
      • onFailure

        public void onFailure​(@NotNull
                              okhttp3.Call call,
                              @NotNull
                              java.io.IOException e)
        Specified by:
        onFailure in interface okhttp3.Callback
      • onResponse

        public void onResponse​(@NotNull
                               okhttp3.Call call,
                               @NotNull
                               okhttp3.Response response)
                        throws java.io.IOException
        Specified by:
        onResponse in interface okhttp3.Callback
        Throws:
        java.io.IOException