public class JsonSubscribeRequest extends SubscribeRequest
| Constructor and Description |
|---|
JsonSubscribeRequest(com.google.api.client.http.HttpRequest request,
String notificationDeliveryMethod,
com.google.api.client.json.JsonFactory jsonFactory) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.client.json.JsonFactory |
getJsonFactory()
Returns the JSON factory.
|
void |
queue(BatchRequest batchRequest,
JsonBatchCallback<Void> callback)
Queues the subscribe JSON request into the specified batch request container.
|
JsonSubscribeRequest |
setClientToken(String clientToken)
Sets the client token (an opaque string) provided by the client or
null for none. |
JsonSubscribeRequest |
setNotificationDeliveryMethod(String notificationDeliveryMethod)
Sets the notifications delivery method.
|
JsonSubscribeRequest |
setSubscriptionId(String subscriptionId)
Sets the subscription UUID provided by the client.
|
<N> JsonSubscribeRequest |
withJsonNotificationCallback(SubscriptionStore subscriptionStore,
Class<N> notificationCallbackClass,
JsonNotificationCallback<N> jsonNotificationCallback)
Sets the subscription store and JSON notification callback associated with this subscription.
|
JsonSubscribeRequest |
withNotificationCallback(SubscriptionStore subscriptionStore,
NotificationCallback notificationCallback)
Sets the subscription store and notification callback associated with this subscription.
|
<N> JsonSubscribeRequest |
withTypedNotificationCallback(SubscriptionStore subscriptionStore,
Class<N> notificationCallbackClass,
TypedNotificationCallback<N> typedNotificationCallback)
Sets the subscription store and typed notification callback associated with this subscription.
|
execute, getClientToken, getNotificationCallback, getNotificationDeliveryMethod, getRequest, getSubscriptionId, getSubscriptionStore, queuepublic JsonSubscribeRequest(com.google.api.client.http.HttpRequest request,
String notificationDeliveryMethod,
com.google.api.client.json.JsonFactory jsonFactory)
request - HTTP GET requestnotificationDeliveryMethod - notification delivery methodjsonFactory - JSON factorypublic JsonSubscribeRequest withNotificationCallback(SubscriptionStore subscriptionStore, NotificationCallback notificationCallback)
SubscribeRequestOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
withNotificationCallback in class SubscribeRequestsubscriptionStore - subscription storenotificationCallback - notification callbackpublic <N> JsonSubscribeRequest withTypedNotificationCallback(SubscriptionStore subscriptionStore, Class<N> notificationCallbackClass, TypedNotificationCallback<N> typedNotificationCallback)
SubscribeRequestOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
withTypedNotificationCallback in class SubscribeRequestsubscriptionStore - subscription storenotificationCallbackClass - data class the successful notification will be parsed into or
Void.class to ignore the contenttypedNotificationCallback - typed notification callbackpublic JsonSubscribeRequest setNotificationDeliveryMethod(String notificationDeliveryMethod)
SubscribeRequestOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setNotificationDeliveryMethod in class SubscribeRequestpublic JsonSubscribeRequest setClientToken(String clientToken)
SubscribeRequestnull for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setClientToken in class SubscribeRequestpublic JsonSubscribeRequest setSubscriptionId(String subscriptionId)
SubscribeRequestOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setSubscriptionId in class SubscribeRequestpublic <N> JsonSubscribeRequest withJsonNotificationCallback(SubscriptionStore subscriptionStore, Class<N> notificationCallbackClass, JsonNotificationCallback<N> jsonNotificationCallback)
subscriptionStore - subscription storenotificationCallbackClass - data class the successful notification will be parsed into or
Void.class to ignore the contentjsonNotificationCallback - JSON notification callbackpublic final com.google.api.client.json.JsonFactory getJsonFactory()
public final void queue(BatchRequest batchRequest, JsonBatchCallback<Void> callback) throws IOException
Batched requests are then executed when BatchRequest.execute() is called.
Example usage:
request.queue(batchRequest, new JsonBatchCallback<Void>() {
public void onSuccess(Void ignored, HttpHeaders responseHeaders) {
log("Success");
}
public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
log(e.getMessage());
}
});
batchRequest - batch request containercallback - batch callbackIOExceptionCopyright © 2010-2012 Google. All Rights Reserved.