Class Subscription

All Implemented Interfaces:
GraphQLRequestObject, GraphQLSubscriptionExecutor
Direct Known Subclasses:
SubscriptionResponse

public class Subscription extends SubscriptionExecutorForum implements GraphQLRequestObject
This class contains the response for a full request. See the plugin web site for more information on full and partial requests.
It also allows access to the _extensions_ part of the response. Take a look at the GraphQL spec for more information on this.
Author:
generated by graphql-java-generator
See Also:
  • Field Details

    • thisIsADummyFieldToCheckThatThisTemplateIsUsed

      public boolean thisIsADummyFieldToCheckThatThisTemplateIsUsed
      The field below is the only change from the original template. It is here only to check that this template is actually used
  • Constructor Details

    • Subscription

      public Subscription()
  • Method Details

    • setSubscribeToNewPost

      public void setSubscribeToNewPost(Post subscribeToNewPost)
    • getSubscribeToNewPost

      public Post getSubscribeToNewPost()
    • set__typename

      public void set__typename(String __typename)
    • get__typename

      public String get__typename()
    • setAliasValue

      public void setAliasValue(String aliasName, Object aliasDeserializedValue)
      This method is called during the json deserialization process, by the GraphQLObjectMapper, each time an alias value is read from the json.
      Parameters:
      aliasName -
      aliasDeserializedValue -
    • getAliasValue

      public Object getAliasValue(String alias)
      Retrieves the value for the given alias, as it has been received for this object in the GraphQL response.
      This method should not be used for Custom Scalars, as the parser doesn't know if this alias is a custom scalar, and which custom scalar to use at deserialization time. In most case, a value will then be provided by this method with a basis json deserialization, but this value won't be the proper custom scalar value.
      Parameters:
      alias -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static Subscription.Builder builder()
    • getExtensions

      public com.fasterxml.jackson.databind.JsonNode getExtensions()
    • setExtensions

      public void setExtensions(com.fasterxml.jackson.databind.JsonNode extensions)
      Specified by:
      setExtensions in interface GraphQLRequestObject
    • getExtensionsAsMap

      public Map<String,com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMap()
      Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
      Returns:
    • getExtensionsField

      public <T> T getExtensionsField(String key, Class<T> t) throws com.fasterxml.jackson.core.JsonProcessingException
      Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.
      Type Parameters:
      T -
      Parameters:
      key -
      t -
      Returns:
      null if the key is not in the extensions map. Otherwise: the value for this _key_, as a _t_ instance
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - When there is an error when converting the key's value into the _t_ class
    • subscribeToNewPostWithBindValues

      @Deprecated public SubscriptionClient subscribeToNewPostWithBindValues(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String,Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      subscribeToNewPostWithBindValues in class SubscriptionExecutorForum
      Parameters:
      queryResponseDef - The response definition of the subscription, in the native GraphQL format (see here above)
      subscriptionCallback - The instance that will be called for each notification (message or error) received for this subscription.
      It's an instance of SubscriptionCallback<clazz>, where clazz is the subscribeToNewPost subscription field.
      boardName - Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schema
      parameters - The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined subscription, this argument may be null or an empty Map
      Throws:
      GraphQLRequestExecutionException - When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
    • subscribeToNewPost

      @Deprecated public SubscriptionClient subscribeToNewPost(String queryResponseDef, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      subscribeToNewPost in class SubscriptionExecutorForum
      Parameters:
      queryResponseDef - The response definition of the subscription, in the native GraphQL format (see here above)
      subscriptionCallback - The instance that will be called for each notification (message or error) received for this subscription.
      It's an instance of SubscriptionCallback<clazz>, where clazz is the subscribeToNewPost subscription field.
      boardName - Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schema
      Throws:
      GraphQLRequestExecutionException - When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
    • subscribeToNewPostWithBindValues

      @Deprecated public SubscriptionClient subscribeToNewPostWithBindValues(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String,Object> parameters) throws GraphQLRequestExecutionException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      subscribeToNewPostWithBindValues in class SubscriptionExecutorForum
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by the SubscriptionExecutorForum.getSubscribeToNewPostGraphQLRequest(java.lang.String) method.
      subscriptionCallback - The instance that will be called for each notification (message or error) received for this subscription.
      It's an instance of SubscriptionCallback<clazz>, where clazz is the subscribeToNewPost subscription field.
      boardName - Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schema
      parameters - The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined Query, this argument may be null or an empty Map
      Throws:
      GraphQLRequestExecutionException - When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
    • subscribeToNewPost

      @Deprecated public SubscriptionClient subscribeToNewPost(ObjectResponse objectResponse, SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      subscribeToNewPost in class SubscriptionExecutorForum
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by the SubscriptionExecutorForum.getSubscribeToNewPostGraphQLRequest(java.lang.String) method.
      subscriptionCallback - The instance that will be called for each notification (message or error) received for this subscription.
      It's an instance of SubscriptionCallback<clazz>, where clazz is the subscribeToNewPost subscription field.
      boardName - Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schema
      paramsAndValues - This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
      This parameter contains an even number of parameters. It must be a series of name and values, like : paramName1, paramValue1, paramName2, paramValue2...
      Throws:
      GraphQLRequestExecutionException - When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
    • getSubscribeToNewPostResponseBuilder

      @Deprecated public Builder getSubscribeToNewPostResponseBuilder() throws GraphQLRequestPreparationException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      getSubscribeToNewPostResponseBuilder in class SubscriptionExecutorForum
      Returns:
      Throws:
      GraphQLRequestPreparationException
    • getSubscribeToNewPostGraphQLRequest

      @Deprecated public GraphQLRequestForum getSubscribeToNewPostGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException
      Deprecated.
      This method is deprecated: please use SubscriptionExecutor class instead of this class, to execute this method. It is maintained to keep existing code compatible with the generated code. It will be removed in 2.0 version.
      Overrides:
      getSubscribeToNewPostGraphQLRequest in class SubscriptionExecutorForum
      Parameters:
      partialRequest - The Partial GraphQL request, as explained in the plugin client documentation
      Returns:
      Throws:
      GraphQLRequestPreparationException