Class RedirectPolicy

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, RedirectPolicyOrBuilder, Serializable

    public final class RedirectPolicy
    extends com.google.protobuf.GeneratedMessageV3
    implements RedirectPolicyOrBuilder
     Custom response policy to internally redirect the original response to a different
     upstream.
     [#next-free-field: 7]
     
    Protobuf type envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy
    See Also:
    Serialized Form
    • Field Detail

      • REDIRECT_ACTION_FIELD_NUMBER

        public static final int REDIRECT_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • STATUS_CODE_FIELD_NUMBER

        public static final int STATUS_CODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER

        public static final int RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REQUEST_HEADERS_TO_ADD_FIELD_NUMBER

        public static final int REQUEST_HEADERS_TO_ADD_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MODIFY_REQUEST_HEADERS_ACTION_FIELD_NUMBER

        public static final int MODIFY_REQUEST_HEADERS_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • 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
      • hasUri

        public boolean hasUri()
         The Http URI to redirect the original request to, to get the custom
         response.
         It should be a full FQDN with protocol, host and path.
         Example:
         .. code-block:: yaml
            uri: https://www.mydomain.com/path/to/404.txt
         
        string uri = 1 [(.validate.rules) = { ... }
        Specified by:
        hasUri in interface RedirectPolicyOrBuilder
        Returns:
        Whether the uri field is set.
      • getUri

        public String getUri()
         The Http URI to redirect the original request to, to get the custom
         response.
         It should be a full FQDN with protocol, host and path.
         Example:
         .. code-block:: yaml
            uri: https://www.mydomain.com/path/to/404.txt
         
        string uri = 1 [(.validate.rules) = { ... }
        Specified by:
        getUri in interface RedirectPolicyOrBuilder
        Returns:
        The uri.
      • getUriBytes

        public com.google.protobuf.ByteString getUriBytes()
         The Http URI to redirect the original request to, to get the custom
         response.
         It should be a full FQDN with protocol, host and path.
         Example:
         .. code-block:: yaml
            uri: https://www.mydomain.com/path/to/404.txt
         
        string uri = 1 [(.validate.rules) = { ... }
        Specified by:
        getUriBytes in interface RedirectPolicyOrBuilder
        Returns:
        The bytes for uri.
      • hasRedirectAction

        public boolean hasRedirectAction()
         Specify elements of the redirect url individually.
         Note: Do not specify the ``response_code`` field in ``redirect_action``, use
         ``status_code`` instead.
         The following fields in ``redirect_action`` are currently not supported,
         and specifying them will cause the config to be rejected:
         - ``prefix_rewrite``
         - ``regex_rewrite``
         
        .envoy.config.route.v3.RedirectAction redirect_action = 2;
        Specified by:
        hasRedirectAction in interface RedirectPolicyOrBuilder
        Returns:
        Whether the redirectAction field is set.
      • getRedirectAction

        public RedirectAction getRedirectAction()
         Specify elements of the redirect url individually.
         Note: Do not specify the ``response_code`` field in ``redirect_action``, use
         ``status_code`` instead.
         The following fields in ``redirect_action`` are currently not supported,
         and specifying them will cause the config to be rejected:
         - ``prefix_rewrite``
         - ``regex_rewrite``
         
        .envoy.config.route.v3.RedirectAction redirect_action = 2;
        Specified by:
        getRedirectAction in interface RedirectPolicyOrBuilder
        Returns:
        The redirectAction.
      • getRedirectActionOrBuilder

        public RedirectActionOrBuilder getRedirectActionOrBuilder()
         Specify elements of the redirect url individually.
         Note: Do not specify the ``response_code`` field in ``redirect_action``, use
         ``status_code`` instead.
         The following fields in ``redirect_action`` are currently not supported,
         and specifying them will cause the config to be rejected:
         - ``prefix_rewrite``
         - ``regex_rewrite``
         
        .envoy.config.route.v3.RedirectAction redirect_action = 2;
        Specified by:
        getRedirectActionOrBuilder in interface RedirectPolicyOrBuilder
      • hasStatusCode

        public boolean hasStatusCode()
         The new response status code if specified. This is used to override the
         status code of the response from the new upstream if it is not an error status.
         
        .google.protobuf.UInt32Value status_code = 3 [(.validate.rules) = { ... }
        Specified by:
        hasStatusCode in interface RedirectPolicyOrBuilder
        Returns:
        Whether the statusCode field is set.
      • getStatusCode

        public com.google.protobuf.UInt32Value getStatusCode()
         The new response status code if specified. This is used to override the
         status code of the response from the new upstream if it is not an error status.
         
        .google.protobuf.UInt32Value status_code = 3 [(.validate.rules) = { ... }
        Specified by:
        getStatusCode in interface RedirectPolicyOrBuilder
        Returns:
        The statusCode.
      • getStatusCodeOrBuilder

        public com.google.protobuf.UInt32ValueOrBuilder getStatusCodeOrBuilder()
         The new response status code if specified. This is used to override the
         status code of the response from the new upstream if it is not an error status.
         
        .google.protobuf.UInt32Value status_code = 3 [(.validate.rules) = { ... }
        Specified by:
        getStatusCodeOrBuilder in interface RedirectPolicyOrBuilder
      • getResponseHeadersToAddList

        public List<HeaderValueOption> getResponseHeadersToAddList()
         HTTP headers to add to the response. This allows the
         response policy to append, to add or to override headers of
         the original response for local body, or the custom response from the
         remote body, before it is sent to a downstream client.
         Note that these are not applied if the redirected response is an error
         response.
         
        repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 4 [(.validate.rules) = { ... }
        Specified by:
        getResponseHeadersToAddList in interface RedirectPolicyOrBuilder
      • getResponseHeadersToAddOrBuilderList

        public List<? extends HeaderValueOptionOrBuilder> getResponseHeadersToAddOrBuilderList()
         HTTP headers to add to the response. This allows the
         response policy to append, to add or to override headers of
         the original response for local body, or the custom response from the
         remote body, before it is sent to a downstream client.
         Note that these are not applied if the redirected response is an error
         response.
         
        repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 4 [(.validate.rules) = { ... }
        Specified by:
        getResponseHeadersToAddOrBuilderList in interface RedirectPolicyOrBuilder
      • getResponseHeadersToAddCount

        public int getResponseHeadersToAddCount()
         HTTP headers to add to the response. This allows the
         response policy to append, to add or to override headers of
         the original response for local body, or the custom response from the
         remote body, before it is sent to a downstream client.
         Note that these are not applied if the redirected response is an error
         response.
         
        repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 4 [(.validate.rules) = { ... }
        Specified by:
        getResponseHeadersToAddCount in interface RedirectPolicyOrBuilder
      • getResponseHeadersToAdd

        public HeaderValueOption getResponseHeadersToAdd​(int index)
         HTTP headers to add to the response. This allows the
         response policy to append, to add or to override headers of
         the original response for local body, or the custom response from the
         remote body, before it is sent to a downstream client.
         Note that these are not applied if the redirected response is an error
         response.
         
        repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 4 [(.validate.rules) = { ... }
        Specified by:
        getResponseHeadersToAdd in interface RedirectPolicyOrBuilder
      • getResponseHeadersToAddOrBuilder

        public HeaderValueOptionOrBuilder getResponseHeadersToAddOrBuilder​(int index)
         HTTP headers to add to the response. This allows the
         response policy to append, to add or to override headers of
         the original response for local body, or the custom response from the
         remote body, before it is sent to a downstream client.
         Note that these are not applied if the redirected response is an error
         response.
         
        repeated .envoy.config.core.v3.HeaderValueOption response_headers_to_add = 4 [(.validate.rules) = { ... }
        Specified by:
        getResponseHeadersToAddOrBuilder in interface RedirectPolicyOrBuilder
      • getRequestHeadersToAddCount

        public int getRequestHeadersToAddCount()
         HTTP headers to add to the request before it is internally redirected.
         
        repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add = 5 [(.validate.rules) = { ... }
        Specified by:
        getRequestHeadersToAddCount in interface RedirectPolicyOrBuilder
      • getRequestHeadersToAdd

        public HeaderValueOption getRequestHeadersToAdd​(int index)
         HTTP headers to add to the request before it is internally redirected.
         
        repeated .envoy.config.core.v3.HeaderValueOption request_headers_to_add = 5 [(.validate.rules) = { ... }
        Specified by:
        getRequestHeadersToAdd in interface RedirectPolicyOrBuilder
      • hasModifyRequestHeadersAction

        public boolean hasModifyRequestHeadersAction()
         Custom action to modify request headers before selection of the
         redirected route.
         [#comment: TODO(pradeepcrao) add an extension category.]
         
        .envoy.config.core.v3.TypedExtensionConfig modify_request_headers_action = 6;
        Specified by:
        hasModifyRequestHeadersAction in interface RedirectPolicyOrBuilder
        Returns:
        Whether the modifyRequestHeadersAction field is set.
      • getModifyRequestHeadersAction

        public TypedExtensionConfig getModifyRequestHeadersAction()
         Custom action to modify request headers before selection of the
         redirected route.
         [#comment: TODO(pradeepcrao) add an extension category.]
         
        .envoy.config.core.v3.TypedExtensionConfig modify_request_headers_action = 6;
        Specified by:
        getModifyRequestHeadersAction in interface RedirectPolicyOrBuilder
        Returns:
        The modifyRequestHeadersAction.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static RedirectPolicy parseFrom​(ByteBuffer data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(ByteBuffer data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(com.google.protobuf.ByteString data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(com.google.protobuf.ByteString data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(byte[] data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(byte[] data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RedirectPolicy parseFrom​(com.google.protobuf.CodedInputStream input,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws IOException
        Throws:
        IOException
      • newBuilderForType

        public RedirectPolicy.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public RedirectPolicy.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected RedirectPolicy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static RedirectPolicy getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<RedirectPolicy> parser()
      • getParserForType

        public com.google.protobuf.Parser<RedirectPolicy> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public RedirectPolicy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder