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

com.softlayer.api.service.dns.Domain Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package com.softlayer.api.service.dns;

import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Account;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.dns.Secondary;
import com.softlayer.api.service.dns.domain.ResourceRecord;
import com.softlayer.api.service.dns.domain.resourcerecord.AType;
import com.softlayer.api.service.dns.domain.resourcerecord.AaaaType;
import com.softlayer.api.service.dns.domain.resourcerecord.CnameType;
import com.softlayer.api.service.dns.domain.resourcerecord.MxType;
import com.softlayer.api.service.dns.domain.resourcerecord.NsType;
import com.softlayer.api.service.dns.domain.resourcerecord.SpfType;
import com.softlayer.api.service.dns.domain.resourcerecord.TxtType;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The SoftLayer_Dns_Domain data type represents a single DNS domain record hosted on the SoftLayer nameservers. Domains contain general information about the domain name such as name and serial. Individual records such as A, AAAA, CTYPE, and MX records are stored in the domain's associated [[SoftLayer_Dns_Domain_ResourceRecord (type)|SoftLayer_Dns_Domain_ResourceRecord]] records. 
 *
 * @see SoftLayer_Dns_Domain
 */
@ApiType("SoftLayer_Dns_Domain")
public class Domain extends Entity {

    /**
     * The SoftLayer customer account that owns a domain.
     */
    @ApiProperty
    protected Account account;

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    /**
     * A flag indicating that the dns domain record is a managed resource.
     */
    @ApiProperty
    protected Boolean managedResourceFlag;

    public Boolean getManagedResourceFlag() {
        return managedResourceFlag;
    }

    public void setManagedResourceFlag(Boolean managedResourceFlag) {
        this.managedResourceFlag = managedResourceFlag;
    }

    /**
     * The individual records contained within a domain record. These include but are not limited to A, AAAA, MX, CTYPE, SPF and TXT records.
     */
    @ApiProperty
    protected List resourceRecords;

    public List getResourceRecords() {
        if (resourceRecords == null) {
            resourceRecords = new ArrayList();
        }
        return resourceRecords;
    }

    /**
     * The secondary DNS record that defines this domain as being managed through zone transfers.
     */
    @ApiProperty
    protected Secondary secondary;

    public Secondary getSecondary() {
        return secondary;
    }

    public void setSecondary(Secondary secondary) {
        this.secondary = secondary;
    }

    /**
     * A domain record's internal identifier.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        idSpecified = true;
        this.id = id;
    }

    protected boolean idSpecified;

    public boolean isIdSpecified() {
        return idSpecified;
    }

    public void unsetId() {
        id = null;
        idSpecified = false;
    }

    /**
     * A domain's name including top-level domain, for example "example.com".
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        nameSpecified = true;
        this.name = name;
    }

    protected boolean nameSpecified;

    public boolean isNameSpecified() {
        return nameSpecified;
    }

    public void unsetName() {
        name = null;
        nameSpecified = false;
    }

    /**
     * A unique number denoting the latest revision of a domain. Whenever a domain is changed its corresponding serial number is also changed. Serial numbers typically follow the format yyyymmdd## where yyyy is the current year, mm is the current month, dd is the current day of the month, and ## is the number of the revision for that day. A domain's serial number is automatically updated when edited via the API. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long serial;

    public Long getSerial() {
        return serial;
    }

    public void setSerial(Long serial) {
        serialSpecified = true;
        this.serial = serial;
    }

    protected boolean serialSpecified;

    public boolean isSerialSpecified() {
        return serialSpecified;
    }

    public void unsetSerial() {
        serial = null;
        serialSpecified = false;
    }

    /**
     * The date that this domain record was last updated.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar updateDate;

    public GregorianCalendar getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(GregorianCalendar updateDate) {
        updateDateSpecified = true;
        this.updateDate = updateDate;
    }

    protected boolean updateDateSpecified;

    public boolean isUpdateDateSpecified() {
        return updateDateSpecified;
    }

    public void unsetUpdateDate() {
        updateDate = null;
        updateDateSpecified = false;
    }

    /**
     * A count of the individual records contained within a domain record. These include but are not limited to A, AAAA, MX, CTYPE, SPF and TXT records.
     */
    @ApiProperty
    protected Long resourceRecordCount;

    public Long getResourceRecordCount() {
        return resourceRecordCount;
    }

    public void setResourceRecordCount(Long resourceRecordCount) {
        this.resourceRecordCount = resourceRecordCount;
    }

    public Service asService(ApiClient client) {
        return service(client, id);
    }

    public static Service service(ApiClient client) {
        return client.createService(Service.class, null);
    }

    public static Service service(ApiClient client, Long id) {
        return client.createService(Service.class, id == null ? null : id.toString());
    }

    /**
     * SoftLayer customers have the option of hosting DNS domains on the SoftLayer name servers. Individual domains hosted on the SoftLayer name servers are handled through the SoftLayer_Dns_Domain service. 
*
* Domain changes are applied automatically by our nameservers, but changes may not be received by the other name servers on the Internet for 72 hours after your change. The SoftLayer_Dns_Domain service does not apply to customers who run their own nameservers on servers purchased from SoftLayer.
*
* SoftLayer provides secondary DNS hosting services if you wish to maintain DNS records on your name server, but have records replicated on SoftLayer's name servers. Use the [[SoftLayer_Dns_Secondary]] service to manage secondary DNS zones and transfers. * * @see SoftLayer_Dns_Domain */ @com.softlayer.api.annotation.ApiService("SoftLayer_Dns_Domain") public static interface Service extends com.softlayer.api.Service { public ServiceAsync asAsync(); public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * Create an A record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AType. * * @see SoftLayer_Dns_Domain::createARecord */ @ApiMethod(instanceRequired = true) public AType createARecord(String host, String data, Long ttl); /** * Create an AAAA record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AaaaType. * * @see SoftLayer_Dns_Domain::createAaaaRecord */ @ApiMethod(instanceRequired = true) public AaaaType createAaaaRecord(String host, String data, Long ttl); /** * Create a CNAME record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createCnameRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_CnameType. * * @see SoftLayer_Dns_Domain::createCnameRecord */ @ApiMethod(instanceRequired = true) public CnameType createCnameRecord(String host, String data, Long ttl); /** * Create an MX record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. MX records are created with a default priority of 10. createMxRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_MxType. * * @see SoftLayer_Dns_Domain::createMxRecord */ @ApiMethod(instanceRequired = true) public MxType createMxRecord(String host, String data, Long ttl, Long mxPriority); /** * Create an NS record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createNsRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_NsType. * * @see SoftLayer_Dns_Domain::createNsRecord */ @ApiMethod(instanceRequired = true) public NsType createNsRecord(String host, String data, Long ttl); /** * Create a new domain on the SoftLayer name servers. The SoftLayer_Dns_Domain object passed to this function must have at least one A or AAAA resource record.
*
* createObject creates a default SOA record with the data:
* * '''host''': "@"
* * '''data''': "ns1.softlayer.com."
* * '''responsible person''': "root.[your domain name]."
* * '''expire''': 604800 seconds
* * '''refresh''': 3600 seconds
* * '''retry''': 300 seconds
* * '''minimum''': 3600 seconds
*
*
* If your new domain uses the .de top-level domain then SOA refresh is set to 10000 seconds, retry is set to 1800 seconds, and minimum to 10000 seconds.
*
* If your domain doesn't contain NS resource records for ns1.softlayer.com or ns2.softlayer.com then ''createObject'' will create them for you.
*
* ''createObject'' returns a Boolean ''true'' on successful object creation or ''false'' if your domain was unable to be created.. * * @see SoftLayer_Dns_Domain::createObject */ @ApiMethod public Domain createObject(Domain templateObject); /** * Create multiple domains on the SoftLayer name servers. Each domain record passed to ''createObjects'' follows the logic in the SoftLayer_Dns_Domain ''createObject'' method. * * @see SoftLayer_Dns_Domain::createObjects */ @ApiMethod public List createObjects(List templateObjects); /** * setPtrRecordForIpAddress() sets a single reverse DNS record for a single IP address and returns the newly created or edited [[SoftLayer_Dns_Domain_ResourceRecord]] record. Currently this method only supports IPv4 addresses and performs no operation when given an IPv6 address. * * @see SoftLayer_Dns_Domain::createPtrRecord */ @ApiMethod public ResourceRecord createPtrRecord(String ipAddress, String ptrRecord, Long ttl); /** * Create an SPF record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_SpfType. * * @see SoftLayer_Dns_Domain::createSpfRecord */ @ApiMethod(instanceRequired = true) public SpfType createSpfRecord(String host, String data, Long ttl); /** * Create a TXT record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_TxtType. * * @see SoftLayer_Dns_Domain::createTxtRecord */ @ApiMethod(instanceRequired = true) public TxtType createTxtRecord(String host, String data, Long ttl); /** * deleteObject permanently removes a domain and all of it's associated resource records from the softlayer name servers. '''This cannot be undone.''' Be wary of running this method. If you remove a domain in error you will need to re-create it by creating a new SoftLayer_Dns_Domain object. * * @see SoftLayer_Dns_Domain::deleteObject */ @ApiMethod(instanceRequired = true) public Boolean deleteObject(); /** * Search for [[SoftLayer_Dns_Domain]] records by domain name. getByDomainName() performs an inclusive search for domain records, returning multiple records based on partial name matches. Use this method to locate domain records if you don't have access to their id numbers. * * @see SoftLayer_Dns_Domain::getByDomainName */ @ApiMethod public List getByDomainName(String name); /** * getObject retrieves the SoftLayer_Dns_Domain object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain service. You can only retrieve domains that are assigned to your SoftLayer account. * * @see SoftLayer_Dns_Domain::getObject */ @ApiMethod(instanceRequired = true) public Domain getObject(); /** * Return a SoftLayer hosted domain and resource records' data formatted as zone file. * * @see SoftLayer_Dns_Domain::getZoneFileContents */ @ApiMethod(instanceRequired = true) public String getZoneFileContents(); /** * The SoftLayer customer account that owns a domain. * * @see SoftLayer_Dns_Domain::getAccount */ @ApiMethod(instanceRequired = true) public Account getAccount(); /** * A flag indicating that the dns domain record is a managed resource. * * @see SoftLayer_Dns_Domain::getManagedResourceFlag */ @ApiMethod(instanceRequired = true) public Boolean getManagedResourceFlag(); /** * The individual records contained within a domain record. These include but are not limited to A, AAAA, MX, CTYPE, SPF and TXT records. * * @see SoftLayer_Dns_Domain::getResourceRecords */ @ApiMethod(instanceRequired = true) public List getResourceRecords(); /** * The secondary DNS record that defines this domain as being managed through zone transfers. * * @see SoftLayer_Dns_Domain::getSecondary */ @ApiMethod(instanceRequired = true) public Secondary getSecondary(); } public static interface ServiceAsync extends com.softlayer.api.ServiceAsync { public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * Async version of {@link Service#createARecord} */ public Future createARecord(String host, String data, Long ttl); public Future createARecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createAaaaRecord} */ public Future createAaaaRecord(String host, String data, Long ttl); public Future createAaaaRecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createCnameRecord} */ public Future createCnameRecord(String host, String data, Long ttl); public Future createCnameRecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createMxRecord} */ public Future createMxRecord(String host, String data, Long ttl, Long mxPriority); public Future createMxRecord(String host, String data, Long ttl, Long mxPriority, ResponseHandler callback); /** * Async version of {@link Service#createNsRecord} */ public Future createNsRecord(String host, String data, Long ttl); public Future createNsRecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createObject} */ public Future createObject(Domain templateObject); public Future createObject(Domain templateObject, ResponseHandler callback); /** * Async version of {@link Service#createObjects} */ public Future> createObjects(List templateObjects); public Future createObjects(List templateObjects, ResponseHandler> callback); /** * Async version of {@link Service#createPtrRecord} */ public Future createPtrRecord(String ipAddress, String ptrRecord, Long ttl); public Future createPtrRecord(String ipAddress, String ptrRecord, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createSpfRecord} */ public Future createSpfRecord(String host, String data, Long ttl); public Future createSpfRecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#createTxtRecord} */ public Future createTxtRecord(String host, String data, Long ttl); public Future createTxtRecord(String host, String data, Long ttl, ResponseHandler callback); /** * Async version of {@link Service#deleteObject} */ public Future deleteObject(); public Future deleteObject(ResponseHandler callback); /** * Async version of {@link Service#getByDomainName} */ public Future> getByDomainName(String name); public Future getByDomainName(String name, ResponseHandler> callback); /** * Async version of {@link Service#getObject} */ public Future getObject(); public Future getObject(ResponseHandler callback); /** * Async version of {@link Service#getZoneFileContents} */ public Future getZoneFileContents(); public Future getZoneFileContents(ResponseHandler callback); /** * Async version of {@link Service#getAccount} */ public Future getAccount(); /** * Async callback version of {@link Service#getAccount} */ public Future getAccount(ResponseHandler callback); /** * Async version of {@link Service#getManagedResourceFlag} */ public Future getManagedResourceFlag(); /** * Async callback version of {@link Service#getManagedResourceFlag} */ public Future getManagedResourceFlag(ResponseHandler callback); /** * Async version of {@link Service#getResourceRecords} */ public Future> getResourceRecords(); /** * Async callback version of {@link Service#getResourceRecords} */ public Future getResourceRecords(ResponseHandler> callback); /** * Async version of {@link Service#getSecondary} */ public Future getSecondary(); /** * Async callback version of {@link Service#getSecondary} */ public Future getSecondary(ResponseHandler callback); } public static class Mask extends com.softlayer.api.service.Entity.Mask { public com.softlayer.api.service.Account.Mask account() { return withSubMask("account", com.softlayer.api.service.Account.Mask.class); } public Mask managedResourceFlag() { withLocalProperty("managedResourceFlag"); return this; } public com.softlayer.api.service.dns.domain.ResourceRecord.Mask resourceRecords() { return withSubMask("resourceRecords", com.softlayer.api.service.dns.domain.ResourceRecord.Mask.class); } public Secondary.Mask secondary() { return withSubMask("secondary", Secondary.Mask.class); } public Mask id() { withLocalProperty("id"); return this; } public Mask name() { withLocalProperty("name"); return this; } public Mask serial() { withLocalProperty("serial"); return this; } public Mask updateDate() { withLocalProperty("updateDate"); return this; } public Mask resourceRecordCount() { withLocalProperty("resourceRecordCount"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy