Class XdsResourceType<T extends XdsClient.ResourceUpdate>

    • Field Detail

      • TRANSPORT_SOCKET_NAME_TLS

        protected static final java.lang.String TRANSPORT_SOCKET_NAME_TLS
        See Also:
        Constant Field Values
      • HASH_POLICY_FILTER_STATE_KEY

        public static final java.lang.String HASH_POLICY_FILTER_STATE_KEY
        See Also:
        Constant Field Values
      • TYPE_URL_CLUSTER_CONFIG

        protected static final java.lang.String TYPE_URL_CLUSTER_CONFIG
        See Also:
        Constant Field Values
      • TYPE_URL_TYPED_STRUCT_UDPA

        protected static final java.lang.String TYPE_URL_TYPED_STRUCT_UDPA
        See Also:
        Constant Field Values
      • TYPE_URL_TYPED_STRUCT

        protected static final java.lang.String TYPE_URL_TYPED_STRUCT
        See Also:
        Constant Field Values
    • Constructor Detail

      • XdsResourceType

        public XdsResourceType()
    • Method Detail

      • extractResourceName

        @Nullable
        protected java.lang.String extractResourceName​(com.google.protobuf.Message unpackedResource)
        Extract the resource name from an older resource type that included the name within the resource contents itself. The newer approach has resources wrapped with envoy.service.discovery.v3.Resource which then provides the name. This method is only called for the old approach.
        Returns:
        the resource's name, or null if name is not stored within the resource contents
      • unpackedClassName

        protected abstract java.lang.Class<? extends com.google.protobuf.Message> unpackedClassName()
      • typeName

        public abstract java.lang.String typeName()
      • typeUrl

        public abstract java.lang.String typeUrl()
      • shouldRetrieveResourceKeysForArgs

        public abstract boolean shouldRetrieveResourceKeysForArgs()
      • isFullStateOfTheWorld

        protected abstract boolean isFullStateOfTheWorld()
      • unpackCompatibleType

        protected static <T extends com.google.protobuf.Message> T unpackCompatibleType​(com.google.protobuf.Any any,
                                                                                        java.lang.Class<T> clazz,
                                                                                        java.lang.String typeUrl,
                                                                                        java.lang.String compatibleTypeUrl)
                                                                                 throws com.google.protobuf.InvalidProtocolBufferException
        Helper method to unpack serialized Any message, while replacing Type URL compatibleTypeUrl with typeUrl.
        Type Parameters:
        T - The type of unpacked message
        Parameters:
        any - serialized message to unpack
        clazz - the class to unpack the message to
        typeUrl - type URL to replace message Type URL, when it's compatible
        compatibleTypeUrl - compatible Type URL to be replaced with typeUrl
        Returns:
        Unpacked message
        Throws:
        com.google.protobuf.InvalidProtocolBufferException - if the message couldn't be unpacked