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
Modifier and TypeFieldDescriptionprotected static org.slf4j.Logger
The logger for this class -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
logger
protected static org.slf4j.Logger loggerThe 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 interfaceSubscriptionCallback<Character>
-
onMessage
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 interfaceSubscriptionCallback<Character>
-
onClose
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 interfaceSubscriptionCallback<Character>
- Parameters:
statusCode
- since 2.0 release, this parameter is always 0reason
- since 2.0 release, this parameter is always null
-
onError
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 interfaceSubscriptionCallback<Character>
-