Interface EventListener<T>


public interface EventListener<T>
This interface is used in RequestBuilder classes stream method.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEvent(T object)
    This method will be called when new event is sent by a server.
    void
    onFailure(Optional<Throwable> error, Optional<Integer> responseCode)
    This method will be called when the stream encounters an error.
  • Method Details

    • onEvent

      void onEvent(T object)
      This method will be called when new event is sent by a server.
      Parameters:
      object - object deserialized from the event data
    • onFailure

      void onFailure(Optional<Throwable> error, Optional<Integer> responseCode)
      This method will be called when the stream encounters an error.
      Parameters:
      error - exception which caused the failure
      responseCode - the HTTP status code from the event stream response