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

com.softlayer.api.service.network.customer.Subnet Maven / Gradle / Ivy

The newest version!
package com.softlayer.api.service.network.customer;

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.network.customer.subnet.IpAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The SoftLayer_Network_Customer_Subnet data type contains general information relating to a single customer subnet (remote). 
 *
 * @see SoftLayer_Network_Customer_Subnet
 */
@ApiType("SoftLayer_Network_Customer_Subnet")
public class Subnet extends Entity {

    /**
     * All ip addresses associated with a subnet.
     */
    @ApiProperty
    protected List ipAddresses;

    public List getIpAddresses() {
        if (ipAddresses == null) {
            ipAddresses = new ArrayList();
        }
        return ipAddresses;
    }

    /**
     * The account id a customer subnet 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;
    }

    /**
     * A subnet's Classless Inter-Domain Routing prefix. This is a number between 0 and 32 signifying the number of bits in a subnet's netmask. These bits separate a subnet's network address from it's host addresses. It performs the same function as the ''netmask'' property, but is represented as an integer. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long cidr;

    public Long getCidr() {
        return cidr;
    }

    public void setCidr(Long cidr) {
        cidrSpecified = true;
        this.cidr = cidr;
    }

    protected boolean cidrSpecified;

    public boolean isCidrSpecified() {
        return cidrSpecified;
    }

    public void unsetCidr() {
        cidr = null;
        cidrSpecified = false;
    }

    /**
     * A customer subnet's unique 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 bitmask in dotted-quad format that is used to separate a subnet's network address from it's host addresses. This performs the same function as the ''cidr'' property, but is expressed in a string format. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String netmask;

    public String getNetmask() {
        return netmask;
    }

    public void setNetmask(String netmask) {
        netmaskSpecified = true;
        this.netmask = netmask;
    }

    protected boolean netmaskSpecified;

    public boolean isNetmaskSpecified() {
        return netmaskSpecified;
    }

    public void unsetNetmask() {
        netmask = null;
        netmaskSpecified = false;
    }

    /**
     * A subnet's network identifier. This is the first IP address of a subnet. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String networkIdentifier;

    public String getNetworkIdentifier() {
        return networkIdentifier;
    }

    public void setNetworkIdentifier(String networkIdentifier) {
        networkIdentifierSpecified = true;
        this.networkIdentifier = networkIdentifier;
    }

    protected boolean networkIdentifierSpecified;

    public boolean isNetworkIdentifierSpecified() {
        return networkIdentifierSpecified;
    }

    public void unsetNetworkIdentifier() {
        networkIdentifier = null;
        networkIdentifierSpecified = false;
    }

    /**
     * The total number of ip addresses in a subnet.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long totalIpAddresses;

    public Long getTotalIpAddresses() {
        return totalIpAddresses;
    }

    public void setTotalIpAddresses(Long totalIpAddresses) {
        totalIpAddressesSpecified = true;
        this.totalIpAddresses = totalIpAddresses;
    }

    protected boolean totalIpAddressesSpecified;

    public boolean isTotalIpAddressesSpecified() {
        return totalIpAddressesSpecified;
    }

    public void unsetTotalIpAddresses() {
        totalIpAddresses = null;
        totalIpAddressesSpecified = false;
    }

    /**
     * A count of all ip addresses associated with a subnet.
     */
    @ApiProperty
    protected Long ipAddressCount;

    public Long getIpAddressCount() {
        return ipAddressCount;
    }

    public void setIpAddressCount(Long ipAddressCount) {
        this.ipAddressCount = ipAddressCount;
    }

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

    /**
     * Every Customer subnet is defined in the SoftLayer_Network_Customer_Subnet service. SoftLayer keeps track of subnets outside of the SoftLayer Network that are associated to SoftLayer subnets or systems. 
*
* For example, customer subnets are tracked for proper management of network tunnels. This service allows for managing subnets on the remote end of the network tunnel. * * @see SoftLayer_Network_Customer_Subnet */ @com.softlayer.api.annotation.ApiService("SoftLayer_Network_Customer_Subnet") public static interface Service extends com.softlayer.api.Service { public ServiceAsync asAsync(); public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * For IPSec network tunnels, customers can create their local subnets using this method. After the customer is created successfully, the customer subnet can then be added to the IPSec network tunnel. * * @see SoftLayer_Network_Customer_Subnet::createObject */ @ApiMethod public Subnet createObject(Subnet templateObject); /** * getObject retrieves the SoftLayer_Network_Customer_Subnet object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Network_Customer_Subnet service. You can only retrieve the subnet whose account matches the account that your portal user is assigned to. * * @see SoftLayer_Network_Customer_Subnet::getObject */ @ApiMethod(instanceRequired = true) public Subnet getObject(); /** * All ip addresses associated with a subnet. * * @see SoftLayer_Network_Customer_Subnet::getIpAddresses */ @ApiMethod(instanceRequired = true) public List getIpAddresses(); } 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#createObject} */ public Future createObject(Subnet templateObject); public Future createObject(Subnet templateObject, ResponseHandler callback); /** * Async version of {@link Service#getObject} */ public Future getObject(); public Future getObject(ResponseHandler callback); /** * Async version of {@link Service#getIpAddresses} */ public Future> getIpAddresses(); /** * Async callback version of {@link Service#getIpAddresses} */ public Future getIpAddresses(ResponseHandler> callback); } public static class Mask extends com.softlayer.api.service.Entity.Mask { public com.softlayer.api.service.network.customer.subnet.IpAddress.Mask ipAddresses() { return withSubMask("ipAddresses", com.softlayer.api.service.network.customer.subnet.IpAddress.Mask.class); } public Mask accountId() { withLocalProperty("accountId"); return this; } public Mask cidr() { withLocalProperty("cidr"); return this; } public Mask id() { withLocalProperty("id"); return this; } public Mask netmask() { withLocalProperty("netmask"); return this; } public Mask networkIdentifier() { withLocalProperty("networkIdentifier"); return this; } public Mask totalIpAddresses() { withLocalProperty("totalIpAddresses"); return this; } public Mask ipAddressCount() { withLocalProperty("ipAddressCount"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy