Interface SubscriptionCallback<T>

Type Parameters:
T - The java class that maps to the GraphQL type returned by the subscription.
For instance, for the subscription the T parameter should be Human
            subscribeNewHumanForEpisode(episode: Episode!): Human!
            
All Known Implementing Classes:
NewCharacterSubscriptionCallback

public interface SubscriptionCallback<T>
This interface will receive the notification for each message that comes from a subscription. The message sent by the server is mapped on the T class.
Author:
etienne-sf
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onClose(int statusCode, String reason)
    A callback to make the program aware of the end of the subscription channel.
    void
    This method is called once the subscription has been submitted to the GraphQL server.
    void
    Whenever an error occurs, at any time of the subscription processing.
    void
    This method is called each time a message is sent by the server, for this subscription.
  • Method Details

    • onConnect

      void onConnect()
      This method is called once the subscription has been submitted to the GraphQL server. It's an information call: no special action is expected.
      Please note that, since 2.x version, the plugin has no access to the Web Socket connection information. So it is not possible to know, when the subscription is really active (that is: from when the event will actually be sent to the client)
    • onMessage

      void onMessage(T t)
      This method is called each time a message is sent by the server, for this subscription. It's an information call: no special action is expected.
      Parameters:
      t -
    • onClose

      void onClose(int statusCode, String reason)
      A callback to make the program aware of the end of the subscription channel. It's an information call: no special action is expected.
      Parameters:
      statusCode - since 2.0 release, this parameter is always 0
      reason - since 2.0 release, this parameter is always null
    • onError

      void onError(Throwable cause)
      Whenever an error occurs, at any time of the subscription processing. It's an information call: no special action is expected.
      Parameters:
      cause -