Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.route53.model;
 
 
Container for the parameters to the CreateHostedZone operation.

This action creates a new hosted zone.

To create a new hosted zone, send a POST request to the 2013-04-01/hostedzone resource. The request body must include an XML document with a CreateHostedZoneRequest element. The response returns the CreateHostedZoneResponse element that contains metadata about the hosted zone.

Route 53 automatically creates a default SOA record and four NS records for the zone. The NS records in the hosted zone are the name servers you give your registrar to delegate your domain to. For more information about SOA and NS records, see NS and SOA Records that Route 53 Creates for a Hosted Zone in the Amazon Route 53 Developer Guide .

When you create a zone, its initial status is PENDING . This means that it is not yet available on all DNS servers. The status of the zone changes to INSYNC when the NS and SOA records are available on all Route 53 DNS servers.

When trying to create a hosted zone using a reusable delegation set, you could specify an optional DelegationSetId, and Route53 would assign those 4 NS records for the zone, instead of alloting a new one.

 
 public class CreateHostedZoneRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

Constraints:
Length: 0 - 1024

 
     private String name;

    
The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.
 
     private VPC vPC;

    
A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Constraints:
Length: 1 - 128

 
     private String callerReference;

    
A complex type that contains an optional comment about your hosted zone.
    private HostedZoneConfig hostedZoneConfig;

    
The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.

Constraints:
Length: 0 - 32

    private String delegationSetId;

    
Default constructor for a new CreateHostedZoneRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
    public CreateHostedZoneRequest() {}
    
    
Constructs a new CreateHostedZoneRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
name The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

callerReference A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

    public CreateHostedZoneRequest(String nameString callerReference) {
        setName(name);
        setCallerReference(callerReference);
    }

    
The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

Constraints:
Length: 0 - 1024

Returns:
The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

    public String getName() {
        return ;
    }
    
    
The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

Constraints:
Length: 0 - 1024

Parameters:
name The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

    public void setName(String name) {
        this. = name;
    }
    
    
The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

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

Constraints:
Length: 0 - 1024

Parameters:
name The name of the domain. This must be a fully-specified domain, for example, www.example.com. The trailing dot is optional; Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

This is the name you have registered with your DNS registrar. You should ask your registrar to change the authoritative name servers for your domain to the set of NameServers elements returned in DelegationSet.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateHostedZoneRequest withName(String name) {
        this. = name;
        return this;
    }

    
The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.

Returns:
The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.
    public VPC getVPC() {
        return ;
    }
    
    
The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.

Parameters:
vPC The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.
    public void setVPC(VPC vPC) {
        this. = vPC;
    }
    
    
The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.

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

Parameters:
vPC The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateHostedZoneRequest withVPC(VPC vPC) {
        this. = vPC;
        return this;
    }

    
A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Constraints:
Length: 1 - 128

Returns:
A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

    public String getCallerReference() {
        return ;
    }
    
    
A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Constraints:
Length: 1 - 128

Parameters:
callerReference A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

    public void setCallerReference(String callerReference) {
        this. = callerReference;
    }
    
    
A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

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

Constraints:
Length: 1 - 128

Parameters:
callerReference A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string; you might choose to use a string that identifies your project, such as DNSMigration_01.

Valid characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateHostedZoneRequest withCallerReference(String callerReference) {
        this. = callerReference;
        return this;
    }

    
A complex type that contains an optional comment about your hosted zone.

Returns:
A complex type that contains an optional comment about your hosted zone.
        return ;
    }
    
    
A complex type that contains an optional comment about your hosted zone.

Parameters:
hostedZoneConfig A complex type that contains an optional comment about your hosted zone.
    public void setHostedZoneConfig(HostedZoneConfig hostedZoneConfig) {
        this. = hostedZoneConfig;
    }
    
    
A complex type that contains an optional comment about your hosted zone.

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

Parameters:
hostedZoneConfig A complex type that contains an optional comment about your hosted zone.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = hostedZoneConfig;
        return this;
    }

    
The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.

Constraints:
Length: 0 - 32

Returns:
The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.
    public String getDelegationSetId() {
        return ;
    }
    
    
The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.

Constraints:
Length: 0 - 32

Parameters:
delegationSetId The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.
    public void setDelegationSetId(String delegationSetId) {
        this. = delegationSetId;
    }
    
    
The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.

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

Constraints:
Length: 0 - 32

Parameters:
delegationSetId The delegation set id of the reusable delgation set whose NS records you want to assign to the new hosted zone.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateHostedZoneRequest withDelegationSetId(String delegationSetId) {
        this. = delegationSetId;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getVPC() != nullsb.append("VPC: " + getVPC() + ",");
        if (getCallerReference() != nullsb.append("CallerReference: " + getCallerReference() + ",");
        if (getHostedZoneConfig() != nullsb.append("HostedZoneConfig: " + getHostedZoneConfig() + ",");
        if (getDelegationSetId() != nullsb.append("DelegationSetId: " + getDelegationSetId() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getVPC() == null) ? 0 : getVPC().hashCode()); 
        hashCode = prime * hashCode + ((getCallerReference() == null) ? 0 : getCallerReference().hashCode()); 
        hashCode = prime * hashCode + ((getHostedZoneConfig() == null) ? 0 : getHostedZoneConfig().hashCode()); 
        hashCode = prime * hashCode + ((getDelegationSetId() == null) ? 0 : getDelegationSetId().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateHostedZoneRequest == falsereturn false;
        CreateHostedZoneRequest other = (CreateHostedZoneRequest)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getVPC() == null ^ this.getVPC() == nullreturn false;
        if (other.getVPC() != null && other.getVPC().equals(this.getVPC()) == falsereturn false
        if (other.getCallerReference() == null ^ this.getCallerReference() == nullreturn false;
        if (other.getCallerReference() != null && other.getCallerReference().equals(this.getCallerReference()) == falsereturn false
        if (other.getHostedZoneConfig() == null ^ this.getHostedZoneConfig() == nullreturn false;
        if (other.getHostedZoneConfig() != null && other.getHostedZoneConfig().equals(this.getHostedZoneConfig()) == falsereturn false
        if (other.getDelegationSetId() == null ^ this.getDelegationSetId() == nullreturn false;
        if (other.getDelegationSetId() != null && other.getDelegationSetId().equals(this.getDelegationSetId()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateHostedZoneRequest clone() {
        
            return (CreateHostedZoneRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X