diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/AllowedArgumentsForCreateServer.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/AllowedArgumentsForCreateServer.java
index 068bb6bba7..8769902833 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/AllowedArgumentsForCreateServer.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/AllowedArgumentsForCreateServer.java
@@ -20,15 +20,15 @@ package org.jclouds.glesys.domain;
import static com.google.common.base.Preconditions.checkNotNull;
-import java.util.Arrays;
-import java.util.List;
+import java.util.Set;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
/**
- * Lists the allowed arguments for some of the functions in this module such as disksize, cpucores etc.
+ * Sets the allowed arguments for some of the functions in this module such as disksize, cpucores etc.
*
* @author Adam Lowe
* @see
@@ -39,64 +39,64 @@ public class AllowedArgumentsForCreateServer {
}
public static class Builder {
- private List diskSizes;
- private List memorySizes;
- private List cpuCores;
- private List templates;
- private List transfers;
- private List dataCenters;
+ private Set diskSizes;
+ private Set memorySizes;
+ private Set cpuCores;
+ private Set templates;
+ private Set transfers;
+ private Set dataCenters;
public Builder diskSizes(Integer... sizes) {
- return diskSizes(Arrays.asList(sizes));
+ return diskSizes(ImmutableSet.copyOf(sizes));
}
- public Builder diskSizes(List sizes) {
+ public Builder diskSizes(Set sizes) {
this.diskSizes = sizes;
return this;
}
public Builder memorySizes(Integer... sizes) {
- return memorySizes(Arrays.asList(sizes));
+ return memorySizes(ImmutableSet.copyOf(sizes));
}
- public Builder memorySizes(List sizes) {
+ public Builder memorySizes(Set sizes) {
this.memorySizes = sizes;
return this;
}
public Builder cpuCores(Integer... cpuCores) {
- this.cpuCores = Arrays.asList(cpuCores);
+ this.cpuCores = ImmutableSet.copyOf(cpuCores);
return this;
}
- public Builder cpuCores(List cpuCores) {
+ public Builder cpuCores(Set cpuCores) {
this.cpuCores = cpuCores;
return this;
}
public Builder templates(String... templates) {
- return templates(Arrays.asList(templates));
+ return templates(ImmutableSet.copyOf(templates));
}
- public Builder templates(List templates) {
+ public Builder templates(Set templates) {
this.templates = templates;
return this;
}
public Builder transfers(Integer... transfers) {
- return transfers(Arrays.asList(transfers));
+ return transfers(ImmutableSet.copyOf(transfers));
}
- public Builder transfers(List transfers) {
+ public Builder transfers(Set transfers) {
this.transfers = transfers;
return this;
}
public Builder dataCenters(String... dataCenters) {
- return dataCenters(Arrays.asList(dataCenters));
+ return dataCenters(ImmutableSet.copyOf(dataCenters));
}
- public Builder dataCenters(List dataCenters) {
+ public Builder dataCenters(Set dataCenters) {
this.dataCenters = dataCenters;
return this;
}
@@ -106,30 +106,30 @@ public class AllowedArgumentsForCreateServer {
}
public Builder fromAllowedArguments(AllowedArgumentsForCreateServer in) {
- return diskSizes(in.getDiskSizes())
- .memorySizes(in.getMemorySizes())
- .cpuCores(in.getCpuCores())
- .templates(in.getTemplates())
- .transfers(in.getTransfers())
+ return diskSizes(in.getDiskSizesInGB())
+ .memorySizes(in.getMemorySizesInMB())
+ .cpuCores(in.getCpuCoreOptions())
+ .templates(in.getTemplateNames())
+ .transfers(in.getTransfersInGB())
.dataCenters(in.getDataCenters());
}
}
@SerializedName("disksize")
- private final List diskSizes;
+ private final Set diskSizes;
@SerializedName("memorysize")
- private final List memorySizes;
+ private final Set memorySizes;
@SerializedName("cpucores")
- private final List cpuCores;
+ private final Set cpuCores;
@SerializedName("template")
- private final List templates;
+ private final Set templates;
@SerializedName("transfer")
- private final List transfers;
+ private final Set transfers;
@SerializedName("datacenter")
- private final List dataCenters;
+ private final Set dataCenters;
- public AllowedArgumentsForCreateServer(List diskSizes, List memorySizes, List cpuCores,
- List templates, List transfers, List dataCenters) {
+ public AllowedArgumentsForCreateServer(Set diskSizes, Set memorySizes, Set cpuCores,
+ Set templates, Set transfers, Set dataCenters) {
checkNotNull(diskSizes, "diskSizes");
checkNotNull(memorySizes, "memorySizes");
checkNotNull(cpuCores, "cpuCores");
@@ -147,46 +147,46 @@ public class AllowedArgumentsForCreateServer {
/**
* @return a list of disk sizes, in GB, that can be used for creating servers on this platform
- * @see org.jclouds.glesys.domain.Template#getMinDiskSize()
+ * @see org.jclouds.glesys.domain.OSTemplate#getMinDiskSize()
*/
- public List getDiskSizes() {
+ public Set getDiskSizesInGB() {
return diskSizes;
}
/**
* @return a list of memory sizes, in MB, that can be used for creating servers on this platform
- * @see org.jclouds.glesys.domain.Template#getMinMemSize()
+ * @see org.jclouds.glesys.domain.OSTemplate#getMinMemSize()
*/
- public List getMemorySizes() {
+ public Set getMemorySizesInMB() {
return memorySizes;
}
/**
* @return a list of which core counts can be used for creating servers on this platform
*/
- public List getCpuCores() {
+ public Set getCpuCoreOptions() {
return cpuCores;
}
/**
* @return a list of template names available for creating servers on this platform
- * @see org.jclouds.glesys.domain.Template#getName()
+ * @see org.jclouds.glesys.domain.OSTemplate#getName()
*/
- public List getTemplates() {
+ public Set getTemplateNames() {
return templates;
}
/**
* @return the list of transfer settings available for creating servers on this platform
*/
- public List getTransfers() {
+ public Set getTransfersInGB() {
return transfers;
}
/**
* @return the list of datacenters available that support creating servers on this platform
*/
- public List getDataCenters() {
+ public Set getDataCenters() {
return dataCenters;
}
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Template.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/OSTemplate.java
similarity index 88%
rename from sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Template.java
rename to sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/OSTemplate.java
index e068f7ceae..e516280554 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/Template.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/OSTemplate.java
@@ -28,7 +28,7 @@ import com.google.gson.annotations.SerializedName;
* @author Adam Lowe
* @see
*/
-public class Template implements Comparable{
+public class OSTemplate implements Comparable{
public static Builder builder() {
return new Builder();
@@ -66,11 +66,11 @@ public class Template implements Comparable{
return this;
}
- public Template build() {
- return new Template(name, minDiskSize, minMemSize, os, platform);
+ public OSTemplate build() {
+ return new OSTemplate(name, minDiskSize, minMemSize, os, platform);
}
- public Builder fromTemplate(Template in) {
+ public Builder fromTemplate(OSTemplate in) {
return name(in.getName()).minDiskSize(in.getMinDiskSize()).minMemSize(in.getMinMemSize()).os(in.getOs()).platform(in.getPlatform());
}
@@ -85,7 +85,7 @@ public class Template implements Comparable{
private final String os;
private final String platform;
- public Template(String name, int minDiskSize, int minMemSize, String os, String platform) {
+ public OSTemplate(String name, int minDiskSize, int minMemSize, String os, String platform) {
this.name = name;
this.minDiskSize = minDiskSize;
this.minMemSize = minMemSize;
@@ -99,7 +99,7 @@ public class Template implements Comparable{
/**
* @return the minimum allowed disk size in GB
- * @see org.jclouds.glesys.domain.AllowedArgumentsForCreateServer#getDiskSizes()
+ * @see org.jclouds.glesys.domain.AllowedArgumentsForCreateServer#getDiskSizesInGB()
*/
public int getMinDiskSize() {
return minDiskSize;
@@ -107,7 +107,7 @@ public class Template implements Comparable{
/**
* @return the minimum allowed memory size in MB
- * @see org.jclouds.glesys.domain.AllowedArgumentsForCreateServer#getMemorySizes()
+ * @see org.jclouds.glesys.domain.AllowedArgumentsForCreateServer#getMemorySizesInMB()
*/
public int getMinMemSize() {
return minMemSize;
@@ -132,8 +132,8 @@ public class Template implements Comparable{
if (this == object) {
return true;
}
- if (object instanceof Template) {
- final Template other = (Template) object;
+ if (object instanceof OSTemplate) {
+ final OSTemplate other = (OSTemplate) object;
return Objects.equal(name, other.name)
&& Objects.equal(platform, other.platform);
} else {
@@ -153,7 +153,7 @@ public class Template implements Comparable{
}
@Override
- public int compareTo(Template arg0) {
+ public int compareTo(OSTemplate arg0) {
return Ordering.usingToString().compare(this, arg0);
}
}
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java
index 5eabb41a00..5a5c8a3b7b 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java
@@ -97,7 +97,7 @@ public class ServerDetails extends Server {
}
public Builder fromServerDetails(ServerDetails in) {
- return fromServer(in).templateName(in.getTemplateName()).memorySize(in.getMemorySize()).diskSize(in.getDiskSize()).cpuCores(in.getCpuCores()).cost(in.getCost())
+ return fromServer(in).templateName(in.getTemplateName()).memorySize(in.getMemorySizeMB()).diskSize(in.getDiskSizeGB()).cpuCores(in.getCpuCores()).cost(in.getCost())
.description(in.getDescription()).ips(in.getIps());
}
@@ -171,21 +171,21 @@ public class ServerDetails extends Server {
/**
* @return the disk of the server in GB
*/
- public int getDiskSize() {
+ public int getDiskSizeGB() {
return diskSize;
}
/**
* @return the memory of the server in MB
*/
- public int getMemorySize() {
+ public int getMemorySizeMB() {
return memorySize;
}
/**
* @return the transfer of the server
*/
- public int getTransfer() {
+ public int getTransferGB() {
return transfer;
}
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java
index cc4fff5b05..ef505efbdf 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java
@@ -46,7 +46,7 @@ public class ServerSpec {
protected int diskSizeGB;
protected int memorySizeMB;
protected int cpuCores;
- protected int transfer;
+ protected int transferGB;
public Builder datacenter(String datacenter) {
this.datacenter = datacenter;
@@ -78,19 +78,19 @@ public class ServerSpec {
return this;
}
- public Builder transfer(int transfer) {
- this.transfer = transfer;
+ public Builder transferGB(int transferGB) {
+ this.transferGB = transferGB;
return this;
}
public ServerSpec build() {
- return new ServerSpec(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transfer);
+ return new ServerSpec(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transferGB);
}
public static Builder fromServerSpecification(ServerSpec in) {
return new Builder().platform(in.getPlatform()).datacenter(in.getDatacenter())
.memorySizeMB(in.getMemorySizeMB()).diskSizeGB(in.getDiskSizeGB()).templateName(in.getTemplateName())
- .cpuCores(in.getCpuCores()).transfer(in.getTransfer());
+ .cpuCores(in.getCpuCores()).transferGB(in.getTransferGB());
}
}
@@ -100,17 +100,17 @@ public class ServerSpec {
protected final int diskSizeGB;
protected final String templateName;
protected final int cpuCores;
- protected final int transfer;
+ protected final int transferGB;
protected ServerSpec(String platform, String datacenter, int memorySizeMB, int diskSizeGB, String templateName,
- int cpuCores, int transfer) {
+ int cpuCores, int transferGB) {
this.platform = checkNotNull(platform, "platform");
this.datacenter = checkNotNull(datacenter, "datacenter");
this.memorySizeMB = memorySizeMB;
this.diskSizeGB = diskSizeGB;
this.templateName = checkNotNull(templateName, "templateName");
this.cpuCores = cpuCores;
- this.transfer = transfer;
+ this.transferGB = transferGB;
}
/**
@@ -156,10 +156,10 @@ public class ServerSpec {
}
/**
- * @return number of transfer
+ * @return bandwidth of in GB
*/
- public int getTransfer() {
- return transfer;
+ public int getTransferGB() {
+ return transferGB;
}
@Override
@@ -172,7 +172,7 @@ public class ServerSpec {
return equal(platform, that.platform) && equal(datacenter, that.datacenter)
&& equal(memorySizeMB, that.memorySizeMB) && equal(diskSizeGB, that.diskSizeGB)
&& equal(templateName, that.templateName) && equal(cpuCores, that.cpuCores)
- && equal(transfer, that.transfer);
+ && equal(transferGB, that.transferGB);
} else {
return false;
}
@@ -180,13 +180,13 @@ public class ServerSpec {
@Override
public int hashCode() {
- return Objects.hashCode(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transfer);
+ return Objects.hashCode(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transferGB);
}
@Override
public String toString() {
return toStringHelper("").add("platform", platform).add("datacenter", datacenter)
.add("templateName", templateName).add("cpuCores", cpuCores).add("cpuCores", cpuCores)
- .add("diskSizeGB", diskSizeGB).add("transfer", transfer).toString();
+ .add("diskSizeGB", diskSizeGB).add("transferGB", transferGB).toString();
}
}
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
index 41fdaf4b0a..dbcf00029f 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
@@ -36,7 +36,7 @@ import org.jclouds.glesys.domain.ServerDetails;
import org.jclouds.glesys.domain.ServerLimit;
import org.jclouds.glesys.domain.ServerSpec;
import org.jclouds.glesys.domain.ServerStatus;
-import org.jclouds.glesys.domain.Template;
+import org.jclouds.glesys.domain.OSTemplate;
import org.jclouds.glesys.functions.ParseTemplatesFromHttpResponse;
import org.jclouds.glesys.options.CloneServerOptions;
import org.jclouds.glesys.options.CreateServerOptions;
@@ -134,7 +134,7 @@ public interface ServerAsyncClient {
@Path("/server/templates/format/json")
@ResponseParser(ParseTemplatesFromHttpResponse.class)
@Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture> getTemplates();
+ ListenableFuture> listTemplates();
/**
* @see ServerClient#stopServer
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerClient.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerClient.java
index 6ed82830d2..166ad9d8ee 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerClient.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerClient.java
@@ -30,7 +30,7 @@ import org.jclouds.glesys.domain.ServerDetails;
import org.jclouds.glesys.domain.ServerLimit;
import org.jclouds.glesys.domain.ServerSpec;
import org.jclouds.glesys.domain.ServerStatus;
-import org.jclouds.glesys.domain.Template;
+import org.jclouds.glesys.domain.OSTemplate;
import org.jclouds.glesys.options.CloneServerOptions;
import org.jclouds.glesys.options.CreateServerOptions;
import org.jclouds.glesys.options.DestroyServerOptions;
@@ -105,7 +105,7 @@ public interface ServerClient {
*
* @return the set of information about each template
*/
- Set getTemplates();
+ Set listTemplates();
/**
* Get information about valid arguments to #createServer for each platform
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java
index 765d76177b..be87e2adfd 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java
@@ -25,7 +25,7 @@ import java.util.Set;
import javax.inject.Singleton;
-import org.jclouds.glesys.domain.Template;
+import org.jclouds.glesys.domain.OSTemplate;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseFirstJsonValueNamed;
import org.jclouds.json.internal.GsonWrapper;
@@ -40,19 +40,19 @@ import com.google.inject.TypeLiteral;
* @author Adrian Cole
*/
@Singleton
-public class ParseTemplatesFromHttpResponse implements Function> {
- private final ParseFirstJsonValueNamed