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!
                

    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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onClose​(int statusCode, java.lang.String reason)
      A callback to make the program aware of the end of the subscription channel.
      void onConnect()
      This method is called once the subscription has been submitted to the GraphQL server.
      void onError​(java.lang.Throwable cause)
      Whenever an error occurs, at any time of the subscription processing.
      void onMessage​(T t)
      This method is called each time a message is sent by the server, for this subscription.
    • Method Detail

      • 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.
      • 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,
                     java.lang.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 -
        reason -
      • onError

        void onError​(java.lang.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 -