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

com.softlayer.api.service.network.lbaas.LoadBalancer Maven / Gradle / Ivy

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

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.Entity;
import com.softlayer.api.service.Location;
import com.softlayer.api.service.network.lbaas.HealthMonitor;
import com.softlayer.api.service.network.lbaas.Listener;
import com.softlayer.api.service.network.lbaas.LoadBalancerStatistics;
import com.softlayer.api.service.network.lbaas.Member;
import com.softlayer.api.service.network.lbaas.PoolMembersHealth;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The SoftLayer_Network_LBaaS_LoadBalancer type presents a structure containing attributes of a load balancer, and its related objects including listeners, pools and members. 
 *
 * @see SoftLayer_Network_LBaaS_LoadBalancer
 */
@ApiType("SoftLayer_Network_LBaaS_LoadBalancer")
public class LoadBalancer extends Entity {

    /**
     * Datacenter, where load balancer is located.
     */
    @ApiProperty
    protected Location datacenter;

    public Location getDatacenter() {
        return datacenter;
    }

    public void setDatacenter(Location datacenter) {
        this.datacenter = datacenter;
    }

    /**
     * Health monitors for the backend members.
     */
    @ApiProperty
    protected List healthMonitors;

    public List getHealthMonitors() {
        if (healthMonitors == null) {
            healthMonitors = new ArrayList();
        }
        return healthMonitors;
    }

    /**
     * Listeners assigned to load balancer.
     */
    @ApiProperty
    protected List listeners;

    public List getListeners() {
        if (listeners == null) {
            listeners = new ArrayList();
        }
        return listeners;
    }

    /**
     * Members assigned to load balancer.
     */
    @ApiProperty
    protected List members;

    public List getMembers() {
        if (members == null) {
            members = new ArrayList();
        }
        return members;
    }

    /**
     * The account this load balancer belongs to.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long accountId;

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        accountIdSpecified = true;
        this.accountId = accountId;
    }

    protected boolean accountIdSpecified;

    public boolean isAccountIdSpecified() {
        return accountIdSpecified;
    }

    public void unsetAccountId() {
        accountId = null;
        accountIdSpecified = false;
    }

    /**
     * Address (Host name) of a load balancer.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String address;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        addressSpecified = true;
        this.address = address;
    }

    protected boolean addressSpecified;

    public boolean isAddressSpecified() {
        return addressSpecified;
    }

    public void unsetAddress() {
        address = null;
        addressSpecified = false;
    }

    /**
     * Specifies when a load balancer was created.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar createDate;

    public GregorianCalendar getCreateDate() {
        return createDate;
    }

    public void setCreateDate(GregorianCalendar createDate) {
        createDateSpecified = true;
        this.createDate = createDate;
    }

    protected boolean createDateSpecified;

    public boolean isCreateDateSpecified() {
        return createDateSpecified;
    }

    public void unsetCreateDate() {
        createDate = null;
        createDateSpecified = false;
    }

    /**
     * Description of a load balancer.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String description;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        descriptionSpecified = true;
        this.description = description;
    }

    protected boolean descriptionSpecified;

    public boolean isDescriptionSpecified() {
        return descriptionSpecified;
    }

    public void unsetDescription() {
        description = null;
        descriptionSpecified = false;
    }

    @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;
    }

    /**
     * Specifies if a load balancer is public=1 or private=0.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long isPublic;

    public Long getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Long isPublic) {
        isPublicSpecified = true;
        this.isPublic = isPublic;
    }

    protected boolean isPublicSpecified;

    public boolean isIsPublicSpecified() {
        return isPublicSpecified;
    }

    public void unsetIsPublic() {
        isPublic = null;
        isPublicSpecified = false;
    }

    /**
     * This references to location with type datacenter
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long locationId;

    public Long getLocationId() {
        return locationId;
    }

    public void setLocationId(Long locationId) {
        locationIdSpecified = true;
        this.locationId = locationId;
    }

    protected boolean locationIdSpecified;

    public boolean isLocationIdSpecified() {
        return locationIdSpecified;
    }

    public void unsetLocationId() {
        locationId = null;
        locationIdSpecified = false;
    }

    /**
     * Specifies when a load balancer was updated last.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected GregorianCalendar modifyDate;

    public GregorianCalendar getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(GregorianCalendar modifyDate) {
        modifyDateSpecified = true;
        this.modifyDate = modifyDate;
    }

    protected boolean modifyDateSpecified;

    public boolean isModifyDateSpecified() {
        return modifyDateSpecified;
    }

    public void unsetModifyDate() {
        modifyDate = null;
        modifyDateSpecified = false;
    }

    /**
     * The load balancer's name.
     */
    @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;
    }

    /**
     * The operation status "ONLINE" or "OFFLINE" of a load balancer.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String operatingStatus;

    public String getOperatingStatus() {
        return operatingStatus;
    }

    public void setOperatingStatus(String operatingStatus) {
        operatingStatusSpecified = true;
        this.operatingStatus = operatingStatus;
    }

    protected boolean operatingStatusSpecified;

    public boolean isOperatingStatusSpecified() {
        return operatingStatusSpecified;
    }

    public void unsetOperatingStatus() {
        operatingStatus = null;
        operatingStatusSpecified = false;
    }

    /**
     * Error message of previous API call in case of failure
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String previousErrorText;

    public String getPreviousErrorText() {
        return previousErrorText;
    }

    public void setPreviousErrorText(String previousErrorText) {
        previousErrorTextSpecified = true;
        this.previousErrorText = previousErrorText;
    }

    protected boolean previousErrorTextSpecified;

    public boolean isPreviousErrorTextSpecified() {
        return previousErrorTextSpecified;
    }

    public void unsetPreviousErrorText() {
        previousErrorText = null;
        previousErrorTextSpecified = false;
    }

    /**
     * The provisioning status of a load balancer.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String provisioningStatus;

    public String getProvisioningStatus() {
        return provisioningStatus;
    }

    public void setProvisioningStatus(String provisioningStatus) {
        provisioningStatusSpecified = true;
        this.provisioningStatus = provisioningStatus;
    }

    protected boolean provisioningStatusSpecified;

    public boolean isProvisioningStatusSpecified() {
        return provisioningStatusSpecified;
    }

    public void unsetProvisioningStatus() {
        provisioningStatus = null;
        provisioningStatusSpecified = false;
    }

    /**
     * Specifies if a load balancer is using
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long useSystemPublicIpPool;

    public Long getUseSystemPublicIpPool() {
        return useSystemPublicIpPool;
    }

    public void setUseSystemPublicIpPool(Long useSystemPublicIpPool) {
        useSystemPublicIpPoolSpecified = true;
        this.useSystemPublicIpPool = useSystemPublicIpPool;
    }

    protected boolean useSystemPublicIpPoolSpecified;

    public boolean isUseSystemPublicIpPoolSpecified() {
        return useSystemPublicIpPoolSpecified;
    }

    public void unsetUseSystemPublicIpPool() {
        useSystemPublicIpPool = null;
        useSystemPublicIpPoolSpecified = false;
    }

    /**
     * The UUID of a load balancer.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String uuid;

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        uuidSpecified = true;
        this.uuid = uuid;
    }

    protected boolean uuidSpecified;

    public boolean isUuidSpecified() {
        return uuidSpecified;
    }

    public void unsetUuid() {
        uuid = null;
        uuidSpecified = false;
    }

    /**
     * A count of health monitors for the backend members.
     */
    @ApiProperty
    protected Long healthMonitorCount;

    public Long getHealthMonitorCount() {
        return healthMonitorCount;
    }

    public void setHealthMonitorCount(Long healthMonitorCount) {
        this.healthMonitorCount = healthMonitorCount;
    }

    /**
     * A count of listeners assigned to load balancer.
     */
    @ApiProperty
    protected Long listenerCount;

    public Long getListenerCount() {
        return listenerCount;
    }

    public void setListenerCount(Long listenerCount) {
        this.listenerCount = listenerCount;
    }

    /**
     * A count of members assigned to load balancer.
     */
    @ApiProperty
    protected Long memberCount;

    public Long getMemberCount() {
        return memberCount;
    }

    public void setMemberCount(Long memberCount) {
        this.memberCount = memberCount;
    }

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

    /**
     * The SoftLayer_Network_LBaaS_LoadBalancer service allows customers to create, edit, delete, get details of a load balancer instance and retrieve all existing load balancer instances. The most common use case of a load balancer instance is to improve performance and high availability of customers application services by distributing the incoming requests across multiple servers. Thus, clients using customers application services will only need to know the load balancer instances host name respective IP address in order to submit their requests. Note that SoftLayer_Network_LBaaS_LoadBalancer provides the load balancing functionality only, while it is customers responsibility to implement their application services and deploy them to respective servers, typically virtual servers or bare metal systems hosted by IBM SoftLayer. Conceptually a load balancer instance consists of a set of listeners, also called frontends, pools, also called backends, and members (application servers). A listener (frontend) represents basically the network protocol and port for requests coming from clients applications and is always associated with a pool (backend) defined by a network protocol, port and load balancing algorithm. The pools network protocol and port specify how incoming requests will be forwarded to application servers, while the load balancing algorithm (round-robin, weighted round-robin or least connections) determines the distribution scheme of incoming requests among the members, ie application servers. Note that members of a load balancer instance are assigned implicitly to all pools (backends) of that load balancer. 
     *
     * @see SoftLayer_Network_LBaaS_LoadBalancer
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Network_LBaaS_LoadBalancer")
    public static interface Service extends com.softlayer.api.Service {

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

        /**
         * Cancel a load balancer with the given uuid. The billing system will execute the deletion of load balancer and all objects associated with it such as load balancer appliances, listeners, pools and members in the background. 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::cancelLoadBalancer
         */
        @ApiMethod
        public Boolean cancelLoadBalancer(String uuid);

        /**
         * Return all existing load balancers 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getAllObjects
         */
        @ApiMethod
        public List getAllObjects();

        /**
         * Get the load balancer object with given uuid. 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getLoadBalancer
         */
        @ApiMethod
        public LoadBalancer getLoadBalancer(String uuid);

        /**
         * Return load balancer members health 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getLoadBalancerMemberHealth
         */
        @ApiMethod
        public List getLoadBalancerMemberHealth(String uuid);

        /**
         * Return load balancers statistics such as total number of current sessions and total number of accumulated connections. 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getLoadBalancerStatistics
         */
        @ApiMethod
        public LoadBalancerStatistics getLoadBalancerStatistics(String uuid);

        /**
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getObject
         */
        @ApiMethod(instanceRequired = true)
        public LoadBalancer getObject();

        /**
         * @see SoftLayer_Network_LBaaS_LoadBalancer::serviceLoadBalancer
         */
        @ApiMethod
        public LoadBalancer serviceLoadBalancer(String data);

        /**
         * Update load balancer's description, and return the load balancer object containing all listeners, pools, members and datacenter. 
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::updateLoadBalancer
         */
        @ApiMethod
        public LoadBalancer updateLoadBalancer(String uuid, String newDescription);

        /**
         * Datacenter, where load balancer is located.
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getDatacenter
         */
        @ApiMethod(instanceRequired = true)
        public Location getDatacenter();

        /**
         * Health monitors for the backend members.
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getHealthMonitors
         */
        @ApiMethod(instanceRequired = true)
        public List getHealthMonitors();

        /**
         * Listeners assigned to load balancer.
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getListeners
         */
        @ApiMethod(instanceRequired = true)
        public List getListeners();

        /**
         * Members assigned to load balancer.
         *
         * @see SoftLayer_Network_LBaaS_LoadBalancer::getMembers
         */
        @ApiMethod(instanceRequired = true)
        public List getMembers();

    }

    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#cancelLoadBalancer}
         */
        public Future cancelLoadBalancer(String uuid);

        public Future cancelLoadBalancer(String uuid, ResponseHandler callback);

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

        public Future getAllObjects(ResponseHandler> callback);

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

        public Future getLoadBalancer(String uuid, ResponseHandler callback);

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

        public Future getLoadBalancerMemberHealth(String uuid, ResponseHandler> callback);

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

        public Future getLoadBalancerStatistics(String uuid, ResponseHandler callback);

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

        public Future getObject(ResponseHandler callback);

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

        public Future serviceLoadBalancer(String data, ResponseHandler callback);

        /**
         * Async version of {@link Service#updateLoadBalancer}
         */
        public Future updateLoadBalancer(String uuid, String newDescription);

        public Future updateLoadBalancer(String uuid, String newDescription, ResponseHandler callback);

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

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

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

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

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

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

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

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

    }

    public static class Mask extends com.softlayer.api.service.Entity.Mask {

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

        public HealthMonitor.Mask healthMonitors() {
            return withSubMask("healthMonitors", HealthMonitor.Mask.class);
        }

        public Listener.Mask listeners() {
            return withSubMask("listeners", Listener.Mask.class);
        }

        public Member.Mask members() {
            return withSubMask("members", Member.Mask.class);
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy