Class NewCharacterSubscriptionCallback

java.lang.Object
com.graphql_java_generator.samples.simple.client.graphql.NewCharacterSubscriptionCallback
All Implemented Interfaces:
SubscriptionCallback<Character>

public class NewCharacterSubscriptionCallback extends Object implements SubscriptionCallback<Character>
Author:
etienne-sf
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static org.slf4j.Logger
    The logger for this class
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected static org.slf4j.Logger logger
      The logger for this class
  • Constructor Details

    • NewCharacterSubscriptionCallback

      public NewCharacterSubscriptionCallback()
  • Method Details

    • onConnect

      public void onConnect()
      Description copied from interface: SubscriptionCallback
      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)
      Specified by:
      onConnect in interface SubscriptionCallback<Character>
    • onMessage

      public void onMessage(Character t)
      Description copied from interface: SubscriptionCallback
      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.
      Specified by:
      onMessage in interface SubscriptionCallback<Character>
    • onClose

      public void onClose(int statusCode, String reason)
      Description copied from interface: SubscriptionCallback
      A callback to make the program aware of the end of the subscription channel. It's an information call: no special action is expected.
      Specified by:
      onClose in interface SubscriptionCallback<Character>
      Parameters:
      statusCode - since 2.0 release, this parameter is always 0
      reason - since 2.0 release, this parameter is always null
    • onError

      public void onError(Throwable cause)
      Description copied from interface: SubscriptionCallback
      Whenever an error occurs, at any time of the subscription processing. It's an information call: no special action is expected.
      Specified by:
      onError in interface SubscriptionCallback<Character>