public class PubSubAdmin extends Object
Constructor and Description |
---|
PubSubAdmin(GcpProjectIdProvider projectIdProvider,
com.google.api.gax.core.CredentialsProvider credentialsProvider)
This constructor instantiates TopicAdminClient and SubscriptionAdminClient with all their
defaults and the provided credentials provider.
|
PubSubAdmin(GcpProjectIdProvider projectIdProvider,
com.google.cloud.pubsub.v1.TopicAdminClient topicAdminClient,
com.google.cloud.pubsub.v1.SubscriptionAdminClient subscriptionAdminClient) |
Modifier and Type | Method and Description |
---|---|
com.google.pubsub.v1.Subscription |
createSubscription(String subscriptionName,
String topicName)
Create a new subscription on Google Cloud Pub/Sub.
|
com.google.pubsub.v1.Subscription |
createSubscription(String subscriptionName,
String topicName,
Integer ackDeadline)
Create a new subscription on Google Cloud Pub/Sub.
|
com.google.pubsub.v1.Subscription |
createSubscription(String subscriptionName,
String topicName,
Integer ackDeadline,
String pushEndpoint)
Create a new subscription on Google Cloud Pub/Sub.
|
com.google.pubsub.v1.Subscription |
createSubscription(String subscriptionName,
String topicName,
String pushEndpoint)
Create a new subscription on Google Cloud Pub/Sub.
|
com.google.pubsub.v1.Topic |
createTopic(String topicName)
Create a new topic on Google Cloud Pub/Sub.
|
void |
deleteSubscription(String subscriptionName)
Delete a subscription from Google Cloud Pub/Sub.
|
void |
deleteTopic(String topicName)
Delete a topic from Google Cloud Pub/Sub.
|
int |
getDefaultAckDeadline() |
com.google.pubsub.v1.Subscription |
getSubscription(String subscriptionName)
Get the configuration of a Google Cloud Pub/Sub subscription.
|
com.google.pubsub.v1.Topic |
getTopic(String topicName)
Get the configuration of a Google Cloud Pub/Sub topic.
|
List<com.google.pubsub.v1.Subscription> |
listSubscriptions()
Return every subscription in a project.
|
List<com.google.pubsub.v1.Topic> |
listTopics()
Return every topic in a project.
|
void |
setDefaultAckDeadline(int defaultAckDeadline)
Set the default acknowledgement deadline value.
|
public PubSubAdmin(GcpProjectIdProvider projectIdProvider, com.google.api.gax.core.CredentialsProvider credentialsProvider) throws IOException
IOException
public PubSubAdmin(GcpProjectIdProvider projectIdProvider, com.google.cloud.pubsub.v1.TopicAdminClient topicAdminClient, com.google.cloud.pubsub.v1.SubscriptionAdminClient subscriptionAdminClient)
public com.google.pubsub.v1.Topic createTopic(String topicName)
topicName
- the name for the new topicpublic com.google.pubsub.v1.Topic getTopic(String topicName)
topicName
- canonical topic name, e.g., "topicName"null
if topic doesn't existpublic void deleteTopic(String topicName)
topicName
- the name of the topic to be deletedpublic List<com.google.pubsub.v1.Topic> listTopics()
If there are multiple pages, they will all be merged into the same result.
public com.google.pubsub.v1.Subscription createSubscription(String subscriptionName, String topicName)
subscriptionName
- the name of the new subscriptiontopicName
- the name of the topic being subscribed topublic com.google.pubsub.v1.Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline)
subscriptionName
- the name of the new subscriptiontopicName
- the name of the topic being subscribed toackDeadline
- deadline in seconds before a message is resent. If not provided, set to
default of 10 secondspublic com.google.pubsub.v1.Subscription createSubscription(String subscriptionName, String topicName, String pushEndpoint)
subscriptionName
- the name of the new subscriptiontopicName
- the name of the topic being subscribed topushEndpoint
- URL of the service receiving the push messages. If not provided, uses
message pulling by defaultpublic com.google.pubsub.v1.Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline, String pushEndpoint)
subscriptionName
- the name of the new subscriptiontopicName
- the name of the topic being subscribed toackDeadline
- deadline in seconds before a message is resent. If not provided, set to
default of 10 secondspushEndpoint
- URL of the service receiving the push messages. If not provided, uses
message pulling by defaultpublic com.google.pubsub.v1.Subscription getSubscription(String subscriptionName)
subscriptionName
- canonical subscription name, e.g., "subscriptionName"null
if subscription doesn't existpublic void deleteSubscription(String subscriptionName)
subscriptionName
- public List<com.google.pubsub.v1.Subscription> listSubscriptions()
If there are multiple pages, they will all be merged into the same result.
public int getDefaultAckDeadline()
public void setDefaultAckDeadline(int defaultAckDeadline)
defaultAckDeadline
- default acknowledgement deadline value in secondsCopyright © 2018 Pivotal Software, Inc.. All rights reserved.