public class DefaultPubSubRpc extends Object implements PubSubRpc
PubSubRpc.PullCallback, PubSubRpc.PullFuture| Constructor and Description |
|---|
DefaultPubSubRpc(PubSubOptions options) |
| Modifier and Type | Method and Description |
|---|---|
Future<com.google.protobuf.Empty> |
acknowledge(com.google.pubsub.v1.AcknowledgeRequest request)
Sends a request to acknowledge messages for a subscription.
|
void |
close() |
Future<com.google.pubsub.v1.Subscription> |
create(com.google.pubsub.v1.Subscription subscription)
Sends a request to create a subscription.
|
Future<com.google.pubsub.v1.Topic> |
create(com.google.pubsub.v1.Topic topic)
Sends a request to create a topic.
|
Future<com.google.protobuf.Empty> |
delete(com.google.pubsub.v1.DeleteSubscriptionRequest request)
Sends a request to delete a subscription.
|
Future<com.google.protobuf.Empty> |
delete(com.google.pubsub.v1.DeleteTopicRequest request)
Sends a request to delete a topic.
|
Future<com.google.pubsub.v1.Subscription> |
get(com.google.pubsub.v1.GetSubscriptionRequest request)
Sends a request to get a subscription.
|
Future<com.google.pubsub.v1.Topic> |
get(com.google.pubsub.v1.GetTopicRequest request)
Sends a request to get a topic.
|
Future<com.google.pubsub.v1.ListSubscriptionsResponse> |
list(com.google.pubsub.v1.ListSubscriptionsRequest request)
Sends a request to list the subscriptions in a project.
|
Future<com.google.pubsub.v1.ListTopicsResponse> |
list(com.google.pubsub.v1.ListTopicsRequest request)
Sends a request to list the topics in a project.
|
Future<com.google.pubsub.v1.ListTopicSubscriptionsResponse> |
list(com.google.pubsub.v1.ListTopicSubscriptionsRequest request)
Sends a request to list the subscriptions for a topic.
|
Future<com.google.protobuf.Empty> |
modify(com.google.pubsub.v1.ModifyAckDeadlineRequest request)
Sends a request to modify the acknowledge deadline of a subscription.
|
Future<com.google.protobuf.Empty> |
modify(com.google.pubsub.v1.ModifyPushConfigRequest request)
Sends a request to modify the push configuration of a subscription.
|
Future<com.google.pubsub.v1.PublishResponse> |
publish(com.google.pubsub.v1.PublishRequest request)
Sends a request to publish messages.
|
PubSubRpc.PullFuture |
pull(com.google.pubsub.v1.PullRequest request)
Sends a request to pull messages from a subscription.
|
public DefaultPubSubRpc(PubSubOptions options) throws IOException
IOExceptionpublic Future<com.google.pubsub.v1.Topic> create(com.google.pubsub.v1.Topic topic)
PubSubRpcFuture object to consume the
result. Future.get() returns the created topic.public Future<com.google.pubsub.v1.PublishResponse> publish(com.google.pubsub.v1.PublishRequest request)
PubSubRpcFuture object to consume the
result. Future.get() returns a response object containing the publish result.public Future<com.google.pubsub.v1.Topic> get(com.google.pubsub.v1.GetTopicRequest request)
PubSubRpcFuture object to consume the
result. Future.get() returns the requested topic or null if not found.public Future<com.google.pubsub.v1.ListTopicsResponse> list(com.google.pubsub.v1.ListTopicsRequest request)
PubSubRpcFuture object to
consume the result. Future.get() returns a response object containing the listing
result.public Future<com.google.pubsub.v1.ListTopicSubscriptionsResponse> list(com.google.pubsub.v1.ListTopicSubscriptionsRequest request)
PubSubRpcFuture
object to consume the result. Future.get() returns a response object containing the
listing result.public Future<com.google.protobuf.Empty> delete(com.google.pubsub.v1.DeleteTopicRequest request)
PubSubRpcFuture object to consume the
result. Future.get() returns Empty.getDefaultInstance() or null if the
topic was not found.public Future<com.google.pubsub.v1.Subscription> create(com.google.pubsub.v1.Subscription subscription)
PubSubRpcFuture object to
consume the result. Future.get() returns the created subscription.public Future<com.google.pubsub.v1.Subscription> get(com.google.pubsub.v1.GetSubscriptionRequest request)
PubSubRpcFuture object to consume
the result. Future.get() returns the requested subscription or null if not
found.public Future<com.google.pubsub.v1.ListSubscriptionsResponse> list(com.google.pubsub.v1.ListSubscriptionsRequest request)
PubSubRpcFuture
object to consume the result. Future.get() returns a response object containing the
listing result.public Future<com.google.protobuf.Empty> delete(com.google.pubsub.v1.DeleteSubscriptionRequest request)
PubSubRpcFuture object to
consume the result. Future.get() returns Empty.getDefaultInstance() or
null if the subscription was not found.public Future<com.google.protobuf.Empty> modify(com.google.pubsub.v1.ModifyAckDeadlineRequest request)
PubSubRpcFuture object to consume the result. Future.get() returns
Empty.getDefaultInstance() if the request was issued correctly.public Future<com.google.protobuf.Empty> acknowledge(com.google.pubsub.v1.AcknowledgeRequest request)
PubSubRpcFuture object to consume the result. Future.get() returns
Empty.getDefaultInstance() if the request was issued correctly.acknowledge in interface PubSubRpcrequest - the request object containing all of the parameters for the API callpublic PubSubRpc.PullFuture pull(com.google.pubsub.v1.PullRequest request)
PubSubRpcPubSubRpc.PullFuture
object to consume the result. Future.get() returns a response object containing the
pulled messages. PullFuture#addCallback(PullCallback) can be used to register a
callback for the request's completion.public Future<com.google.protobuf.Empty> modify(com.google.pubsub.v1.ModifyPushConfigRequest request)
PubSubRpcFuture object to consume the result. Future.get() returns
Empty.getDefaultInstance() if the request was issued correctly.public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2016 Google. All rights reserved.