All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.cloudfront.model.DefaultCacheBehavior Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon CloudFront module holds the client classes that are used for communicating with Amazon CloudFront Service

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.cloudfront.model;

import java.io.Serializable;

/**
 * 

* A complex type that describes the default cache behavior if you do not specify a CacheBehavior element * or if files don't match any of the values of PathPattern in CacheBehavior elements. You * must create exactly one default cache behavior. *

*/ public class DefaultCacheBehavior implements Serializable, Cloneable { /** *

* The value of ID for the origin that you want CloudFront to route requests to when a request matches * the path pattern either for a cache behavior or for the default cache behavior. *

*/ private String targetOriginId; /** *

* A complex type that specifies how CloudFront handles query strings and cookies. *

*/ private ForwardedValues forwardedValues; /** *

* A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private * content. *

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and specify * the applicable values for Quantity and Items. For more information, see Serving Private * Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, specify * false for Enabled and 0 for Quantity. Omit Items * . *

*

* To add, change, or remove one or more trusted signers, change Enabled to true (if it's * currently false), change Quantity as applicable, and specify all of the trusted signers * that you want to include in the updated distribution. *

*/ private TrustedSigners trustedSigners; /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
*/ private String viewerProtocolPolicy; /** *

* The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer * Guide. *

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers to * your origin (under Headers, if you specify 1 for Quantity and * * for Name). *

*/ private Long minTTL; private AllowedMethods allowedMethods; /** *

* Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin * that is associated with this cache behavior. If so, specify true; if not, specify false * . If you specify true for SmoothStreaming, you can still distribute other content using * this cache behavior if the content matches the value of PathPattern. *

*/ private Boolean smoothStreaming; /** *

* The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. The value that you specify applies only * when your origin does not add HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*/ private Long defaultTTL; private Long maxTTL; /** *

* Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify * true; if not, specify false. For more information, see Serving * Compressed Files in the Amazon CloudFront Developer Guide. *

*/ private Boolean compress; /** *

* A complex type that contains zero or more Lambda function associations for a cache behavior. *

*/ private LambdaFunctionAssociations lambdaFunctionAssociations; /** *

* The value of ID for the origin that you want CloudFront to route requests to when a request matches * the path pattern either for a cache behavior or for the default cache behavior. *

* * @param targetOriginId * The value of ID for the origin that you want CloudFront to route requests to when a request * matches the path pattern either for a cache behavior or for the default cache behavior. */ public void setTargetOriginId(String targetOriginId) { this.targetOriginId = targetOriginId; } /** *

* The value of ID for the origin that you want CloudFront to route requests to when a request matches * the path pattern either for a cache behavior or for the default cache behavior. *

* * @return The value of ID for the origin that you want CloudFront to route requests to when a request * matches the path pattern either for a cache behavior or for the default cache behavior. */ public String getTargetOriginId() { return this.targetOriginId; } /** *

* The value of ID for the origin that you want CloudFront to route requests to when a request matches * the path pattern either for a cache behavior or for the default cache behavior. *

* * @param targetOriginId * The value of ID for the origin that you want CloudFront to route requests to when a request * matches the path pattern either for a cache behavior or for the default cache behavior. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withTargetOriginId(String targetOriginId) { setTargetOriginId(targetOriginId); return this; } /** *

* A complex type that specifies how CloudFront handles query strings and cookies. *

* * @param forwardedValues * A complex type that specifies how CloudFront handles query strings and cookies. */ public void setForwardedValues(ForwardedValues forwardedValues) { this.forwardedValues = forwardedValues; } /** *

* A complex type that specifies how CloudFront handles query strings and cookies. *

* * @return A complex type that specifies how CloudFront handles query strings and cookies. */ public ForwardedValues getForwardedValues() { return this.forwardedValues; } /** *

* A complex type that specifies how CloudFront handles query strings and cookies. *

* * @param forwardedValues * A complex type that specifies how CloudFront handles query strings and cookies. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withForwardedValues(ForwardedValues forwardedValues) { setForwardedValues(forwardedValues); return this; } /** *

* A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private * content. *

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and specify * the applicable values for Quantity and Items. For more information, see Serving Private * Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, specify * false for Enabled and 0 for Quantity. Omit Items * . *

*

* To add, change, or remove one or more trusted signers, change Enabled to true (if it's * currently false), change Quantity as applicable, and specify all of the trusted signers * that you want to include in the updated distribution. *

* * @param trustedSigners * A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for * private content.

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and * specify the applicable values for Quantity and Items. For more information, see * Serving * Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, * specify false for Enabled and 0 for Quantity. Omit * Items. *

*

* To add, change, or remove one or more trusted signers, change Enabled to true * (if it's currently false), change Quantity as applicable, and specify all of the * trusted signers that you want to include in the updated distribution. */ public void setTrustedSigners(TrustedSigners trustedSigners) { this.trustedSigners = trustedSigners; } /** *

* A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private * content. *

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and specify * the applicable values for Quantity and Items. For more information, see Serving Private * Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, specify * false for Enabled and 0 for Quantity. Omit Items * . *

*

* To add, change, or remove one or more trusted signers, change Enabled to true (if it's * currently false), change Quantity as applicable, and specify all of the trusted signers * that you want to include in the updated distribution. *

* * @return A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for * private content.

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and * specify the applicable values for Quantity and Items. For more information, see * Serving * Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, * specify false for Enabled and 0 for Quantity. Omit * Items. *

*

* To add, change, or remove one or more trusted signers, change Enabled to true * (if it's currently false), change Quantity as applicable, and specify all of * the trusted signers that you want to include in the updated distribution. */ public TrustedSigners getTrustedSigners() { return this.trustedSigners; } /** *

* A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private * content. *

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and specify * the applicable values for Quantity and Items. For more information, see Serving Private * Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, specify * false for Enabled and 0 for Quantity. Omit Items * . *

*

* To add, change, or remove one or more trusted signers, change Enabled to true (if it's * currently false), change Quantity as applicable, and specify all of the trusted signers * that you want to include in the updated distribution. *

* * @param trustedSigners * A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for * private content.

*

* If you want to require signed URLs in requests for objects in the target origin that match the * PathPattern for this cache behavior, specify true for Enabled, and * specify the applicable values for Quantity and Items. For more information, see * Serving * Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide. *

*

* If you don't want to require signed URLs in requests for objects that match PathPattern, * specify false for Enabled and 0 for Quantity. Omit * Items. *

*

* To add, change, or remove one or more trusted signers, change Enabled to true * (if it's currently false), change Quantity as applicable, and specify all of the * trusted signers that you want to include in the updated distribution. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withTrustedSigners(TrustedSigners trustedSigners) { setTrustedSigners(trustedSigners); return this; } /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
* * @param viewerProtocolPolicy * The protocol that viewers can use to access the files in the origin specified by * TargetOriginId when a request matches the path pattern in PathPattern. You can * specify the following options:

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status * code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the * request using the new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an * HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is * never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we * recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that * an edge location will return an object from the cache regardless of whether the current request protocol * matches the protocol used previously. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. *

* @see ViewerProtocolPolicy */ public void setViewerProtocolPolicy(String viewerProtocolPolicy) { this.viewerProtocolPolicy = viewerProtocolPolicy; } /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
* * @return The protocol that viewers can use to access the files in the origin specified by * TargetOriginId when a request matches the path pattern in PathPattern. You can * specify the following options:

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status * code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the * request using the new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an * HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is * never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we * recommend that you clear your objects' cache because cached objects are protocol agnostic. That means * that an edge location will return an object from the cache regardless of whether the current request * protocol matches the protocol used previously. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. *

* @see ViewerProtocolPolicy */ public String getViewerProtocolPolicy() { return this.viewerProtocolPolicy; } /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
* * @param viewerProtocolPolicy * The protocol that viewers can use to access the files in the origin specified by * TargetOriginId when a request matches the path pattern in PathPattern. You can * specify the following options:

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status * code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the * request using the new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an * HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is * never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we * recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that * an edge location will return an object from the cache regardless of whether the current request protocol * matches the protocol used previously. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. *

* @return Returns a reference to this object so that method calls can be chained together. * @see ViewerProtocolPolicy */ public DefaultCacheBehavior withViewerProtocolPolicy(String viewerProtocolPolicy) { setViewerProtocolPolicy(viewerProtocolPolicy); return this; } /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
* * @param viewerProtocolPolicy * The protocol that viewers can use to access the files in the origin specified by * TargetOriginId when a request matches the path pattern in PathPattern. You can * specify the following options:

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status * code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the * request using the new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an * HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is * never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we * recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that * an edge location will return an object from the cache regardless of whether the current request protocol * matches the protocol used previously. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. *

* @see ViewerProtocolPolicy */ public void setViewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy) { this.viewerProtocolPolicy = viewerProtocolPolicy.toString(); } /** *

* The protocol that viewers can use to access the files in the origin specified by TargetOriginId when * a request matches the path pattern in PathPattern. You can specify the following options: *

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of * 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the * new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an HTTPS * Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never * to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that * you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will * return an object from the cache regardless of whether the current request protocol matches the protocol used * previously. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

*
* * @param viewerProtocolPolicy * The protocol that viewers can use to access the files in the origin specified by * TargetOriginId when a request matches the path pattern in PathPattern. You can * specify the following options:

*
    *
  • *

    * allow-all: Viewers can use HTTP or HTTPS. *

    *
  • *
  • *

    * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns an HTTP status * code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the * request using the new URL. *

    *
  • *
  • *

    * https-only: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 * (Forbidden). *

    *
  • *
*

* For more information about requiring the HTTPS protocol, see Using an * HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide. *

* *

* The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is * never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we * recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that * an edge location will return an object from the cache regardless of whether the current request protocol * matches the protocol used previously. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. *

* @return Returns a reference to this object so that method calls can be chained together. * @see ViewerProtocolPolicy */ public DefaultCacheBehavior withViewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy) { setViewerProtocolPolicy(viewerProtocolPolicy); return this; } /** *

* The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer * Guide. *

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers to * your origin (under Headers, if you specify 1 for Quantity and * * for Name). *

* * @param minTTL * The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. For more information, see * Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon * CloudFront Developer Guide.

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers * to your origin (under Headers, if you specify 1 for Quantity and * * for Name). */ public void setMinTTL(Long minTTL) { this.minTTL = minTTL; } /** *

* The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer * Guide. *

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers to * your origin (under Headers, if you specify 1 for Quantity and * * for Name). *

* * @return The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. For more information, * see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon * CloudFront Developer Guide.

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all * headers to your origin (under Headers, if you specify 1 for * Quantity and * for Name). */ public Long getMinTTL() { return this.minTTL; } /** *

* The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer * Guide. *

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers to * your origin (under Headers, if you specify 1 for Quantity and * * for Name). *

* * @param minTTL * The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. For more information, see * Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon * CloudFront Developer Guide.

*

* You must specify 0 for MinTTL if you configure CloudFront to forward all headers * to your origin (under Headers, if you specify 1 for Quantity and * * for Name). * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withMinTTL(Long minTTL) { setMinTTL(minTTL); return this; } /** * @param allowedMethods */ public void setAllowedMethods(AllowedMethods allowedMethods) { this.allowedMethods = allowedMethods; } /** * @return */ public AllowedMethods getAllowedMethods() { return this.allowedMethods; } /** * @param allowedMethods * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withAllowedMethods(AllowedMethods allowedMethods) { setAllowedMethods(allowedMethods); return this; } /** *

* Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin * that is associated with this cache behavior. If so, specify true; if not, specify false * . If you specify true for SmoothStreaming, you can still distribute other content using * this cache behavior if the content matches the value of PathPattern. *

* * @param smoothStreaming * Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the * origin that is associated with this cache behavior. If so, specify true; if not, specify * false. If you specify true for SmoothStreaming, you can still * distribute other content using this cache behavior if the content matches the value of * PathPattern. */ public void setSmoothStreaming(Boolean smoothStreaming) { this.smoothStreaming = smoothStreaming; } /** *

* Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin * that is associated with this cache behavior. If so, specify true; if not, specify false * . If you specify true for SmoothStreaming, you can still distribute other content using * this cache behavior if the content matches the value of PathPattern. *

* * @return Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the * origin that is associated with this cache behavior. If so, specify true; if not, specify * false. If you specify true for SmoothStreaming, you can still * distribute other content using this cache behavior if the content matches the value of * PathPattern. */ public Boolean getSmoothStreaming() { return this.smoothStreaming; } /** *

* Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin * that is associated with this cache behavior. If so, specify true; if not, specify false * . If you specify true for SmoothStreaming, you can still distribute other content using * this cache behavior if the content matches the value of PathPattern. *

* * @param smoothStreaming * Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the * origin that is associated with this cache behavior. If so, specify true; if not, specify * false. If you specify true for SmoothStreaming, you can still * distribute other content using this cache behavior if the content matches the value of * PathPattern. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withSmoothStreaming(Boolean smoothStreaming) { setSmoothStreaming(smoothStreaming); return this; } /** *

* Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin * that is associated with this cache behavior. If so, specify true; if not, specify false * . If you specify true for SmoothStreaming, you can still distribute other content using * this cache behavior if the content matches the value of PathPattern. *

* * @return Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the * origin that is associated with this cache behavior. If so, specify true; if not, specify * false. If you specify true for SmoothStreaming, you can still * distribute other content using this cache behavior if the content matches the value of * PathPattern. */ public Boolean isSmoothStreaming() { return this.smoothStreaming; } /** *

* The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. The value that you specify applies only * when your origin does not add HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

* * @param defaultTTL * The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. The value that you * specify applies only when your origin does not add HTTP headers such as Cache-Control max-age * , Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. */ public void setDefaultTTL(Long defaultTTL) { this.defaultTTL = defaultTTL; } /** *

* The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. The value that you specify applies only * when your origin does not add HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

* * @return The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. The value that you * specify applies only when your origin does not add HTTP headers such as * Cache-Control max-age, Cache-Control s-maxage, and Expires to * objects. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. */ public Long getDefaultTTL() { return this.defaultTTL; } /** *

* The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another * request to your origin to determine whether the object has been updated. The value that you specify applies only * when your origin does not add HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How Long * Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer * Guide. *

* * @param defaultTTL * The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards * another request to your origin to determine whether the object has been updated. The value that you * specify applies only when your origin does not add HTTP headers such as Cache-Control max-age * , Cache-Control s-maxage, and Expires to objects. For more information, see Specifying How * Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withDefaultTTL(Long defaultTTL) { setDefaultTTL(defaultTTL); return this; } /** * @param maxTTL */ public void setMaxTTL(Long maxTTL) { this.maxTTL = maxTTL; } /** * @return */ public Long getMaxTTL() { return this.maxTTL; } /** * @param maxTTL * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withMaxTTL(Long maxTTL) { setMaxTTL(maxTTL); return this; } /** *

* Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify * true; if not, specify false. For more information, see Serving * Compressed Files in the Amazon CloudFront Developer Guide. *

* * @param compress * Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, * specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide. */ public void setCompress(Boolean compress) { this.compress = compress; } /** *

* Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify * true; if not, specify false. For more information, see Serving * Compressed Files in the Amazon CloudFront Developer Guide. *

* * @return Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, * specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide. */ public Boolean getCompress() { return this.compress; } /** *

* Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify * true; if not, specify false. For more information, see Serving * Compressed Files in the Amazon CloudFront Developer Guide. *

* * @param compress * Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, * specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withCompress(Boolean compress) { setCompress(compress); return this; } /** *

* Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify * true; if not, specify false. For more information, see Serving * Compressed Files in the Amazon CloudFront Developer Guide. *

* * @return Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, * specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide. */ public Boolean isCompress() { return this.compress; } /** *

* A complex type that contains zero or more Lambda function associations for a cache behavior. *

* * @param lambdaFunctionAssociations * A complex type that contains zero or more Lambda function associations for a cache behavior. */ public void setLambdaFunctionAssociations(LambdaFunctionAssociations lambdaFunctionAssociations) { this.lambdaFunctionAssociations = lambdaFunctionAssociations; } /** *

* A complex type that contains zero or more Lambda function associations for a cache behavior. *

* * @return A complex type that contains zero or more Lambda function associations for a cache behavior. */ public LambdaFunctionAssociations getLambdaFunctionAssociations() { return this.lambdaFunctionAssociations; } /** *

* A complex type that contains zero or more Lambda function associations for a cache behavior. *

* * @param lambdaFunctionAssociations * A complex type that contains zero or more Lambda function associations for a cache behavior. * @return Returns a reference to this object so that method calls can be chained together. */ public DefaultCacheBehavior withLambdaFunctionAssociations(LambdaFunctionAssociations lambdaFunctionAssociations) { setLambdaFunctionAssociations(lambdaFunctionAssociations); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTargetOriginId() != null) sb.append("TargetOriginId: ").append(getTargetOriginId()).append(","); if (getForwardedValues() != null) sb.append("ForwardedValues: ").append(getForwardedValues()).append(","); if (getTrustedSigners() != null) sb.append("TrustedSigners: ").append(getTrustedSigners()).append(","); if (getViewerProtocolPolicy() != null) sb.append("ViewerProtocolPolicy: ").append(getViewerProtocolPolicy()).append(","); if (getMinTTL() != null) sb.append("MinTTL: ").append(getMinTTL()).append(","); if (getAllowedMethods() != null) sb.append("AllowedMethods: ").append(getAllowedMethods()).append(","); if (getSmoothStreaming() != null) sb.append("SmoothStreaming: ").append(getSmoothStreaming()).append(","); if (getDefaultTTL() != null) sb.append("DefaultTTL: ").append(getDefaultTTL()).append(","); if (getMaxTTL() != null) sb.append("MaxTTL: ").append(getMaxTTL()).append(","); if (getCompress() != null) sb.append("Compress: ").append(getCompress()).append(","); if (getLambdaFunctionAssociations() != null) sb.append("LambdaFunctionAssociations: ").append(getLambdaFunctionAssociations()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DefaultCacheBehavior == false) return false; DefaultCacheBehavior other = (DefaultCacheBehavior) obj; if (other.getTargetOriginId() == null ^ this.getTargetOriginId() == null) return false; if (other.getTargetOriginId() != null && other.getTargetOriginId().equals(this.getTargetOriginId()) == false) return false; if (other.getForwardedValues() == null ^ this.getForwardedValues() == null) return false; if (other.getForwardedValues() != null && other.getForwardedValues().equals(this.getForwardedValues()) == false) return false; if (other.getTrustedSigners() == null ^ this.getTrustedSigners() == null) return false; if (other.getTrustedSigners() != null && other.getTrustedSigners().equals(this.getTrustedSigners()) == false) return false; if (other.getViewerProtocolPolicy() == null ^ this.getViewerProtocolPolicy() == null) return false; if (other.getViewerProtocolPolicy() != null && other.getViewerProtocolPolicy().equals(this.getViewerProtocolPolicy()) == false) return false; if (other.getMinTTL() == null ^ this.getMinTTL() == null) return false; if (other.getMinTTL() != null && other.getMinTTL().equals(this.getMinTTL()) == false) return false; if (other.getAllowedMethods() == null ^ this.getAllowedMethods() == null) return false; if (other.getAllowedMethods() != null && other.getAllowedMethods().equals(this.getAllowedMethods()) == false) return false; if (other.getSmoothStreaming() == null ^ this.getSmoothStreaming() == null) return false; if (other.getSmoothStreaming() != null && other.getSmoothStreaming().equals(this.getSmoothStreaming()) == false) return false; if (other.getDefaultTTL() == null ^ this.getDefaultTTL() == null) return false; if (other.getDefaultTTL() != null && other.getDefaultTTL().equals(this.getDefaultTTL()) == false) return false; if (other.getMaxTTL() == null ^ this.getMaxTTL() == null) return false; if (other.getMaxTTL() != null && other.getMaxTTL().equals(this.getMaxTTL()) == false) return false; if (other.getCompress() == null ^ this.getCompress() == null) return false; if (other.getCompress() != null && other.getCompress().equals(this.getCompress()) == false) return false; if (other.getLambdaFunctionAssociations() == null ^ this.getLambdaFunctionAssociations() == null) return false; if (other.getLambdaFunctionAssociations() != null && other.getLambdaFunctionAssociations().equals(this.getLambdaFunctionAssociations()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTargetOriginId() == null) ? 0 : getTargetOriginId().hashCode()); hashCode = prime * hashCode + ((getForwardedValues() == null) ? 0 : getForwardedValues().hashCode()); hashCode = prime * hashCode + ((getTrustedSigners() == null) ? 0 : getTrustedSigners().hashCode()); hashCode = prime * hashCode + ((getViewerProtocolPolicy() == null) ? 0 : getViewerProtocolPolicy().hashCode()); hashCode = prime * hashCode + ((getMinTTL() == null) ? 0 : getMinTTL().hashCode()); hashCode = prime * hashCode + ((getAllowedMethods() == null) ? 0 : getAllowedMethods().hashCode()); hashCode = prime * hashCode + ((getSmoothStreaming() == null) ? 0 : getSmoothStreaming().hashCode()); hashCode = prime * hashCode + ((getDefaultTTL() == null) ? 0 : getDefaultTTL().hashCode()); hashCode = prime * hashCode + ((getMaxTTL() == null) ? 0 : getMaxTTL().hashCode()); hashCode = prime * hashCode + ((getCompress() == null) ? 0 : getCompress().hashCode()); hashCode = prime * hashCode + ((getLambdaFunctionAssociations() == null) ? 0 : getLambdaFunctionAssociations().hashCode()); return hashCode; } @Override public DefaultCacheBehavior clone() { try { return (DefaultCacheBehavior) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy