com.amazonaws.services.cloudfront.model

## Class Origin

- java.lang.Object
- - com.amazonaws.services.cloudfront.model.Origin

All Implemented Interfaces:
  Serializable, Cloneable

    public class Origin
    extends Object
    implements Serializable, Cloneable

A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin.

For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Origin()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Origin` `clone()`
`boolean` `equals(Object obj)`
`CustomHeaders` `getCustomHeaders()` A complex type that contains names and values for the custom headers that you want.
`CustomOriginConfig` `getCustomOriginConfig()` A complex type that contains information about a custom origin.
`String` `getDomainName()` Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.
`String` `getId()` A unique identifier for the origin.
`String` `getOriginPath()` An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
`S3OriginConfig` `getS3OriginConfig()` A complex type that contains information about the Amazon S3 origin.
`int` `hashCode()`
`void` `setCustomHeaders(CustomHeaders customHeaders)` A complex type that contains names and values for the custom headers that you want.
`void` `setCustomOriginConfig(CustomOriginConfig customOriginConfig)` A complex type that contains information about a custom origin.
`void` `setDomainName(String domainName)` Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.
`void` `setId(String id)` A unique identifier for the origin.
`void` `setOriginPath(String originPath)` An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
`void` `setS3OriginConfig(S3OriginConfig s3OriginConfig)` A complex type that contains information about the Amazon S3 origin.
`String` `toString()` Returns a string representation of this object; useful for testing and debugging.
`Origin` `withCustomHeaders(CustomHeaders customHeaders)` A complex type that contains names and values for the custom headers that you want.
`Origin` `withCustomOriginConfig(CustomOriginConfig customOriginConfig)` A complex type that contains information about a custom origin.
`Origin` `withDomainName(String domainName)` Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.
`Origin` `withId(String id)` A unique identifier for the origin.
`Origin` `withOriginPath(String originPath)` An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
`Origin` `withS3OriginConfig(S3OriginConfig s3OriginConfig)` A complex type that contains information about the Amazon S3 origin.

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Origin

    public Origin()

### Method Detail

#### setId

    public void setId(String id)

A unique identifier for the origin. The value of `Id` must be unique within the distribution.

When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

Parameters:
  `id` - A unique identifier for the origin. The value of `Id` must be unique within the distribution.

  When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

#### getId

    public String getId()

A unique identifier for the origin. The value of `Id` must be unique within the distribution.

When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

Returns:
  A unique identifier for the origin. The value of `Id` must be unique within the distribution.

  When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

#### withId

    public Origin withId(String id)

A unique identifier for the origin. The value of `Id` must be unique within the distribution.

When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

Parameters:
  `id` - A unique identifier for the origin. The value of `Id` must be unique within the distribution.

  When you specify the value of `TargetOriginId` for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the `Id` element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide.

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

#### setDomainName

    public void setDomainName(String domainName)

Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

Constraints for Amazon S3 origins:

- If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

- The bucket name must be between 3 and 63 characters long (inclusive).

- The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

- The bucket name must not contain adjacent periods.

Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

Constraints for custom origins:

- `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

- The name cannot exceed 128 characters.

Parameters:
  `domainName` - Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

  Constraints for Amazon S3 origins:

  - If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

  - The bucket name must be between 3 and 63 characters long (inclusive).

  - The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

  - The bucket name must not contain adjacent periods.

  Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

  Constraints for custom origins:

  - `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

  - The name cannot exceed 128 characters.

#### getDomainName

    public String getDomainName()

Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

Constraints for Amazon S3 origins:

- If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

- The bucket name must be between 3 and 63 characters long (inclusive).

- The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

- The bucket name must not contain adjacent periods.

Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

Constraints for custom origins:

- `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

- The name cannot exceed 128 characters.

Returns:
  Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

  Constraints for Amazon S3 origins:

  - If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

  - The bucket name must be between 3 and 63 characters long (inclusive).

  - The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

  - The bucket name must not contain adjacent periods.

  Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

  Constraints for custom origins:

  - `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

  - The name cannot exceed 128 characters.

#### withDomainName

    public Origin withDomainName(String domainName)

Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

Constraints for Amazon S3 origins:

- If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

- The bucket name must be between 3 and 63 characters long (inclusive).

- The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

- The bucket name must not contain adjacent periods.

Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

Constraints for custom origins:

- `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

- The name cannot exceed 128 characters.

Parameters:
  `domainName` - Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, `myawsbucket.s3.amazonaws.com`.

  Constraints for Amazon S3 origins:

  - If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the `s3-accelerate` endpoint for `DomainName`.

  - The bucket name must be between 3 and 63 characters long (inclusive).

  - The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes.

  - The bucket name must not contain adjacent periods.

  Custom Origins: The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, `www.example.com`.

  Constraints for custom origins:

  - `DomainName` must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters.

  - The name cannot exceed 128 characters.

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

#### setOriginPath

    public void setOriginPath(String originPath)

An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

For example, suppose you've specified the following values for your distribution:

- `DomainName`: An Amazon S3 bucket named `myawsbucket`.

- `OriginPath`: `/production`

- `CNAME`: `example.com`

When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

Parameters:
  `originPath` - An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

  For example, suppose you've specified the following values for your distribution:

  - `DomainName`: An Amazon S3 bucket named `myawsbucket`.

  - `OriginPath`: `/production`

  - `CNAME`: `example.com`

  When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

  When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

#### getOriginPath

    public String getOriginPath()

An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

For example, suppose you've specified the following values for your distribution:

- `DomainName`: An Amazon S3 bucket named `myawsbucket`.

- `OriginPath`: `/production`

- `CNAME`: `example.com`

When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

Returns:
  An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

  For example, suppose you've specified the following values for your distribution:

  - `DomainName`: An Amazon S3 bucket named `myawsbucket`.

  - `OriginPath`: `/production`

  - `CNAME`: `example.com`

  When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

  When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

#### withOriginPath

    public Origin withOriginPath(String originPath)

An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

For example, suppose you've specified the following values for your distribution:

- `DomainName`: An Amazon S3 bucket named `myawsbucket`.

- `OriginPath`: `/production`

- `CNAME`: `example.com`

When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

Parameters:
  `originPath` - An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the `OriginPath` element, specify the directory name, beginning with a `/`. CloudFront appends the directory name to the value of `DomainName`, for example, `example.com/production`. Do not include a `/` at the end of the directory name.

  For example, suppose you've specified the following values for your distribution:

  - `DomainName`: An Amazon S3 bucket named `myawsbucket`.

  - `OriginPath`: `/production`

  - `CNAME`: `example.com`

  When a user enters `example.com/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/index.html`.

  When a user enters `example.com/acme/index.html` in a browser, CloudFront sends a request to Amazon S3 for `myawsbucket/production/acme/index.html`.

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

#### setCustomHeaders

    public void setCustomHeaders(CustomHeaders customHeaders)

A complex type that contains names and values for the custom headers that you want.

Parameters:
  `customHeaders` - A complex type that contains names and values for the custom headers that you want.

#### getCustomHeaders

    public CustomHeaders getCustomHeaders()

A complex type that contains names and values for the custom headers that you want.

Returns:
  A complex type that contains names and values for the custom headers that you want.

#### withCustomHeaders

    public Origin withCustomHeaders(CustomHeaders customHeaders)

A complex type that contains names and values for the custom headers that you want.

Parameters:
  `customHeaders` - A complex type that contains names and values for the custom headers that you want.
Returns:
  Returns a reference to this object so that method calls can be chained together.

#### setS3OriginConfig

    public void setS3OriginConfig(S3OriginConfig s3OriginConfig)

A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

Parameters:
  `s3OriginConfig` - A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

#### getS3OriginConfig

    public S3OriginConfig getS3OriginConfig()

A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

Returns:
  A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

#### withS3OriginConfig

    public Origin withS3OriginConfig(S3OriginConfig s3OriginConfig)

A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

Parameters:
  `s3OriginConfig` - A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.
Returns:
  Returns a reference to this object so that method calls can be chained together.

#### setCustomOriginConfig

    public void setCustomOriginConfig(CustomOriginConfig customOriginConfig)

A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.

Parameters:
  `customOriginConfig` - A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.

#### getCustomOriginConfig

    public CustomOriginConfig getCustomOriginConfig()

A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.

Returns:
  A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.

#### withCustomOriginConfig

    public Origin withCustomOriginConfig(CustomOriginConfig customOriginConfig)

A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.

Parameters:
  `customOriginConfig` - A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the `S3OriginConfig` element instead.
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:
  `Object.toString()`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### clone

    public Origin clone()

Overrides:
  `clone` in class `Object`