diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java index 714cdd364c..a519295aab 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java @@ -18,112 +18,128 @@ */ package org.jclouds.cloudstack; -import org.jclouds.cloudstack.features.*; +import org.jclouds.cloudstack.features.AccountAsyncClient; +import org.jclouds.cloudstack.features.AddressAsyncClient; +import org.jclouds.cloudstack.features.AsyncJobAsyncClient; +import org.jclouds.cloudstack.features.ConfigurationAsyncClient; +import org.jclouds.cloudstack.features.FirewallAsyncClient; +import org.jclouds.cloudstack.features.GuestOSAsyncClient; +import org.jclouds.cloudstack.features.HypervisorAsyncClient; +import org.jclouds.cloudstack.features.LoadBalancerAsyncClient; +import org.jclouds.cloudstack.features.NATAsyncClient; +import org.jclouds.cloudstack.features.NetworkAsyncClient; +import org.jclouds.cloudstack.features.OfferingAsyncClient; +import org.jclouds.cloudstack.features.SSHKeyPairAsyncClient; +import org.jclouds.cloudstack.features.SecurityGroupAsyncClient; +import org.jclouds.cloudstack.features.TemplateAsyncClient; +import org.jclouds.cloudstack.features.VirtualMachineAsyncClient; +import org.jclouds.cloudstack.features.ZoneAsyncClient; import org.jclouds.rest.annotations.Delegate; /** * Provides asynchronous access to CloudStack via their REST API. *

- * + * * @author Adrian Cole * @see CloudStackClient * @see */ public interface CloudStackAsyncClient { - /** - * Provides asynchronous access to Zone features. - */ - @Delegate - ZoneAsyncClient getZoneClient(); + /** + * Provides asynchronous access to Zone features. + */ + @Delegate + ZoneAsyncClient getZoneClient(); - /** - * Provides asynchronous access to Template features. - */ - @Delegate - TemplateAsyncClient getTemplateClient(); + /** + * Provides asynchronous access to Template features. + */ + @Delegate + TemplateAsyncClient getTemplateClient(); - /** - * Provides asynchronous access to Service, Disk, and Network Offering features. - */ - @Delegate - OfferingAsyncClient getOfferingClient(); + /** + * Provides asynchronous access to Service, Disk, and Network Offering + * features. + */ + @Delegate + OfferingAsyncClient getOfferingClient(); - /** - * Provides asynchronous access to Network features. - */ - @Delegate - NetworkAsyncClient getNetworkClient(); + /** + * Provides asynchronous access to Network features. + */ + @Delegate + NetworkAsyncClient getNetworkClient(); - /** - * Provides asynchronous access to VirtualMachine features. - */ - @Delegate - VirtualMachineAsyncClient getVirtualMachineClient(); + /** + * Provides asynchronous access to VirtualMachine features. + */ + @Delegate + VirtualMachineAsyncClient getVirtualMachineClient(); - /** - * Provides asynchronous access to SecurityGroup features. - */ - @Delegate - SecurityGroupAsyncClient getSecurityGroupClient(); + /** + * Provides asynchronous access to SecurityGroup features. + */ + @Delegate + SecurityGroupAsyncClient getSecurityGroupClient(); - /** - * Provides asynchronous access to AsyncJob features. - */ - @Delegate - AsyncJobAsyncClient getAsyncJobClient(); + /** + * Provides asynchronous access to AsyncJob features. + */ + @Delegate + AsyncJobAsyncClient getAsyncJobClient(); - /** - * Provides asynchronous access to Address features. - */ - @Delegate - AddressAsyncClient getAddressClient(); + /** + * Provides asynchronous access to Address features. + */ + @Delegate + AddressAsyncClient getAddressClient(); - /** - * Provides asynchronous access to NAT features. - */ - @Delegate - NATAsyncClient getNATClient(); + /** + * Provides asynchronous access to NAT features. + */ + @Delegate + NATAsyncClient getNATClient(); - /** - * Provides asynchronous access to Firewall features. - */ - @Delegate - FirewallAsyncClient getFirewallClient(); + /** + * Provides asynchronous access to Firewall features. + */ + @Delegate + FirewallAsyncClient getFirewallClient(); - /** - * Provides asynchronous access to LoadBalancer features. - */ - @Delegate - LoadBalancerAsyncClient getLoadBalancerClient(); + /** + * Provides asynchronous access to LoadBalancer features. + */ + @Delegate + LoadBalancerAsyncClient getLoadBalancerClient(); - /** - * Provides asynchronous access to GuestOS features. - */ - @Delegate - GuestOSAsyncClient getGuestOSClient(); + /** + * Provides asynchronous access to GuestOS features. + */ + @Delegate + GuestOSAsyncClient getGuestOSClient(); - /** - * Provides asynchronous access to Hypervisor features. - */ - @Delegate - HypervisorAsyncClient getHypervisorClient(); + /** + * Provides asynchronous access to Hypervisor features. + */ + @Delegate + HypervisorAsyncClient getHypervisorClient(); - /** - * Provides asynchronous access to Configuration features. - */ - @Delegate - ConfigurationAsyncClient getConfigurationClient(); + /** + * Provides asynchronous access to Configuration features. + */ + @Delegate + ConfigurationAsyncClient getConfigurationClient(); - /** - * Provides asynchronous access to Account features. - */ - @Delegate - AccountAsyncClient getAccountClient(); + /** + * Provides asynchronous access to Account features. + */ + @Delegate + AccountAsyncClient getAccountClient(); - /** - * Provides asynchronous access to SSH Keypairs - */ - @Delegate - SSHKeyPairAsyncClient getSSHKeyPairClient(); + /** + * Provides asynchronous access to SSH Keypairs + */ + @Delegate + SSHKeyPairAsyncClient getSSHKeyPairClient(); } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackClient.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackClient.java index 338336a0e8..37763331fd 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackClient.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackClient.java @@ -18,12 +18,27 @@ */ package org.jclouds.cloudstack; -import org.jclouds.cloudstack.features.*; +import java.util.concurrent.TimeUnit; + +import org.jclouds.cloudstack.features.AccountClient; +import org.jclouds.cloudstack.features.AddressClient; +import org.jclouds.cloudstack.features.AsyncJobClient; +import org.jclouds.cloudstack.features.ConfigurationClient; +import org.jclouds.cloudstack.features.FirewallClient; +import org.jclouds.cloudstack.features.GuestOSClient; +import org.jclouds.cloudstack.features.HypervisorClient; +import org.jclouds.cloudstack.features.LoadBalancerClient; +import org.jclouds.cloudstack.features.NATClient; +import org.jclouds.cloudstack.features.NetworkClient; +import org.jclouds.cloudstack.features.OfferingClient; +import org.jclouds.cloudstack.features.SSHKeyPairClient; +import org.jclouds.cloudstack.features.SecurityGroupClient; +import org.jclouds.cloudstack.features.TemplateClient; +import org.jclouds.cloudstack.features.VirtualMachineClient; +import org.jclouds.cloudstack.features.ZoneClient; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -import java.util.concurrent.TimeUnit; - /** * Provides synchronous access to CloudStack. *

@@ -47,7 +62,8 @@ public interface CloudStackClient { TemplateClient getTemplateClient(); /** - * Provides synchronous access to Service, Disk, and Network Offering features. + * Provides synchronous access to Service, Disk, and Network Offering + * features. */ @Delegate OfferingClient getOfferingClient(); @@ -124,10 +140,10 @@ public interface CloudStackClient { @Delegate AccountClient getAccountClient(); - /** - * Provides synchronous access to SSH Keypairs - */ - @Delegate - SSHKeyPairClient getSSHKeyPairClient(); + /** + * Provides synchronous access to SSH Keypairs + */ + @Delegate + SSHKeyPairClient getSSHKeyPairClient(); } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackContextBuilder.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackContextBuilder.java index a048fd35dc..bd28432462 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackContextBuilder.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackContextBuilder.java @@ -30,8 +30,7 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class CloudStackContextBuilder extends - RestContextBuilder { +public class CloudStackContextBuilder extends RestContextBuilder { public CloudStackContextBuilder(Properties props) { super(CloudStackClient.class, CloudStackAsyncClient.class, props); diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/binders/BindAccountSecurityGroupPairsToIndexedQueryParams.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/binders/BindAccountSecurityGroupPairsToIndexedQueryParams.java index 2d8e0f3efe..3427a394cb 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/binders/BindAccountSecurityGroupPairsToIndexedQueryParams.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/binders/BindAccountSecurityGroupPairsToIndexedQueryParams.java @@ -33,8 +33,8 @@ import org.jclouds.http.utils.ModifyRequest; import org.jclouds.rest.Binder; import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; import com.google.common.collect.ImmutableMultimap.Builder; +import com.google.common.collect.Multimap; /** * @@ -58,11 +58,11 @@ public class BindAccountSecurityGroupPairsToIndexedQueryParams implements Binder UriBuilder builder = uriBuilderProvider.get(); builder.uri(request.getEndpoint()); Builder map = ImmutableMultimap. builder().putAll( - ModifyRequest.parseQueryToMap(request.getEndpoint().getQuery())); + ModifyRequest.parseQueryToMap(request.getEndpoint().getQuery())); int i = 0; for (Entry entry : pairs.entries()) map.put(String.format("usersecuritygrouplist[%d].account", i), entry.getKey()).put( - String.format("usersecuritygrouplist[%d].group", i++), entry.getValue()); + String.format("usersecuritygrouplist[%d].group", i++), entry.getValue()); builder.replaceQuery(ModifyRequest.makeQueryLine(map.build(), null)); return (R) request.toBuilder().endpoint(builder.build()).build(); } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java index 8f165a456a..3269a9a089 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java @@ -18,10 +18,42 @@ */ package org.jclouds.cloudstack.config; -import com.google.common.collect.ImmutableMap; +import java.util.Map; + import org.jclouds.cloudstack.CloudStackAsyncClient; import org.jclouds.cloudstack.CloudStackClient; -import org.jclouds.cloudstack.features.*; +import org.jclouds.cloudstack.features.AccountAsyncClient; +import org.jclouds.cloudstack.features.AccountClient; +import org.jclouds.cloudstack.features.AddressAsyncClient; +import org.jclouds.cloudstack.features.AddressClient; +import org.jclouds.cloudstack.features.AsyncJobAsyncClient; +import org.jclouds.cloudstack.features.AsyncJobClient; +import org.jclouds.cloudstack.features.ConfigurationAsyncClient; +import org.jclouds.cloudstack.features.ConfigurationClient; +import org.jclouds.cloudstack.features.FirewallAsyncClient; +import org.jclouds.cloudstack.features.FirewallClient; +import org.jclouds.cloudstack.features.GuestOSAsyncClient; +import org.jclouds.cloudstack.features.GuestOSClient; +import org.jclouds.cloudstack.features.HypervisorAsyncClient; +import org.jclouds.cloudstack.features.HypervisorClient; +import org.jclouds.cloudstack.features.LoadBalancerAsyncClient; +import org.jclouds.cloudstack.features.LoadBalancerClient; +import org.jclouds.cloudstack.features.NATAsyncClient; +import org.jclouds.cloudstack.features.NATClient; +import org.jclouds.cloudstack.features.NetworkAsyncClient; +import org.jclouds.cloudstack.features.NetworkClient; +import org.jclouds.cloudstack.features.OfferingAsyncClient; +import org.jclouds.cloudstack.features.OfferingClient; +import org.jclouds.cloudstack.features.SSHKeyPairAsyncClient; +import org.jclouds.cloudstack.features.SSHKeyPairClient; +import org.jclouds.cloudstack.features.SecurityGroupAsyncClient; +import org.jclouds.cloudstack.features.SecurityGroupClient; +import org.jclouds.cloudstack.features.TemplateAsyncClient; +import org.jclouds.cloudstack.features.TemplateClient; +import org.jclouds.cloudstack.features.VirtualMachineAsyncClient; +import org.jclouds.cloudstack.features.VirtualMachineClient; +import org.jclouds.cloudstack.features.ZoneAsyncClient; +import org.jclouds.cloudstack.features.ZoneClient; import org.jclouds.cloudstack.handlers.CloudStackErrorHandler; import org.jclouds.http.HttpErrorHandler; import org.jclouds.http.RequiresHttp; @@ -35,7 +67,7 @@ import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.config.RestClientModule; -import java.util.Map; +import com.google.common.collect.ImmutableMap; /** * Configures the cloudstack connection. diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java index 1051c16bb6..898309249c 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java @@ -114,13 +114,13 @@ public class AsyncJob { public AsyncJob build() { return new AsyncJob(accountId, cmd, created, id, instanceId, instanceType, progress, result, resultCode, - resultType, status, userId, error); + resultType, status, userId, error); } public static Builder fromAsyncJobUntyped(AsyncJob in) { - return new Builder().accountId(in.accountId).cmd(in.cmd).created(in.created).id(in.id).instanceId( - in.instanceId).instanceType(in.instanceType).progress(in.progress).result(in.result).resultCode( - in.resultCode).resultType(in.resultType).status(in.status).userId(in.userId).error(in.error); + return new Builder().accountId(in.accountId).cmd(in.cmd).created(in.created).id(in.id) + .instanceId(in.instanceId).instanceType(in.instanceType).progress(in.progress).result(in.result) + .resultCode(in.resultCode).resultType(in.resultType).status(in.status).userId(in.userId).error(in.error); } } @@ -149,7 +149,7 @@ public class AsyncJob { private AsyncJobError error; public AsyncJob(long accountId, String cmd, Date created, long id, long instanceId, String instanceType, - int progress, T result, int resultCode, String resultType, int status, int userId, AsyncJobError error) { + int progress, T result, int resultCode, String resultType, int status, int userId, AsyncJobError error) { this.accountId = accountId; this.cmd = cmd; this.created = created; @@ -260,7 +260,8 @@ public class AsyncJob { /** * * - * @return the error related to this command, or null if no error or error not yet encountered. + * @return the error related to this command, or null if no error or error + * not yet encountered. */ public AsyncJobError getError() { return error; @@ -345,9 +346,9 @@ public class AsyncJob { @Override public String toString() { return "[accountId=" + accountId + ", cmd=" + cmd + ", created=" + created + ", id=" + id + ", instanceId=" - + instanceId + ", instanceType=" + instanceType + ", error=" + error + ", progress=" + progress - + ", result=" + result + ", resultCode=" + resultCode + ", resultType=" + resultType + ", status=" - + status + ", userId=" + userId + "]"; + + instanceId + ", instanceType=" + instanceType + ", error=" + error + ", progress=" + progress + + ", result=" + result + ", resultCode=" + resultCode + ", resultType=" + resultType + ", status=" + status + + ", userId=" + userId + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capabilities.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capabilities.java index 2c18bea24d..1ccee5cfd0 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capabilities.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capabilities.java @@ -94,7 +94,8 @@ public class Capabilities { /** * - * @return true if user and domain admins can set templates to be shared, false otherwise + * @return true if user and domain admins can set templates to be shared, + * false otherwise */ public boolean isSharedTemplatesEnabled() { return canShareTemplates; @@ -134,6 +135,6 @@ public class Capabilities { @Override public String toString() { return "[cloudStackVersion=" + cloudStackVersion + ", canShareTemplates=" + canShareTemplates - + ", securityGroupsEnabled=" + securityGroupsEnabled + "]"; + + ", securityGroupsEnabled=" + securityGroupsEnabled + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/GuestIPType.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/GuestIPType.java index 04b7a34ab7..40a37186f6 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/GuestIPType.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/GuestIPType.java @@ -30,13 +30,13 @@ import com.google.common.base.CaseFormat; public enum GuestIPType { /** - * guest IP address will be issued by Dhcp server in the guest virtual network. Dhcp role is - * played by domain router. + * guest IP address will be issued by Dhcp server in the guest virtual + * network. Dhcp role is played by domain router. */ VIRTUAL, /** - * traffic directly to the network and VMs created here are assigned an IP directly from the - * network as configured + * traffic directly to the network and VMs created here are assigned an IP + * directly from the network as configured */ DIRECT, diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java index 7ef087b1ef..bf0db08ba6 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java @@ -93,7 +93,7 @@ public class IPForwardingRule implements Comparable { public IPForwardingRule build() { return new IPForwardingRule(id, IPAddress, IPAddressId, startPort, protocol, endPort, state, - virtualMachineDisplayName, virtualMachineId, virtualMachineName); + virtualMachineDisplayName, virtualMachineId, virtualMachineName); } } @@ -121,7 +121,7 @@ public class IPForwardingRule implements Comparable { } public IPForwardingRule(long id, String iPAddress, long iPAddressId, int startPort, String protocol, int endPort, - String state, String virtualMachineDisplayName, long virtualMachineId, String virtualMachineName) { + String state, String virtualMachineDisplayName, long virtualMachineId, String virtualMachineName) { this.id = id; this.IPAddress = iPAddress; this.IPAddressId = iPAddressId; @@ -286,9 +286,9 @@ public class IPForwardingRule implements Comparable { @Override public String toString() { return "[IPAddress=" + IPAddress + ", IPAddressId=" + IPAddressId + ", id=" + id + ", startPort=" + startPort - + ", protocol=" + protocol + ", endPort=" + endPort + ", state=" + state - + ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId - + ", virtualMachineName=" + virtualMachineName + "]"; + + ", protocol=" + protocol + ", endPort=" + endPort + ", state=" + state + ", virtualMachineDisplayName=" + + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId + ", virtualMachineName=" + + virtualMachineName + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java index cb57960026..016d39a5b3 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java @@ -115,13 +115,13 @@ public class IngressRule implements Comparable { } public IngressRule(String account, String CIDR, int endPort, int iCMPCode, int iCMPType, String protocol, long id, - String securityGroupName, int startPort) { + String securityGroupName, int startPort) { if (account == null) checkArgument(securityGroupName == null && CIDR != null, - "if you do not specify an account and security group, you must specify a CIDR range"); + "if you do not specify an account and security group, you must specify a CIDR range"); if (CIDR == null) checkArgument(account != null && securityGroupName != null, - "if you do not specify an account and security group, you must specify a CIDR range"); + "if you do not specify an account and security group, you must specify a CIDR range"); this.account = account; this.CIDR = CIDR; this.endPort = endPort; @@ -257,8 +257,8 @@ public class IngressRule implements Comparable { @Override public String toString() { return "[id=" + id + ", securityGroupName=" + securityGroupName + ", account=" + account + ", startPort=" - + startPort + ", endPort=" + endPort + ", protocol=" + protocol + ", CIDR=" + CIDR + ", ICMPCode=" - + ICMPCode + ", ICMPType=" + ICMPType + "]"; + + startPort + ", endPort=" + endPort + ", protocol=" + protocol + ", CIDR=" + CIDR + ", ICMPCode=" + + ICMPCode + ", ICMPType=" + ICMPType + "]"; } @Override diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java index 866945787f..201983d65e 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java @@ -142,7 +142,7 @@ public class LoadBalancerRule implements Comparable { public LoadBalancerRule build() { return new LoadBalancerRule(id, account, algorithm, description, domain, domainId, name, privatePort, - publicIP, publicIPId, publicPort, state); + publicIP, publicIPId, publicPort, state); } } @@ -170,7 +170,7 @@ public class LoadBalancerRule implements Comparable { } public LoadBalancerRule(long id, String account, Algorithm algorithm, String description, String domain, - long domainId, String name, int privatePort, String publicIP, long publicIPId, int publicPort, State state) { + long domainId, String name, int privatePort, String publicIP, long publicIPId, int publicPort, State state) { this.id = id; this.account = account; this.algorithm = algorithm; @@ -353,9 +353,9 @@ public class LoadBalancerRule implements Comparable { @Override public String toString() { return "[account=" + account + ", algorithm=" + algorithm + ", description=" + description + ", domain=" + domain - + ", domainId=" + domainId + ", id=" + id + ", name=" + name + ", privatePort=" + privatePort - + ", publicIP=" + publicIP + ", publicIPId=" + publicIPId + ", publicPort=" + publicPort + ", state=" - + state + "]"; + + ", domainId=" + domainId + ", id=" + id + ", name=" + name + ", privatePort=" + privatePort + + ", publicIP=" + publicIP + ", publicIPId=" + publicIPId + ", publicPort=" + publicPort + ", state=" + + state + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java index f337422c97..0ed1f64c33 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java @@ -18,21 +18,21 @@ */ package org.jclouds.cloudstack.domain; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedSet; -import com.google.gson.annotations.SerializedName; +import static com.google.common.base.Preconditions.checkNotNull; -import javax.annotation.Nullable; import java.net.URI; import java.util.List; import java.util.Set; import java.util.SortedSet; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSortedSet; +import com.google.gson.annotations.SerializedName; /** - * * @author Adrian Cole */ public class Network implements Comparable { @@ -244,7 +244,8 @@ public class Network implements Comparable { @SerializedName("issystem") private boolean isSystem; private String netmask; - @SerializedName("domain") + @Nullable + @SerializedName("networkdomain") private String networkDomain; @SerializedName("networkofferingavailability") private String networkOfferingAvailability; @@ -273,7 +274,6 @@ public class Network implements Comparable { /** * present only for serializer - * */ Network() { @@ -317,7 +317,6 @@ public class Network implements Comparable { } /** - * * @return network id */ public long getId() { @@ -325,7 +324,6 @@ public class Network implements Comparable { } /** - * * @return the name of the account to which the template beLongs */ public String getAccount() { @@ -333,7 +331,6 @@ public class Network implements Comparable { } /** - * * @return Broadcast domain type of the network */ public String getBroadcastDomainType() { @@ -341,7 +338,6 @@ public class Network implements Comparable { } /** - * * @return broadcast uri of the network */ public URI getBroadcastURI() { @@ -349,7 +345,6 @@ public class Network implements Comparable { } /** - * * @return the display text of the zone */ public String getDisplayText() { @@ -357,7 +352,6 @@ public class Network implements Comparable { } /** - * * @return the external DNS for the network */ public List getDNS() { @@ -370,7 +364,6 @@ public class Network implements Comparable { } /** - * * @return Domain name for the Vms in the zone */ public String getDomain() { @@ -378,7 +371,6 @@ public class Network implements Comparable { } /** - * * @return the ID of the containing domain, null for public zones */ @Nullable @@ -387,7 +379,6 @@ public class Network implements Comparable { } /** - * * @return the end ip of the network */ public String getEndIP() { @@ -395,7 +386,6 @@ public class Network implements Comparable { } /** - * * @return the network's gateway */ public String getGateway() { @@ -403,7 +393,6 @@ public class Network implements Comparable { } /** - * * @return true if network offering is default, false otherwise */ public boolean isDefault() { @@ -411,7 +400,6 @@ public class Network implements Comparable { } /** - * * @return true if network offering is shared, false otherwise */ public boolean isShared() { @@ -419,7 +407,6 @@ public class Network implements Comparable { } /** - * * @return true if network offering is system, false otherwise */ public boolean isSystem() { @@ -427,7 +414,6 @@ public class Network implements Comparable { } /** - * * @return network name */ public String getName() { @@ -435,7 +421,6 @@ public class Network implements Comparable { } /** - * * @return the GuestIPType of the network */ public GuestIPType getGuestIPType() { @@ -443,7 +428,6 @@ public class Network implements Comparable { } /** - * * @return state of the network */ public String getState() { @@ -451,7 +435,6 @@ public class Network implements Comparable { } /** - * * @return the vlan range of the zone */ public String getVLAN() { @@ -459,7 +442,6 @@ public class Network implements Comparable { } /** - * * @return the traffic type for this network offering */ public TrafficType getTrafficType() { @@ -467,7 +449,6 @@ public class Network implements Comparable { } /** - * * @return the network's netmask */ public String getNetmask() { @@ -475,7 +456,6 @@ public class Network implements Comparable { } /** - * * @return the network domain */ public String getNetworkDomain() { @@ -483,7 +463,6 @@ public class Network implements Comparable { } /** - * * @return availability of the network offering the network is created from */ public String getNetworkOfferingAvailability() { @@ -491,7 +470,6 @@ public class Network implements Comparable { } /** - * * @return display text of the network offering the network is created from */ public String getNetworkOfferingDisplayText() { @@ -499,7 +477,6 @@ public class Network implements Comparable { } /** - * * @return network offering id the network is created from */ public long getNetworkOfferingId() { @@ -507,7 +484,6 @@ public class Network implements Comparable { } /** - * * @return name of the network offering the network is created from */ public String getNetworkOfferingName() { @@ -515,7 +491,6 @@ public class Network implements Comparable { } /** - * * @return related to what other network configuration */ public long getRelated() { @@ -523,7 +498,6 @@ public class Network implements Comparable { } /** - * * @return the start ip of the network */ public String getStartIP() { @@ -531,7 +505,6 @@ public class Network implements Comparable { } /** - * * @return zone id of the network */ public long getZoneId() { @@ -539,7 +512,6 @@ public class Network implements Comparable { } /** - * * @return the list of services */ public Set getServices() { @@ -716,7 +688,7 @@ public class Network implements Comparable { + account + ", startIP=" + startIP + ", endIP=" + endIP + ", netmask=" + netmask + ", gateway=" + gateway + ", broadcastDomainType=" + broadcastDomainType + ", broadcastURI=" + broadcastURI + ", services=" + services + ", domain=" + domain + ", domainId=" + domainId + ", isDefault=" + isDefault + ", isShared=" - + isShared + ", isSystem=" + isSystem + ", related=" + related + ", zoneId=" + zoneId + ", networkDomain=" + + isShared + ", isSystem=" + isSystem + ", related=" + related + ", zoneId=" + zoneId + ", domain=" + networkDomain + ", networkOfferingAvailability=" + networkOfferingAvailability + ", networkOfferingDisplayText=" + networkOfferingDisplayText + ", networkOfferingId=" + networkOfferingId + ", networkOfferingName=" + networkOfferingName + "]"; diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java index 61def29291..2ac82d58e3 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java @@ -93,7 +93,7 @@ public class PortForwardingRule implements Comparable { public PortForwardingRule build() { return new PortForwardingRule(id, IPAddress, IPAddressId, privatePort, protocol, publicPort, state, - virtualMachineDisplayName, virtualMachineId, virtualMachineName); + virtualMachineDisplayName, virtualMachineId, virtualMachineName); } } @@ -121,14 +121,14 @@ public class PortForwardingRule implements Comparable { } public PortForwardingRule(long id, String iPAddress, long iPAddressId, int privatePort, String protocol, - int publicPort, String state, String virtualMachineDisplayName, long virtualMachineId, - String virtualMachineName) { + int publicPort, String state, String virtualMachineDisplayName, long virtualMachineId, + String virtualMachineName) { this.id = id; this.IPAddress = iPAddress; this.IPAddressId = iPAddressId; this.privatePort = privatePort; this.protocol = protocol; - this.publicPort = publicPort+""; + this.publicPort = publicPort + ""; this.state = state; this.virtualMachineDisplayName = virtualMachineDisplayName; this.virtualMachineId = virtualMachineId; @@ -290,9 +290,9 @@ public class PortForwardingRule implements Comparable { @Override public String toString() { return "[IPAddress=" + IPAddress + ", IPAddressId=" + IPAddressId + ", id=" + id + ", privatePort=" + privatePort - + ", protocol=" + protocol + ", publicPort=" + publicPort + ", state=" + state - + ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId - + ", virtualMachineName=" + virtualMachineName + "]"; + + ", protocol=" + protocol + ", publicPort=" + publicPort + ", state=" + state + + ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId + + ", virtualMachineName=" + virtualMachineName + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java index f9da9224a5..3fba1ad166 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java @@ -153,8 +153,8 @@ public class PublicIPAddress implements Comparable { public PublicIPAddress build() { return new PublicIPAddress(id, account, allocated, associatedNetworkId, domain, domainId, usesVirtualNetwork, - IPAddress, isSourceNAT, isStaticNAT, networkId, state, virtualMachineDisplayName, virtualMachineId, - virtualMachineName, VLANId, VLANName, zoneId, zoneName); + IPAddress, isSourceNAT, isStaticNAT, networkId, state, virtualMachineDisplayName, virtualMachineId, + virtualMachineName, VLANId, VLANName, zoneId, zoneName); } } @@ -215,9 +215,9 @@ public class PublicIPAddress implements Comparable { } public PublicIPAddress(long id, String account, Date allocated, long associatedNetworkId, String domain, - long domainId, boolean usesVirtualNetwork, String iPAddress, boolean isSourceNAT, boolean isStaticNAT, - long networkId, State state, String virtualMachineDisplayName, long virtualMachineId, - String virtualMachineName, long VLANId, String VLANName, long zoneId, String zoneName) { + long domainId, boolean usesVirtualNetwork, String iPAddress, boolean isSourceNAT, boolean isStaticNAT, + long networkId, State state, String virtualMachineDisplayName, long virtualMachineId, + String virtualMachineName, long VLANId, String VLANName, long zoneId, String zoneName) { this.id = id; this.account = account; this.allocated = allocated; @@ -333,7 +333,8 @@ public class PublicIPAddress implements Comparable { /** * - * @return State of the ip address. Can be: Allocating, Allocated and Releasing + * @return State of the ip address. Can be: Allocating, Allocated and + * Releasing */ public State getState() { return state; @@ -341,8 +342,8 @@ public class PublicIPAddress implements Comparable { /** * - * @return virtual machine display name the ip address is assigned to (not null only for static - * nat Ip) + * @return virtual machine display name the ip address is assigned to (not + * null only for static nat Ip) */ public String getVirtualMachineDisplayName() { return virtualMachineDisplayName; @@ -350,7 +351,8 @@ public class PublicIPAddress implements Comparable { /** * - * @return virtual machine id the ip address is assigned to (not null only for static nat Ip) + * @return virtual machine id the ip address is assigned to (not null only + * for static nat Ip) */ public long getVirtualMachineId() { return virtualMachineId; @@ -358,7 +360,8 @@ public class PublicIPAddress implements Comparable { /** * - * @return virtual machine name the ip address is assigned to (not null only for static nat Ip) + * @return virtual machine name the ip address is assigned to (not null only + * for static nat Ip) */ public String getVirtualMachineName() { return virtualMachineName; @@ -502,11 +505,11 @@ public class PublicIPAddress implements Comparable { @Override public String toString() { return "[id=" + id + ", IPAddress=" + IPAddress + ", VLANId=" + VLANId + ", VLANName=" + VLANName + ", account=" - + account + ", allocated=" + allocated + ", associatedNetworkId=" + associatedNetworkId + ", domain=" - + domain + ", domainId=" + domainId + ", usesVirtualNetwork=" + usesVirtualNetwork + ", isSourceNAT=" - + isSourceNAT + ", isStaticNAT=" + isStaticNAT + ", networkId=" + networkId + ", state=" + state - + ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId - + ", virtualMachineName=" + virtualMachineName + ", zoneId=" + zoneId + ", zoneName=" + zoneName + "]"; + + account + ", allocated=" + allocated + ", associatedNetworkId=" + associatedNetworkId + ", domain=" + + domain + ", domainId=" + domainId + ", usesVirtualNetwork=" + usesVirtualNetwork + ", isSourceNAT=" + + isSourceNAT + ", isStaticNAT=" + isStaticNAT + ", networkId=" + networkId + ", state=" + state + + ", virtualMachineDisplayName=" + virtualMachineDisplayName + ", virtualMachineId=" + virtualMachineId + + ", virtualMachineName=" + virtualMachineName + ", zoneId=" + zoneId + ", zoneName=" + zoneName + "]"; } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java index b400479989..ca181ea0e7 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SshKeyPair.java @@ -4,113 +4,111 @@ import com.google.gson.annotations.SerializedName; public class SSHKeyPair implements Comparable { - public static Builder builder() { - return new Builder(); - } + public static Builder builder() { + return new Builder(); + } - public static class Builder { + public static class Builder { - private String fingerprint; - private String name; - private String privateKey; + private String fingerprint; + private String name; + private String privateKey; - public Builder fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } + public Builder fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } - public Builder name(String name) { - this.name = name; - return this; - } + public Builder name(String name) { + this.name = name; + return this; + } - public Builder privateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } + public Builder privateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + public SSHKeyPair build() { + return new SSHKeyPair(fingerprint, name, privateKey); + } + } - public SSHKeyPair build() { - return new SSHKeyPair(fingerprint, name, privateKey); - } - } + // for deserialization + SSHKeyPair() { - // for deserialization - SSHKeyPair() { + } - } + private String fingerprint; + private String name; + @SerializedName("privatekey") + private String privateKey; - private String fingerprint; - private String name; - @SerializedName("privatekey") - private String privateKey; + public SSHKeyPair(String fingerprint, String name, String privateKey) { + this.fingerprint = fingerprint; + this.name = name; + this.privateKey = privateKey; + } - public SSHKeyPair(String fingerprint, String name, String privateKey) { - this.fingerprint = fingerprint; - this.name = name; - this.privateKey = privateKey; - } + public String getFingerprint() { + return fingerprint; + } - public String getFingerprint() { - return fingerprint; - } + public String getName() { + return name; + } - public String getName() { - return name; - } + public String getPrivateKey() { + return privateKey; + } - public String getPrivateKey() { - return privateKey; - } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((privateKey == null) ? 0 : privateKey.hashCode()); - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((privateKey == null) ? 0 : privateKey.hashCode()); + return result; + } - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + SSHKeyPair other = (SSHKeyPair) obj; + if (fingerprint == null) { + if (other.fingerprint != null) return false; - if (getClass() != obj.getClass()) + } else if (!fingerprint.equals(other.fingerprint)) + return false; + if (name == null) { + if (other.name != null) return false; - SSHKeyPair other = (SSHKeyPair) obj; - if (fingerprint == null) { - if (other.fingerprint != null) - return false; - } else if (!fingerprint.equals(other.fingerprint)) - return false; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - if (privateKey == null) { - if (other.privateKey != null) - return false; - } else if (!privateKey.equals(other.privateKey)) + } else if (!name.equals(other.name)) + return false; + if (privateKey == null) { + if (other.privateKey != null) return false; + } else if (!privateKey.equals(other.privateKey)) + return false; - return true; - } + return true; + } - @Override - public String toString() { - return "[fingerprint=" + fingerprint + ", name=" + name + "]"; - } - - @Override - public int compareTo(SSHKeyPair arg0) { - return fingerprint.compareTo(arg0.getFingerprint()); - } + @Override + public String toString() { + return "[fingerprint=" + fingerprint + ", name=" + name + "]"; + } + @Override + public int compareTo(SSHKeyPair arg0) { + return fingerprint.compareTo(arg0.getFingerprint()); + } } diff --git a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java index 91ff266e74..a1af5bdb7d 100644 --- a/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java +++ b/sandbox-apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java @@ -523,8 +523,8 @@ public class Template implements Comparable