Class PubSubTopicUtils
java.lang.Object
com.google.cloud.spring.pubsub.support.PubSubTopicUtils
Various utility methods for dealing with Pub/Sub topics.
- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.pubsub.v1.ProjectTopicNametoProjectTopicName(String topic, String projectId) Create aProjectTopicNamebased on a topic name within a project or the fully-qualified topic name.static com.google.pubsub.v1.TopicNametoTopicName(String topic, String projectId) Create aTopicNamebased on a topic name within a project or the fully-qualified topic name.
-
Method Details
-
toProjectTopicName
public static com.google.pubsub.v1.ProjectTopicName toProjectTopicName(String topic, @Nullable String projectId) Create aProjectTopicNamebased on a topic name within a project or the fully-qualified topic name. If the specified topic is in theprojects/[project_name]/topics/[topic_name]format, then theprojectIdis ignored}- Parameters:
topic- the topic name in the project or the fully-qualified project nameprojectId- the project ID to use if the topic is not a fully-qualified name- Returns:
- the Pub/Sub object representing the topic name
-
toTopicName
Create aTopicNamebased on a topic name within a project or the fully-qualified topic name. If the specified topic is in theprojects/[project_name]/topics/[topic_name]format, then theprojectIdis ignored}- Parameters:
topic- the topic name in the project or the fully-qualified project nameprojectId- the project ID to use if the topic is not a fully-qualified name- Returns:
- the Pub/Sub object representing the topic name
-