Class DeadLetterPolicy.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, DeadLetterPolicyOrBuilder, Cloneable
    Enclosing class:
    DeadLetterPolicy

    public static final class DeadLetterPolicy.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
    implements DeadLetterPolicyOrBuilder
     Dead lettering is done on a best effort basis. The same message might be
     dead lettered multiple times.
    
     If validation on any of the fields fails at subscription creation/updation,
     the create/update subscription request will fail.
     
    Protobuf type google.pubsub.v1.DeadLetterPolicy
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • clear

        public DeadLetterPolicy.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • getDefaultInstanceForType

        public DeadLetterPolicy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public DeadLetterPolicy build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public DeadLetterPolicy buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public DeadLetterPolicy.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • setField

        public DeadLetterPolicy.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • clearField

        public DeadLetterPolicy.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • clearOneof

        public DeadLetterPolicy.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • setRepeatedField

        public DeadLetterPolicy.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         int index,
                                                         Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • addRepeatedField

        public DeadLetterPolicy.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • mergeFrom

        public DeadLetterPolicy.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DeadLetterPolicy.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • mergeFrom

        public DeadLetterPolicy.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DeadLetterPolicy.Builder>
        Throws:
        IOException
      • getDeadLetterTopic

        public String getDeadLetterTopic()
         The name of the topic to which dead letter messages should be published.
         Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
         account associated with the enclosing subscription's parent project (i.e.,
         service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
         permission to Publish() to this topic.
        
         The operation will fail if the topic does not exist.
         Users should ensure that there is a subscription attached to this topic
         since messages published to a topic with no subscriptions are lost.
         
        string dead_letter_topic = 1;
        Specified by:
        getDeadLetterTopic in interface DeadLetterPolicyOrBuilder
        Returns:
        The deadLetterTopic.
      • getDeadLetterTopicBytes

        public com.google.protobuf.ByteString getDeadLetterTopicBytes()
         The name of the topic to which dead letter messages should be published.
         Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
         account associated with the enclosing subscription's parent project (i.e.,
         service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
         permission to Publish() to this topic.
        
         The operation will fail if the topic does not exist.
         Users should ensure that there is a subscription attached to this topic
         since messages published to a topic with no subscriptions are lost.
         
        string dead_letter_topic = 1;
        Specified by:
        getDeadLetterTopicBytes in interface DeadLetterPolicyOrBuilder
        Returns:
        The bytes for deadLetterTopic.
      • setDeadLetterTopic

        public DeadLetterPolicy.Builder setDeadLetterTopic​(String value)
         The name of the topic to which dead letter messages should be published.
         Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
         account associated with the enclosing subscription's parent project (i.e.,
         service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
         permission to Publish() to this topic.
        
         The operation will fail if the topic does not exist.
         Users should ensure that there is a subscription attached to this topic
         since messages published to a topic with no subscriptions are lost.
         
        string dead_letter_topic = 1;
        Parameters:
        value - The deadLetterTopic to set.
        Returns:
        This builder for chaining.
      • clearDeadLetterTopic

        public DeadLetterPolicy.Builder clearDeadLetterTopic()
         The name of the topic to which dead letter messages should be published.
         Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
         account associated with the enclosing subscription's parent project (i.e.,
         service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
         permission to Publish() to this topic.
        
         The operation will fail if the topic does not exist.
         Users should ensure that there is a subscription attached to this topic
         since messages published to a topic with no subscriptions are lost.
         
        string dead_letter_topic = 1;
        Returns:
        This builder for chaining.
      • setDeadLetterTopicBytes

        public DeadLetterPolicy.Builder setDeadLetterTopicBytes​(com.google.protobuf.ByteString value)
         The name of the topic to which dead letter messages should be published.
         Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
         account associated with the enclosing subscription's parent project (i.e.,
         service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
         permission to Publish() to this topic.
        
         The operation will fail if the topic does not exist.
         Users should ensure that there is a subscription attached to this topic
         since messages published to a topic with no subscriptions are lost.
         
        string dead_letter_topic = 1;
        Parameters:
        value - The bytes for deadLetterTopic to set.
        Returns:
        This builder for chaining.
      • getMaxDeliveryAttempts

        public int getMaxDeliveryAttempts()
         The maximum number of delivery attempts for any message. The value must be
         between 5 and 100.
        
         The number of delivery attempts is defined as 1 + (the sum of number of
         NACKs and number of times the acknowledgement deadline has been exceeded
         for the message).
        
         A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
         client libraries may automatically extend ack_deadlines.
        
         This field will be honored on a best effort basis.
        
         If this parameter is 0, a default value of 5 is used.
         
        int32 max_delivery_attempts = 2;
        Specified by:
        getMaxDeliveryAttempts in interface DeadLetterPolicyOrBuilder
        Returns:
        The maxDeliveryAttempts.
      • setMaxDeliveryAttempts

        public DeadLetterPolicy.Builder setMaxDeliveryAttempts​(int value)
         The maximum number of delivery attempts for any message. The value must be
         between 5 and 100.
        
         The number of delivery attempts is defined as 1 + (the sum of number of
         NACKs and number of times the acknowledgement deadline has been exceeded
         for the message).
        
         A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
         client libraries may automatically extend ack_deadlines.
        
         This field will be honored on a best effort basis.
        
         If this parameter is 0, a default value of 5 is used.
         
        int32 max_delivery_attempts = 2;
        Parameters:
        value - The maxDeliveryAttempts to set.
        Returns:
        This builder for chaining.
      • clearMaxDeliveryAttempts

        public DeadLetterPolicy.Builder clearMaxDeliveryAttempts()
         The maximum number of delivery attempts for any message. The value must be
         between 5 and 100.
        
         The number of delivery attempts is defined as 1 + (the sum of number of
         NACKs and number of times the acknowledgement deadline has been exceeded
         for the message).
        
         A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
         client libraries may automatically extend ack_deadlines.
        
         This field will be honored on a best effort basis.
        
         If this parameter is 0, a default value of 5 is used.
         
        int32 max_delivery_attempts = 2;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final DeadLetterPolicy.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>
      • mergeUnknownFields

        public final DeadLetterPolicy.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<DeadLetterPolicy.Builder>