java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.envoyproxy.envoy.extensions.http.custom_response.redirect_policy.v3.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:
  • Field Details

    • URI_FIELD_NUMBER

      public static final int URI_FIELD_NUMBER
      See Also:
    • REDIRECT_ACTION_FIELD_NUMBER

      public static final int REDIRECT_ACTION_FIELD_NUMBER
      See Also:
    • STATUS_CODE_FIELD_NUMBER

      public static final int STATUS_CODE_FIELD_NUMBER
      See Also:
    • RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER

      public static final int RESPONSE_HEADERS_TO_ADD_FIELD_NUMBER
      See Also:
    • REQUEST_HEADERS_TO_ADD_FIELD_NUMBER

      public static final int REQUEST_HEADERS_TO_ADD_FIELD_NUMBER
      See Also:
    • MODIFY_REQUEST_HEADERS_ACTION_FIELD_NUMBER

      public static final int MODIFY_REQUEST_HEADERS_ACTION_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance 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
    • getRedirectActionSpecifierCase

      public RedirectPolicy.RedirectActionSpecifierCase getRedirectActionSpecifierCase()
      Specified by:
      getRedirectActionSpecifierCase in interface RedirectPolicyOrBuilder
    • 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
    • getRequestHeadersToAddList

      public List<HeaderValueOption> getRequestHeadersToAddList()
       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:
      getRequestHeadersToAddList in interface RedirectPolicyOrBuilder
    • getRequestHeadersToAddOrBuilderList

      public List<? extends HeaderValueOptionOrBuilder> getRequestHeadersToAddOrBuilderList()
       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:
      getRequestHeadersToAddOrBuilderList 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
    • getRequestHeadersToAddOrBuilder

      public HeaderValueOptionOrBuilder getRequestHeadersToAddOrBuilder(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:
      getRequestHeadersToAddOrBuilder 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.
    • getModifyRequestHeadersActionOrBuilder

      public TypedExtensionConfigOrBuilder getModifyRequestHeadersActionOrBuilder()
       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:
      getModifyRequestHeadersActionOrBuilder in interface RedirectPolicyOrBuilder
    • 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(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static RedirectPolicy parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static RedirectPolicy parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static RedirectPolicy parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static RedirectPolicy parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • 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
    • newBuilder

      public static RedirectPolicy.Builder newBuilder()
    • newBuilder

      public static RedirectPolicy.Builder newBuilder(RedirectPolicy prototype)
    • 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