Class DistributionConfig

java.lang.Object
com.amazonaws.services.cloudfront.model.DistributionConfig
All Implemented Interfaces:
Serializable, Cloneable

public class DistributionConfig extends Object implements Serializable, Cloneable
A distribution Configuration.
See Also:
  • Constructor Details

    • DistributionConfig

      public DistributionConfig()
      Default constructor for DistributionConfig object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it.
    • DistributionConfig

      public DistributionConfig(String callerReference, Boolean enabled)
      Constructs a new DistributionConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      callerReference - A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
      enabled - Whether the distribution is enabled to accept end user requests for content.
  • Method Details

    • setCallerReference

      public void setCallerReference(String callerReference)
      A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
      Parameters:
      callerReference - A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
    • getCallerReference

      public String getCallerReference()
      A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
      Returns:
      A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
    • withCallerReference

      public DistributionConfig withCallerReference(String callerReference)
      A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
      Parameters:
      callerReference - A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created. If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAliases

      public void setAliases(Aliases aliases)
      A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
      Parameters:
      aliases - A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
    • getAliases

      public Aliases getAliases()
      A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
      Returns:
      A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
    • withAliases

      public DistributionConfig withAliases(Aliases aliases)
      A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
      Parameters:
      aliases - A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setDefaultRootObject

      public void setDefaultRootObject(String defaultRootObject)
      The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
      Parameters:
      defaultRootObject - The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
    • getDefaultRootObject

      public String getDefaultRootObject()
      The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
      Returns:
      The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
    • withDefaultRootObject

      public DistributionConfig withDefaultRootObject(String defaultRootObject)
      The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
      Parameters:
      defaultRootObject - The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL for your distribution (http://www.example.com) instead of an object in your distribution (http://www.example.com/index.html). Specifying a default root object avoids exposing the contents of your distribution. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setOrigins

      public void setOrigins(Origins origins)
      A complex type that contains information about origins for this distribution.
      Parameters:
      origins - A complex type that contains information about origins for this distribution.
    • getOrigins

      public Origins getOrigins()
      A complex type that contains information about origins for this distribution.
      Returns:
      A complex type that contains information about origins for this distribution.
    • withOrigins

      public DistributionConfig withOrigins(Origins origins)
      A complex type that contains information about origins for this distribution.
      Parameters:
      origins - A complex type that contains information about origins for this distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setDefaultCacheBehavior

      public void setDefaultCacheBehavior(DefaultCacheBehavior defaultCacheBehavior)
      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.
      Parameters:
      defaultCacheBehavior - 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.
    • getDefaultCacheBehavior

      public DefaultCacheBehavior getDefaultCacheBehavior()
      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.
      Returns:
      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.
    • withDefaultCacheBehavior

      public DistributionConfig withDefaultCacheBehavior(DefaultCacheBehavior defaultCacheBehavior)
      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.
      Parameters:
      defaultCacheBehavior - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setCacheBehaviors

      public void setCacheBehaviors(CacheBehaviors cacheBehaviors)
      A complex type that contains zero or more CacheBehavior elements.
      Parameters:
      cacheBehaviors - A complex type that contains zero or more CacheBehavior elements.
    • getCacheBehaviors

      public CacheBehaviors getCacheBehaviors()
      A complex type that contains zero or more CacheBehavior elements.
      Returns:
      A complex type that contains zero or more CacheBehavior elements.
    • withCacheBehaviors

      public DistributionConfig withCacheBehaviors(CacheBehaviors cacheBehaviors)
      A complex type that contains zero or more CacheBehavior elements.
      Parameters:
      cacheBehaviors - A complex type that contains zero or more CacheBehavior elements.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setCustomErrorResponses

      public void setCustomErrorResponses(CustomErrorResponses customErrorResponses)
      A complex type that contains zero or more CustomErrorResponse elements.
      Parameters:
      customErrorResponses - A complex type that contains zero or more CustomErrorResponse elements.
    • getCustomErrorResponses

      public CustomErrorResponses getCustomErrorResponses()
      A complex type that contains zero or more CustomErrorResponse elements.
      Returns:
      A complex type that contains zero or more CustomErrorResponse elements.
    • withCustomErrorResponses

      public DistributionConfig withCustomErrorResponses(CustomErrorResponses customErrorResponses)
      A complex type that contains zero or more CustomErrorResponse elements.
      Parameters:
      customErrorResponses - A complex type that contains zero or more CustomErrorResponse elements.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setComment

      public void setComment(String comment)
      Any comments you want to include about the distribution.
      Parameters:
      comment - Any comments you want to include about the distribution.
    • getComment

      public String getComment()
      Any comments you want to include about the distribution.
      Returns:
      Any comments you want to include about the distribution.
    • withComment

      public DistributionConfig withComment(String comment)
      Any comments you want to include about the distribution.
      Parameters:
      comment - Any comments you want to include about the distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setLogging

      public void setLogging(LoggingConfig logging)
      A complex type that controls whether access logs are written for the distribution.
      Parameters:
      logging - A complex type that controls whether access logs are written for the distribution.
    • getLogging

      public LoggingConfig getLogging()
      A complex type that controls whether access logs are written for the distribution.
      Returns:
      A complex type that controls whether access logs are written for the distribution.
    • withLogging

      public DistributionConfig withLogging(LoggingConfig logging)
      A complex type that controls whether access logs are written for the distribution.
      Parameters:
      logging - A complex type that controls whether access logs are written for the distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setPriceClass

      public void setPriceClass(String priceClass)
      A complex type that contains information about price class for this distribution.
      Parameters:
      priceClass - A complex type that contains information about price class for this distribution.
      See Also:
    • getPriceClass

      public String getPriceClass()
      A complex type that contains information about price class for this distribution.
      Returns:
      A complex type that contains information about price class for this distribution.
      See Also:
    • withPriceClass

      public DistributionConfig withPriceClass(String priceClass)
      A complex type that contains information about price class for this distribution.
      Parameters:
      priceClass - A complex type that contains information about price class for this distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setPriceClass

      public void setPriceClass(PriceClass priceClass)
      A complex type that contains information about price class for this distribution.
      Parameters:
      priceClass - A complex type that contains information about price class for this distribution.
      See Also:
    • withPriceClass

      public DistributionConfig withPriceClass(PriceClass priceClass)
      A complex type that contains information about price class for this distribution.
      Parameters:
      priceClass - A complex type that contains information about price class for this distribution.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setEnabled

      public void setEnabled(Boolean enabled)
      Whether the distribution is enabled to accept end user requests for content.
      Parameters:
      enabled - Whether the distribution is enabled to accept end user requests for content.
    • getEnabled

      public Boolean getEnabled()
      Whether the distribution is enabled to accept end user requests for content.
      Returns:
      Whether the distribution is enabled to accept end user requests for content.
    • withEnabled

      public DistributionConfig withEnabled(Boolean enabled)
      Whether the distribution is enabled to accept end user requests for content.
      Parameters:
      enabled - Whether the distribution is enabled to accept end user requests for content.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • isEnabled

      public Boolean isEnabled()
      Whether the distribution is enabled to accept end user requests for content.
      Returns:
      Whether the distribution is enabled to accept end user requests for content.
    • setViewerCertificate

      public void setViewerCertificate(ViewerCertificate viewerCertificate)
      Parameters:
      viewerCertificate -
    • getViewerCertificate

      public ViewerCertificate getViewerCertificate()
      Returns:
    • withViewerCertificate

      public DistributionConfig withViewerCertificate(ViewerCertificate viewerCertificate)
      Parameters:
      viewerCertificate -
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setRestrictions

      public void setRestrictions(Restrictions restrictions)
      Parameters:
      restrictions -
    • getRestrictions

      public Restrictions getRestrictions()
      Returns:
    • withRestrictions

      public DistributionConfig withRestrictions(Restrictions restrictions)
      Parameters:
      restrictions -
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setWebACLId

      public void setWebACLId(String webACLId)
      (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
      Parameters:
      webACLId - (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
    • getWebACLId

      public String getWebACLId()
      (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
      Returns:
      (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
    • withWebACLId

      public DistributionConfig withWebACLId(String webACLId)
      (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
      Parameters:
      webACLId - (Optional) If you're using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution.
      Returns:
      Returns a reference to this 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:
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public DistributionConfig clone()
      Overrides:
      clone in class Object