Class PubSubSubscriptionUtils


  • public final class PubSubSubscriptionUtils
    extends java.lang.Object
    Various utility methods for dealing with Pub/Sub subscriptions. Original source at : https://github.com/spring-cloud/spring-cloud-gcp/blob/master/spring-cloud-gcp-pubsub/src/main/java/org/springframework/cloud/gcp/pubsub/support/PubSubSubscriptionUtils.java
    Since:
    2.0.0
    Author:
    Mike Eltsufin, Vinicius Carvalho
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.google.pubsub.v1.ProjectSubscriptionName toProjectSubscriptionName​(java.lang.String subscription, java.lang.String projectId)
      Create a ProjectSubscriptionName based on a subscription name within a project or the fully-qualified subscription name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toProjectSubscriptionName

        public static com.google.pubsub.v1.ProjectSubscriptionName toProjectSubscriptionName​(@Nonnull
                                                                                             java.lang.String subscription,
                                                                                             @Nullable
                                                                                             java.lang.String projectId)
        Create a ProjectSubscriptionName based on a subscription name within a project or the fully-qualified subscription name. If the specified subscription is in the projects/<project_name>/subscriptions/<subscription_name> format, then the projectId is ignored}
        Parameters:
        subscription - the subscription name in the project or the fully-qualified project name
        projectId - the project ID to use if the subscription is not a fully-qualified name
        Returns:
        the Pub/Sub object representing the subscription name