Class AttributeContext.Peer.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, AttributeContext.PeerOrBuilder, Cloneable
    Enclosing class:
    AttributeContext.Peer

    public static final class AttributeContext.Peer.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<AttributeContext.Peer.Builder>
    implements AttributeContext.PeerOrBuilder
     This message defines attributes for a node that handles a network request.
     The node can be either a service or an application that sends, forwards,
     or receives the request. Service peers should fill in the `service`,
     `principal`, and `labels` as appropriate.
     [#next-free-field: 6]
     
    Protobuf type envoy.service.auth.v2.AttributeContext.Peer
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3.Builder<AttributeContext.Peer.Builder>
      • internalGetMutableMapField

        protected com.google.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<AttributeContext.Peer.Builder>
      • internalGetFieldAccessorTable

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

        public AttributeContext.Peer.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<AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • getDefaultInstanceForType

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

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

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

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • clearField

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • clearOneof

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • setRepeatedField

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • addRepeatedField

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • isInitialized

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

        public AttributeContext.Peer.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<AttributeContext.Peer.Builder>
        Throws:
        IOException
      • hasAddress

        public boolean hasAddress()
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
        Specified by:
        hasAddress in interface AttributeContext.PeerOrBuilder
        Returns:
        Whether the address field is set.
      • getAddress

        public Address getAddress()
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
        Specified by:
        getAddress in interface AttributeContext.PeerOrBuilder
        Returns:
        The address.
      • setAddress

        public AttributeContext.Peer.Builder setAddress​(Address value)
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
      • setAddress

        public AttributeContext.Peer.Builder setAddress​(Address.Builder builderForValue)
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
      • mergeAddress

        public AttributeContext.Peer.Builder mergeAddress​(Address value)
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
      • clearAddress

        public AttributeContext.Peer.Builder clearAddress()
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
      • getAddressBuilder

        public Address.Builder getAddressBuilder()
         The address of the peer, this is typically the IP address.
         It can also be UDS path, or others.
         
        .envoy.api.v2.core.Address address = 1;
      • getService

        public String getService()
         The canonical service name of the peer.
         It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
         <config_http_conn_man_headers_downstream-service-cluster>`
         If a more trusted source of the service name is available through mTLS/secure naming, it
         should be used.
         
        string service = 2;
        Specified by:
        getService in interface AttributeContext.PeerOrBuilder
        Returns:
        The service.
      • getServiceBytes

        public com.google.protobuf.ByteString getServiceBytes()
         The canonical service name of the peer.
         It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
         <config_http_conn_man_headers_downstream-service-cluster>`
         If a more trusted source of the service name is available through mTLS/secure naming, it
         should be used.
         
        string service = 2;
        Specified by:
        getServiceBytes in interface AttributeContext.PeerOrBuilder
        Returns:
        The bytes for service.
      • setService

        public AttributeContext.Peer.Builder setService​(String value)
         The canonical service name of the peer.
         It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
         <config_http_conn_man_headers_downstream-service-cluster>`
         If a more trusted source of the service name is available through mTLS/secure naming, it
         should be used.
         
        string service = 2;
        Parameters:
        value - The service to set.
        Returns:
        This builder for chaining.
      • clearService

        public AttributeContext.Peer.Builder clearService()
         The canonical service name of the peer.
         It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
         <config_http_conn_man_headers_downstream-service-cluster>`
         If a more trusted source of the service name is available through mTLS/secure naming, it
         should be used.
         
        string service = 2;
        Returns:
        This builder for chaining.
      • setServiceBytes

        public AttributeContext.Peer.Builder setServiceBytes​(com.google.protobuf.ByteString value)
         The canonical service name of the peer.
         It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
         <config_http_conn_man_headers_downstream-service-cluster>`
         If a more trusted source of the service name is available through mTLS/secure naming, it
         should be used.
         
        string service = 2;
        Parameters:
        value - The bytes for service to set.
        Returns:
        This builder for chaining.
      • getLabelsCount

        public int getLabelsCount()
        Description copied from interface: AttributeContext.PeerOrBuilder
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
        Specified by:
        getLabelsCount in interface AttributeContext.PeerOrBuilder
      • containsLabels

        public boolean containsLabels​(String key)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
        Specified by:
        containsLabels in interface AttributeContext.PeerOrBuilder
      • getLabelsMap

        public Map<String,​String> getLabelsMap()
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
        Specified by:
        getLabelsMap in interface AttributeContext.PeerOrBuilder
      • getLabelsOrDefault

        public String getLabelsOrDefault​(String key,
                                         String defaultValue)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
        Specified by:
        getLabelsOrDefault in interface AttributeContext.PeerOrBuilder
      • getLabelsOrThrow

        public String getLabelsOrThrow​(String key)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
        Specified by:
        getLabelsOrThrow in interface AttributeContext.PeerOrBuilder
      • removeLabels

        public AttributeContext.Peer.Builder removeLabels​(String key)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
      • getMutableLabels

        @Deprecated
        public Map<String,​String> getMutableLabels()
        Deprecated.
        Use alternate mutation accessors instead.
      • putLabels

        public AttributeContext.Peer.Builder putLabels​(String key,
                                                       String value)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
      • putAllLabels

        public AttributeContext.Peer.Builder putAllLabels​(Map<String,​String> values)
         The labels associated with the peer.
         These could be pod labels for Kubernetes or tags for VMs.
         The source of the labels could be an X.509 certificate or other configuration.
         
        map<string, string> labels = 3;
      • getPrincipal

        public String getPrincipal()
         The authenticated identity of this peer.
         For example, the identity associated with the workload such as a service account.
         If an X.509 certificate is used to assert the identity this field should be sourced from
         `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
         The primary identity should be the principal. The principal format is issuer specific.
         Example:
         *    SPIFFE format is `spiffe://trust-domain/path`
         *    Google account format is `https://accounts.google.com/{userid}`
         
        string principal = 4;
        Specified by:
        getPrincipal in interface AttributeContext.PeerOrBuilder
        Returns:
        The principal.
      • getPrincipalBytes

        public com.google.protobuf.ByteString getPrincipalBytes()
         The authenticated identity of this peer.
         For example, the identity associated with the workload such as a service account.
         If an X.509 certificate is used to assert the identity this field should be sourced from
         `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
         The primary identity should be the principal. The principal format is issuer specific.
         Example:
         *    SPIFFE format is `spiffe://trust-domain/path`
         *    Google account format is `https://accounts.google.com/{userid}`
         
        string principal = 4;
        Specified by:
        getPrincipalBytes in interface AttributeContext.PeerOrBuilder
        Returns:
        The bytes for principal.
      • setPrincipal

        public AttributeContext.Peer.Builder setPrincipal​(String value)
         The authenticated identity of this peer.
         For example, the identity associated with the workload such as a service account.
         If an X.509 certificate is used to assert the identity this field should be sourced from
         `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
         The primary identity should be the principal. The principal format is issuer specific.
         Example:
         *    SPIFFE format is `spiffe://trust-domain/path`
         *    Google account format is `https://accounts.google.com/{userid}`
         
        string principal = 4;
        Parameters:
        value - The principal to set.
        Returns:
        This builder for chaining.
      • clearPrincipal

        public AttributeContext.Peer.Builder clearPrincipal()
         The authenticated identity of this peer.
         For example, the identity associated with the workload such as a service account.
         If an X.509 certificate is used to assert the identity this field should be sourced from
         `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
         The primary identity should be the principal. The principal format is issuer specific.
         Example:
         *    SPIFFE format is `spiffe://trust-domain/path`
         *    Google account format is `https://accounts.google.com/{userid}`
         
        string principal = 4;
        Returns:
        This builder for chaining.
      • setPrincipalBytes

        public AttributeContext.Peer.Builder setPrincipalBytes​(com.google.protobuf.ByteString value)
         The authenticated identity of this peer.
         For example, the identity associated with the workload such as a service account.
         If an X.509 certificate is used to assert the identity this field should be sourced from
         `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
         The primary identity should be the principal. The principal format is issuer specific.
         Example:
         *    SPIFFE format is `spiffe://trust-domain/path`
         *    Google account format is `https://accounts.google.com/{userid}`
         
        string principal = 4;
        Parameters:
        value - The bytes for principal to set.
        Returns:
        This builder for chaining.
      • getCertificate

        public String getCertificate()
         The X.509 certificate used to authenticate the identify of this peer.
         When present, the certificate contents are encoded in URL and PEM format.
         
        string certificate = 5;
        Specified by:
        getCertificate in interface AttributeContext.PeerOrBuilder
        Returns:
        The certificate.
      • getCertificateBytes

        public com.google.protobuf.ByteString getCertificateBytes()
         The X.509 certificate used to authenticate the identify of this peer.
         When present, the certificate contents are encoded in URL and PEM format.
         
        string certificate = 5;
        Specified by:
        getCertificateBytes in interface AttributeContext.PeerOrBuilder
        Returns:
        The bytes for certificate.
      • setCertificate

        public AttributeContext.Peer.Builder setCertificate​(String value)
         The X.509 certificate used to authenticate the identify of this peer.
         When present, the certificate contents are encoded in URL and PEM format.
         
        string certificate = 5;
        Parameters:
        value - The certificate to set.
        Returns:
        This builder for chaining.
      • clearCertificate

        public AttributeContext.Peer.Builder clearCertificate()
         The X.509 certificate used to authenticate the identify of this peer.
         When present, the certificate contents are encoded in URL and PEM format.
         
        string certificate = 5;
        Returns:
        This builder for chaining.
      • setCertificateBytes

        public AttributeContext.Peer.Builder setCertificateBytes​(com.google.protobuf.ByteString value)
         The X.509 certificate used to authenticate the identify of this peer.
         When present, the certificate contents are encoded in URL and PEM format.
         
        string certificate = 5;
        Parameters:
        value - The bytes for certificate to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final AttributeContext.Peer.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<AttributeContext.Peer.Builder>
      • mergeUnknownFields

        public final AttributeContext.Peer.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<AttributeContext.Peer.Builder>