com.amazonaws.services.cloudfront.model
Class CustomErrorResponse

java.lang.Object
  extended by com.amazonaws.services.cloudfront.model.CustomErrorResponse
All Implemented Interfaces:
Serializable

public class CustomErrorResponse
extends Object
implements Serializable

A complex type that describes how you'd prefer CloudFront to respond to requests that result in either a 4xx or 5xx response. You can control whether a custom error page should be displayed, what the desired response code should be for this error page and how long should the error response be cached by CloudFront. If you don't want to specify any custom error responses, include only an empty CustomErrorResponses element. To delete all custom error responses in an existing distribution, update the distribution configuration and include only an empty CustomErrorResponses element. To add, change, or remove one or more custom error responses, update the distribution configuration and specify all of the custom error responses that you want to include in the updated distribution.

See Also:
Serialized Form

Constructor Summary
CustomErrorResponse()
           
 
Method Summary
 boolean equals(Object obj)
           
 Long getErrorCachingMinTTL()
          The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
 Integer getErrorCode()
          The 4xx or 5xx HTTP status code that you want to customize.
 String getResponseCode()
          The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
 String getResponsePagePath()
          The path of the custom error page (for example, /custom_404.html).
 int hashCode()
           
 void setErrorCachingMinTTL(Long errorCachingMinTTL)
          The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
 void setErrorCode(Integer errorCode)
          The 4xx or 5xx HTTP status code that you want to customize.
 void setResponseCode(String responseCode)
          The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
 void setResponsePagePath(String responsePagePath)
          The path of the custom error page (for example, /custom_404.html).
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CustomErrorResponse withErrorCachingMinTTL(Long errorCachingMinTTL)
          The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
 CustomErrorResponse withErrorCode(Integer errorCode)
          The 4xx or 5xx HTTP status code that you want to customize.
 CustomErrorResponse withResponseCode(String responseCode)
          The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
 CustomErrorResponse withResponsePagePath(String responsePagePath)
          The path of the custom error page (for example, /custom_404.html).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomErrorResponse

public CustomErrorResponse()
Method Detail

getErrorCode

public Integer getErrorCode()
The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.

Returns:
The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.

setErrorCode

public void setErrorCode(Integer errorCode)
The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.

Parameters:
errorCode - The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.

withErrorCode

public CustomErrorResponse withErrorCode(Integer errorCode)
The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
errorCode - The 4xx or 5xx HTTP status code that you want to customize. For a list of HTTP status codes that you can customize, see CloudFront documentation.
Returns:
A reference to this updated object so that method calls can be chained together.

getResponsePagePath

public String getResponsePagePath()
The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.

Returns:
The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.

setResponsePagePath

public void setResponsePagePath(String responsePagePath)
The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.

Parameters:
responsePagePath - The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.

withResponsePagePath

public CustomErrorResponse withResponsePagePath(String responsePagePath)
The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.

Returns a reference to this object so that method calls can be chained together.

Parameters:
responsePagePath - The path of the custom error page (for example, /custom_404.html). The path is relative to the distribution and must begin with a slash (/). If the path includes any non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not return the custom error page to the viewer.
Returns:
A reference to this updated object so that method calls can be chained together.

getResponseCode

public String getResponseCode()
The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.

Returns:
The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.

setResponseCode

public void setResponseCode(String responseCode)
The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.

Parameters:
responseCode - The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.

withResponseCode

public CustomErrorResponse withResponseCode(String responseCode)
The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
responseCode - The HTTP status code that you want CloudFront to return with the custom error page to the viewer. For a list of HTTP status codes that you can replace, see CloudFront Documentation.
Returns:
A reference to this updated object so that method calls can be chained together.

getErrorCachingMinTTL

public Long getErrorCachingMinTTL()
The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.

Returns:
The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.

setErrorCachingMinTTL

public void setErrorCachingMinTTL(Long errorCachingMinTTL)
The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.

Parameters:
errorCachingMinTTL - The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.

withErrorCachingMinTTL

public CustomErrorResponse withErrorCachingMinTTL(Long errorCachingMinTTL)
The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.

Returns a reference to this object so that method calls can be chained together.

Parameters:
errorCachingMinTTL - The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. You can specify a value from 0 to 31,536,000.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2016. All rights reserved.