Package org.forum.client
Class SubscriptionExecutorForum
java.lang.Object
org.forum.client.SubscriptionExecutorForum
- All Implemented Interfaces:
com.graphql_java_generator.client.GraphQLSubscriptionExecutor
- Direct Known Subclasses:
Subscription
@Component
public class SubscriptionExecutorForum
extends Object
implements com.graphql_java_generator.client.GraphQLSubscriptionExecutor
This class contains the methods that allows the execution of the subscriptions that are defined in the Subscription of the GraphQL schema.
These methods allows:
These methods allows:
- Preparation of partial subscription requests
- Execution of partial prepared subscription requests
- Execution of partial direct subscription requests
- Author:
- generated by graphql-java-generator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.graphql_java_generator.client.SubscriptionClient
exec
(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Object... paramsAndValues) This method takes a full request definition, and executes it against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
exec
(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Object... paramsAndValues) This method takes a full request definition, and executes it against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
execWithBindValues
(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Map<String, Object> parameters) This method takes a full request definition, and executes it against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
execWithBindValues
(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Map<String, Object> parameters) This method takes a full request definition, and executes it against the GraphQL server.getGraphQLRequest
(String fullRequest) Get theGraphQLRequestForum
, to obtain a prepared full request.com.graphql_java_generator.client.request.Builder
Get theBuilder
for a full request, as expected by the exec and execWithBindValues methods.getSubscribeToNewPostGraphQLRequest
(String partialRequest) Get theGraphQLRequestForum
for the subscribeToNewPost EXECUTOR, created with the given Partial request.com.graphql_java_generator.client.request.Builder
Get theBuilder
for the Post, as expected by the subscribeToNewPost subscription.com.graphql_java_generator.client.SubscriptionClient
subscribeToNewPost
(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
subscribeToNewPost
(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
subscribeToNewPostWithBindValues
(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server.com.graphql_java_generator.client.SubscriptionClient
subscribeToNewPostWithBindValues
(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server.
-
Constructor Details
-
SubscriptionExecutorForum
public SubscriptionExecutorForum()
-
-
Method Details
-
execWithBindValues
public com.graphql_java_generator.client.SubscriptionClient execWithBindValues(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Map<String, Object> parameters) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationExceptionThis method takes a full request definition, and executes it against the GraphQL server. As this class is a subscription executor, the provided request must be a subscription full request. It may only return one subscription's field.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
Here is a sample on how to use it:- Parameters:
queryResponseDef
- The response definition of the subscription, in the native GraphQL format (see here above). It's a full request, as you would write it in graphiql. Is must include the subscription keyword.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the class of the subscription, that is the GraphQL type of the subscription's field that is subscribed.parameters
- The map of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
. The key is the parameter name, as defined in the query (in the above sample: heroParam is an optional parameter and skip is a mandatory one). The value is the parameter vale in its Java type (for instance aDate
for theGraphQLScalarTypeDate
). The parameters which value is missing in this map will no be transmitted toward the GraphQL server.- Returns:
- The
SubscriptionClient
that allows the caller to act on the subscribed subscription. - Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
com.graphql_java_generator.exception.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
-
exec
public com.graphql_java_generator.client.SubscriptionClient exec(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Object... paramsAndValues) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException This method takes a full request definition, and executes it against the GraphQL server. As this class is a subscription executor, the provided request must be a subscription full request. It may only return one subscription's field.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
Here is a sample on how to use it:- Parameters:
queryResponseDef
- The response definition of the subscription, in the native GraphQL format (see here above). It's a full request, as you would write it in graphiql. Is must include the subscription keyword.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the class of the subscription, that is the GraphQL type of the subscription's field that is subscribed.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 : (paramName1, paramValue1, paramName2, paramValue2...)- Returns:
- The
SubscriptionClient
that allows the caller to act on the subscribed subscription. - Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
com.graphql_java_generator.exception.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
-
execWithBindValues
public com.graphql_java_generator.client.SubscriptionClient execWithBindValues(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Map<String, Object> parameters) throws com.graphql_java_generator.exception.GraphQLRequestExecutionExceptionThis method takes a full request definition, and executes it against the GraphQL server. As this class is a subscription executor, the provided request must be a subscription full request. It may only return one subscription's field.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
Here is a sample on how to use it:- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by thegetGraphQLRequest(java.lang.String)
method or one of thegetXxxxGraphQLRequest(String)
methods.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the class of the subscription, that is the GraphQL type of the subscription's field that is subscribed.parameters
- The map of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Returns:
- The
SubscriptionClient
that allows the caller to act on the subscribed subscription. - Throws:
com.graphql_java_generator.exception.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
-
exec
public com.graphql_java_generator.client.SubscriptionClient exec(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<?> subscriptionCallback, Object... paramsAndValues) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException This method takes a full request definition, and executes it against the GraphQL server. As this class is a subscription executor, the provided request must be a subscription full request. It may only return one subscription's field.
You must also provide a callback instance of theSubscriptionCallback
, that will be called each time a message or an error is sent by this subscribed subscription.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
Here is a sample on how to use it:- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by thegetGraphQLRequest(java.lang.String)
method or one of thegetXxxxGraphQLRequest(String)
methods.subscriptionCallback
- The instance that will be called for each notification (message or error) received for this subscription.
It's an instance ofSubscriptionCallback
<clazz>, whereclazz
is the class of the subscription, that is the GraphQL type of the subscription's field that is subscribed.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 : (paramName1, paramValue1, paramName2, paramValue2...)- Returns:
- The
SubscriptionClient
that allows the caller to act on the subscribed subscription. - Throws:
com.graphql_java_generator.exception.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
-
getResponseBuilder
public com.graphql_java_generator.client.request.Builder getResponseBuilder() throws com.graphql_java_generator.exception.GraphQLRequestPreparationExceptionGet theBuilder
for a full request, as expected by the exec and execWithBindValues methods.- Returns:
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
-
getGraphQLRequest
public GraphQLRequestForum getGraphQLRequest(String fullRequest) throws com.graphql_java_generator.exception.GraphQLRequestPreparationException Get theGraphQLRequestForum
, to obtain a prepared full request. For instance:GraphQLRequestForum request = new GraphQLRequestForum(fullRequest);
- Parameters:
fullRequest
- The full GraphQL request, as specified in the GraphQL specification- Returns:
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
-
subscribeToNewPostWithBindValues
public com.graphql_java_generator.client.SubscriptionClient subscribeToNewPostWithBindValues(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationExceptionThis method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
You must also provide a callback instance that will be called each time a message or an error is sent by this subscribed subscription. As the plugin limits the actual subscriptions at one par call (one field from the Subscription GraphQL type), it allows the deserialization of this exact field. So the callback is expected to be an instance ofSubscriptionCallback
, as theSubscription.subscribeToNewPost
is of typePost
. Here is a sample on how to use it:- 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 ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparameters
- 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 emptyMap
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
com.graphql_java_generator.exception.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
public com.graphql_java_generator.client.SubscriptionClient subscribeToNewPost(String queryResponseDef, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
You must also provide a callback instance that will be called each time a message or an error is sent by this subscribed subscription. As the plugin limits the actual subscriptions at one par call (one field from the Subscription GraphQL type), it allows the deserialization of this exact field. So the callback is expected to be an instance ofSubscriptionCallback
, as theSubscription.subscribeToNewPost
is of typePost
. Here is a sample on how to use it:- 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 ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparameters
- 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 emptyMap
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
com.graphql_java_generator.exception.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
-
subscribeToNewPostWithBindValues
public com.graphql_java_generator.client.SubscriptionClient subscribeToNewPostWithBindValues(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Map<String, Object> parameters) throws com.graphql_java_generator.exception.GraphQLRequestExecutionExceptionThis method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
You must also provide a callback instance that will be called each time a message or an error is sent by this subscribed subscription. As the plugin limits the actual subscriptions at one par call (one field from the Subscription GraphQL type), it allows the deserialization of this exact field. So the callback is expected to be an instance ofSubscriptionCallback
, as theSubscription.subscribeToNewPost
is of typePost
. Here is a sample on how to use it:- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by thegetSubscribeToNewPostGraphQLRequest(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 ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparameters
- 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 emptyMap
- Throws:
com.graphql_java_generator.exception.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
public com.graphql_java_generator.client.SubscriptionClient subscribeToNewPost(com.graphql_java_generator.client.request.ObjectResponse objectResponse, com.graphql_java_generator.client.SubscriptionCallback<Post> subscriptionCallback, String boardName, Object... paramsAndValues) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException This method registers a subscription, by executing a direct partial subscribeToNewPost subscription against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
You must also provide a callback instance that will be called each time a message or an error is sent by this subscribed subscription. As the plugin limits the actual subscriptions at one par call (one field from the Subscription GraphQL type), it allows the deserialization of this exact field. So the callback is expected to be an instance ofSubscriptionCallback
, as theSubscription.subscribeToNewPost
is of typePost
. Here is a sample on how to use it:- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to return
Note: theObjectResponse
type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequestForum POJO, as returned by thegetSubscribeToNewPostGraphQLRequest(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 ofSubscriptionCallback
<clazz>, whereclazz
is the subscribeToNewPost subscription field.boardName
- Parameter for the subscribeToNewPost field of Subscription, as defined in the GraphQL schemaparamsAndValues
- 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:
com.graphql_java_generator.exception.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
public com.graphql_java_generator.client.request.Builder getSubscribeToNewPostResponseBuilder() throws com.graphql_java_generator.exception.GraphQLRequestPreparationExceptionGet theBuilder
for the Post, as expected by the subscribeToNewPost subscription.- Returns:
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
-
getSubscribeToNewPostGraphQLRequest
public GraphQLRequestForum getSubscribeToNewPostGraphQLRequest(String partialRequest) throws com.graphql_java_generator.exception.GraphQLRequestPreparationException Get theGraphQLRequestForum
for the subscribeToNewPost EXECUTOR, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQL request, as explained in the plugin client documentation- Returns:
- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
-