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

com.softlayer.api.service.location.group.Regional Maven / Gradle / Ivy

The newest version!
package com.softlayer.api.service.location.group;

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.Location;
import com.softlayer.api.service.location.Datacenter;
import com.softlayer.api.service.location.Group;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;

/**
 * A regional location group is a collection of datacenters for a region. 
 *
 * @see SoftLayer_Location_Group_Regional
 */
@ApiType("SoftLayer_Location_Group_Regional")
public class Regional extends Group {

    /**
     * The datacenters in a group.
     */
    @ApiProperty
    protected List datacenters;

    public List getDatacenters() {
        if (datacenters == null) {
            datacenters = new ArrayList();
        }
        return datacenters;
    }

    /**
     * The preferred datacenters of a group.
     */
    @ApiProperty
    protected Datacenter preferredDatacenter;

    public Datacenter getPreferredDatacenter() {
        return preferredDatacenter;
    }

    public void setPreferredDatacenter(Datacenter preferredDatacenter) {
        this.preferredDatacenter = preferredDatacenter;
    }

    /**
     * A count of the datacenters in a group.
     */
    @ApiProperty
    protected Long datacenterCount;

    public Long getDatacenterCount() {
        return datacenterCount;
    }

    public void setDatacenterCount(Long datacenterCount) {
        this.datacenterCount = datacenterCount;
    }

    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());
    }

    /**
     * A regional location group is a collection of datacenters for a region. 
     *
     * @see SoftLayer_Location_Group_Regional
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Location_Group_Regional")
    public static interface Service extends Group.Service {

        public ServiceAsync asAsync();
        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * @see SoftLayer_Location_Group_Regional::getAllObjects
         */
        @ApiMethod("getAllObjects")
        public List getAllObjectsForRegional();

        /**
         * @see SoftLayer_Location_Group_Regional::getObject
         */
        @ApiMethod(value = "getObject", instanceRequired = true)
        public Regional getObjectForRegional();

        /**
         * The datacenters in a group.
         *
         * @see SoftLayer_Location_Group_Regional::getDatacenters
         */
        @ApiMethod(instanceRequired = true)
        public List getDatacenters();

        /**
         * The preferred datacenters of a group.
         *
         * @see SoftLayer_Location_Group_Regional::getPreferredDatacenter
         */
        @ApiMethod(instanceRequired = true)
        public Datacenter getPreferredDatacenter();

    }

    public static interface ServiceAsync extends Group.ServiceAsync {

        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * Async version of {@link Service#getAllObjectsForRegional}
         */
        public Future> getAllObjectsForRegional();

        public Future getAllObjectsForRegional(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getObjectForRegional}
         */
        public Future getObjectForRegional();

        public Future getObjectForRegional(ResponseHandler callback);

        /**
         * Async version of {@link Service#getDatacenters}
         */
        public Future> getDatacenters();

        /**
         * Async callback version of {@link Service#getDatacenters}
         */
        public Future getDatacenters(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getPreferredDatacenter}
         */
        public Future getPreferredDatacenter();

        /**
         * Async callback version of {@link Service#getPreferredDatacenter}
         */
        public Future getPreferredDatacenter(ResponseHandler callback);

    }

    public static class Mask extends com.softlayer.api.service.location.Group.Mask {

        public com.softlayer.api.service.Location.Mask datacenters() {
            return withSubMask("datacenters", com.softlayer.api.service.Location.Mask.class);
        }

        public com.softlayer.api.service.location.Datacenter.Mask preferredDatacenter() {
            return withSubMask("preferredDatacenter", com.softlayer.api.service.location.Datacenter.Mask.class);
        }

        public Mask datacenterCount() {
            withLocalProperty("datacenterCount");
            return this;
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy