Class ConnectStrategy.Client.Result

java.lang.Object
com.launchdarkly.eventsource.ConnectStrategy.Client.Result
Enclosing class:
ConnectStrategy.Client

public static class ConnectStrategy.Client.Result extends Object
  • Constructor Details

  • Method Details

    • getInputStream

      public InputStream getInputStream()
      The input stream that EventSource should read from.
      Returns:
      the input stream (must not be null)
    • getOrigin

      public URI getOrigin()
      The origin URI that should be included in every MessageEvent.

      The SSE specification dictates that every message should have an origin property representing the stream it came from. In the default HTTP implementation, this is simply the stream URI; other implementations of ConnectStrategy can set it to whatever they want.

      If this value is null, it defaults to the original URI that was returned by ConnectStrategy.Client.getOrigin() prior to making the connection attempt. This allows clients to modify the origin if necessary for each attempt, for instance, if using different query parameters.

      Returns:
      the stream URI
    • getCloser

      public Closeable getCloser()
      An object that EventSource can use to close the connection. If this is not null, its Closeable.close() method will be called whenever the current connection is stopped either due to an error or because the caller explicitly closed the stream.
      Returns:
      a Closeable object or null
    • getHeaders

      public ResponseHeaders getHeaders()
      Returns the response headers from the connection, or null if not available.

      For HTTP connections, this contains the HTTP response headers. For other connection types, this may be null or may contain connection-specific metadata.

      Returns:
      the response headers, or null if not available
      Since:
      4.2.0