public class SubscribeRequest extends Object
Implementation is not thread-safe.
| Constructor and Description |
|---|
SubscribeRequest(com.google.api.client.http.HttpRequest request,
String notificationDeliveryMethod) |
| Modifier and Type | Method and Description |
|---|---|
SubscribeResponse |
execute()
Executes the subscribe request.
|
String |
getClientToken()
Returns the client token (an opaque string) provided by the client or
null for none. |
NotificationCallback |
getNotificationCallback()
Returns the notification callback or
null for none. |
String |
getNotificationDeliveryMethod()
Returns the notifications delivery method.
|
com.google.api.client.http.HttpRequest |
getRequest()
Returns the subscribe HTTP request.
|
String |
getSubscriptionId()
Returns the subscription UUID provided by the client.
|
SubscriptionStore |
getSubscriptionStore()
Returns the subscription store or
null for none. |
<E> void |
queue(BatchRequest batchRequest,
Class<E> errorClass,
BatchCallback<Void,E> callback)
Queues the subscribe request into the specified batch request container.
|
SubscribeRequest |
setClientToken(String clientToken)
Sets the client token (an opaque string) provided by the client or
null for none. |
SubscribeRequest |
setNotificationDeliveryMethod(String notificationDeliveryMethod)
Sets the notifications delivery method.
|
SubscribeRequest |
setSubscriptionId(String subscriptionId)
Sets the subscription UUID provided by the client.
|
SubscribeRequest |
withNotificationCallback(SubscriptionStore subscriptionStore,
NotificationCallback notificationCallback)
Sets the subscription store and notification callback associated with this subscription.
|
<N> SubscribeRequest |
withTypedNotificationCallback(SubscriptionStore subscriptionStore,
Class<N> notificationCallbackClass,
TypedNotificationCallback<N> typedNotificationCallback)
Sets the subscription store and typed notification callback associated with this subscription.
|
public SubscribeRequest(com.google.api.client.http.HttpRequest request,
String notificationDeliveryMethod)
request - HTTP GET requestnotificationDeliveryMethod - notification delivery methodpublic SubscribeRequest withNotificationCallback(SubscriptionStore subscriptionStore, NotificationCallback notificationCallback)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
subscriptionStore - subscription storenotificationCallback - notification callbackpublic <N> SubscribeRequest withTypedNotificationCallback(SubscriptionStore subscriptionStore, Class<N> notificationCallbackClass, TypedNotificationCallback<N> typedNotificationCallback)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
subscriptionStore - subscription storenotificationCallbackClass - data class the successful notification will be parsed into or
Void.class to ignore the contenttypedNotificationCallback - typed notification callbackpublic final com.google.api.client.http.HttpRequest getRequest()
public final String getNotificationDeliveryMethod()
public SubscribeRequest setNotificationDeliveryMethod(String notificationDeliveryMethod)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final NotificationCallback getNotificationCallback()
null for none.public final SubscriptionStore getSubscriptionStore()
null for none.public String getClientToken()
null for none.public SubscribeRequest setClientToken(String clientToken)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public String getSubscriptionId()
public SubscribeRequest setSubscriptionId(String subscriptionId)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public SubscribeResponse execute() throws IOException
IOExceptionpublic final <E> void queue(BatchRequest batchRequest, Class<E> errorClass, BatchCallback<Void,E> callback) throws IOException
Batched requests are then executed when BatchRequest.execute() is called.
batchRequest - batch request containererrorClass - data class the unsuccessful response will be parsed into or
Void.class to ignore the contentcallback - batch callbackIOExceptionCopyright © 2010-2012 Google. All Rights Reserved.