diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java index c686dea005..ce53178ea1 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java @@ -33,12 +33,12 @@ public class Address implements Comparable
{ } public static class Builder { - private long id = -1; + private int id = -1; private String country; private String state; private String description; - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -70,7 +70,7 @@ public class Address implements Comparable
{ } } - private long id = -1; + private int id = -1; private String country; private String state; private String description; @@ -80,7 +80,7 @@ public class Address implements Comparable
{ } - public Address(long id, String country, String state, String description) { + public Address(int id, String country, String state, String description) { this.id = id; this.country = checkNotNull(emptyToNull(country),"country cannot be null or empty:"+country); this.state = state; @@ -89,13 +89,13 @@ public class Address implements Comparable
{ @Override public int compareTo(Address arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return The unique id of the address. */ - public long getId() { + public int getId() { return id; } @@ -128,7 +128,7 @@ public class Address implements Comparable
{ public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/BillingItemVirtualGuest.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/BillingItemVirtualGuest.java index 1351be3f3b..42f47817fe 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/BillingItemVirtualGuest.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/BillingItemVirtualGuest.java @@ -33,9 +33,9 @@ public class BillingItemVirtualGuest implements Comparable>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Datacenter.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Datacenter.java index b6c0ef29cc..b14bed97ca 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Datacenter.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Datacenter.java @@ -30,12 +30,12 @@ public class Datacenter implements Comparable { } public static class Builder { - private long id = -1; + private int id = -1; private String name; private String longName; private Address locationAddress; - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -64,7 +64,7 @@ public class Datacenter implements Comparable { } } - private long id = -1; + private int id = -1; private String name; private String longName; private Address locationAddress; @@ -74,7 +74,7 @@ public class Datacenter implements Comparable { } - public Datacenter(long id, String name, String longName, Address locationAddress) { + public Datacenter(int id, String name, String longName, Address locationAddress) { this.id = id; this.name = name; this.longName = longName; @@ -83,13 +83,13 @@ public class Datacenter implements Comparable { @Override public int compareTo(Datacenter arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return The unique identifier of a specific location. */ - public long getId() { + public int getId() { return id; } @@ -122,7 +122,7 @@ public class Datacenter implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java index e806e95662..36684b95cf 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItem.java @@ -44,14 +44,14 @@ public class ProductItem implements Comparable { } public static class Builder { - private long id = -1; + private int id = -1; private String description; private String units; private Float capacity; private Set prices = Sets.newLinkedHashSet(); private Set categories = Sets.newLinkedHashSet(); - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -105,7 +105,7 @@ public class ProductItem implements Comparable { } } - private long id = -1; + private int id = -1; private String description; private String units; private Float capacity; @@ -117,7 +117,7 @@ public class ProductItem implements Comparable { } - public ProductItem(long id, String description, String units, Float capacity, + public ProductItem(int id, String description, String units, Float capacity, Iterable prices, Iterable categories) { this.id = id; this.description = description; @@ -129,13 +129,13 @@ public class ProductItem implements Comparable { @Override public int compareTo(ProductItem arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return The unique identifier of a specific location. */ - public long getId() { + public int getId() { return id; } @@ -188,7 +188,7 @@ public class ProductItem implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java index 5d3de0551e..b525878f55 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemCategory.java @@ -36,11 +36,11 @@ public class ProductItemCategory implements Comparable { } public static class Builder { - private long id = -1; + private int id = -1; private String name; private String categoryCode; - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -66,7 +66,7 @@ public class ProductItemCategory implements Comparable { } } - private long id = -1; + private int id = -1; private String name; private String categoryCode; @@ -75,7 +75,7 @@ public class ProductItemCategory implements Comparable { } - public ProductItemCategory(long id, String name, String categoryCode) { + public ProductItemCategory(int id, String name, String categoryCode) { this.id = id; this.name = name; this.categoryCode = categoryCode; @@ -83,13 +83,13 @@ public class ProductItemCategory implements Comparable { @Override public int compareTo(ProductItemCategory arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return The unique identifier of a specific location. */ - public long getId() { + public int getId() { return id; } @@ -115,7 +115,7 @@ public class ProductItemCategory implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java index 2fe6b2d5f3..7cf22c5bf0 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductItemPrice.java @@ -40,12 +40,12 @@ public class ProductItemPrice implements Comparable { } public static class Builder { - private long id = -1; + private int id = -1; private long itemId = -1; private Float recurringFee; private Float hourlyRecurringFee; - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -75,7 +75,7 @@ public class ProductItemPrice implements Comparable { } } - private long id = -1; + private int id = -1; private long itemId = -1; private Float recurringFee; private Float hourlyRecurringFee; @@ -85,7 +85,7 @@ public class ProductItemPrice implements Comparable { } - public ProductItemPrice(long id, long itemId, Float recurringFee, Float hourlyRecurringFee) { + public ProductItemPrice(int id, long itemId, Float recurringFee, Float hourlyRecurringFee) { this.id = id; this.itemId = itemId; this.recurringFee = recurringFee; @@ -94,13 +94,13 @@ public class ProductItemPrice implements Comparable { @Override public int compareTo(ProductItemPrice arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return The unique identifier of a Product Item Price. */ - public long getId() { + public int getId() { return id; } @@ -154,6 +154,6 @@ public class ProductItemPrice implements Comparable { @Override public int hashCode() { - return (int) (id ^ (id >>> 32)); + return (id ^ (id >>> 32)); } } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java index beb04f5233..31a68ea03d 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrder.java @@ -38,14 +38,14 @@ public class ProductOrder { } public static class Builder { - private long packageId = -1; + private int packageId = -1; private Set prices = Sets.newLinkedHashSet(); private Set virtualGuests = Sets.newLinkedHashSet(); private String location; - private long quantity; + private int quantity; private boolean useHourlyPricing; - public Builder packageId(long packageId) { + public Builder packageId(int packageId) { this.packageId = packageId; return this; } @@ -92,7 +92,7 @@ public class ProductOrder { return this; } - public Builder quantity(long quantity) { + public Builder quantity(int quantity) { this.quantity = quantity; return this; } @@ -116,11 +116,11 @@ public class ProductOrder { } } - private long packageId = -1; + private int packageId = -1; private String location; private Set prices = Sets.newLinkedHashSet(); private Set virtualGuests = Sets.newLinkedHashSet(); - private long quantity; + private int quantity; private boolean useHourlyPricing; // for deserializer @@ -128,7 +128,7 @@ public class ProductOrder { } - public ProductOrder(long packageId, String location, Iterable prices, Iterable virtualGuest, long quantity, boolean useHourlyPricing) { + public ProductOrder(int packageId, String location, Iterable prices, Iterable virtualGuest, int quantity, boolean useHourlyPricing) { this.packageId = packageId; this.location = checkNotNull(emptyToNull(location),"location cannot be null or empty:"+location); this.prices = ImmutableSet. copyOf(checkNotNull(prices, "prices")); @@ -140,7 +140,7 @@ public class ProductOrder { /** * @return The package id of an order. This is required. */ - public long getPackageId() { + public int getPackageId() { return packageId; } @@ -168,7 +168,7 @@ public class ProductOrder { return virtualGuests; } - public long getQuantity() { + public int getQuantity() { return quantity; } @@ -202,11 +202,11 @@ public class ProductOrder { @Override public int hashCode() { - int result = (int) (packageId ^ (packageId >>> 32)); + int result = (packageId ^ (packageId >>> 32)); result = 31 * result + (location != null ? location.hashCode() : 0); result = 31 * result + (prices != null ? prices.hashCode() : 0); result = 31 * result + (virtualGuests != null ? virtualGuests.hashCode() : 0); - result = 31 * result + (int) (quantity ^ (quantity >>> 32)); + result = 31 * result + (quantity ^ (quantity >>> 32)); result = 31 * result + (useHourlyPricing ? 1 : 0); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java index ba6e691d20..ff89d1fbea 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductOrderReceipt.java @@ -30,9 +30,9 @@ public class ProductOrderReceipt implements Comparable { } public static class Builder { - private long orderId = -1; + private int orderId = -1; - public Builder orderId(long orderId) { + public Builder orderId(int orderId) { this.orderId = orderId; return this; } @@ -46,26 +46,26 @@ public class ProductOrderReceipt implements Comparable { } } - private long orderId = -1; + private int orderId = -1; // for deserializer ProductOrderReceipt() { } - public ProductOrderReceipt(long orderId) { + public ProductOrderReceipt(int orderId) { this.orderId = orderId; } @Override public int compareTo(ProductOrderReceipt arg0) { - return new Long(orderId).compareTo(arg0.getOrderId()); + return new Integer(orderId).compareTo(arg0.getOrderId()); } /** * @return unique identifier for the order. */ - public long getOrderId() { + public int getOrderId() { return orderId; } @@ -77,7 +77,7 @@ public class ProductOrderReceipt implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (orderId ^ (orderId >>> 32)); + result = prime * result + (orderId ^ (orderId >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java index c8c43ab0cc..c9ff9d4068 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/ProductPackage.java @@ -45,13 +45,13 @@ public class ProductPackage implements Comparable { } public static class Builder { - private long id = -1; + private int id = -1; private String name; private String description; private Set items = Sets.newLinkedHashSet(); private Set datacenters = Sets.newLinkedHashSet(); - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } @@ -89,7 +89,7 @@ public class ProductPackage implements Comparable { } } - private long id = -1; + private int id = -1; private String name; private String description; private Set items = Sets.newLinkedHashSet(); @@ -100,7 +100,7 @@ public class ProductPackage implements Comparable { } - public ProductPackage(long id, String name, String description, Iterable items, Iterable datacenters) { + public ProductPackage(int id, String name, String description, Iterable items, Iterable datacenters) { this.id = id; this.name = name; this.description = description; @@ -110,14 +110,14 @@ public class ProductPackage implements Comparable { @Override public int compareTo(ProductPackage arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return A package's internal identifier. Everything regarding a * SoftLayer_Product_Package is tied back to this id. */ - public long getId() { + public int getId() { return id; } @@ -163,7 +163,7 @@ public class ProductPackage implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); return result; } diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java index 179c7c621f..acc2350738 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java @@ -34,7 +34,7 @@ import com.google.gson.annotations.SerializedName; * * @author Adrian Cole * @see */ public class VirtualGuest implements Comparable { @@ -43,8 +43,8 @@ public class VirtualGuest implements Comparable { } public static class Builder { - private long id = -1; - private long accountId = -1; + private int id = -1; + private int accountId = -1; private Date createDate; private boolean dedicatedAccountHostOnly; private String hostname; @@ -65,12 +65,12 @@ public class VirtualGuest implements Comparable { private String primaryIpAddress; private BillingItemVirtualGuest billingItem; - public Builder id(long id) { + public Builder id(int id) { this.id = id; return this; } - public Builder accountId(long accountId) { + public Builder accountId(int accountId) { this.accountId = accountId; return this; } @@ -221,14 +221,14 @@ public class VirtualGuest implements Comparable { } - private long accountId = -1; + private int accountId = -1; private Date createDate; @SerializedName("dedicatedAccountHostOnlyFlag") private boolean dedicatedAccountHostOnly; private String domain; private String fullyQualifiedDomainName; private String hostname; - private long id = -1; + private int id = -1; private Date lastVerifiedDate; private int maxCpu = -1; private String maxCpuUnits; @@ -251,8 +251,8 @@ public class VirtualGuest implements Comparable { } - public VirtualGuest(long accountId, Date createDate, boolean dedicatedAccountHostOnly, String domain, - String fullyQualifiedDomainName, String hostname, long id, Date lastVerifiedDate, int maxCpu, + public VirtualGuest(int accountId, Date createDate, boolean dedicatedAccountHostOnly, String domain, + String fullyQualifiedDomainName, String hostname, int id, Date lastVerifiedDate, int maxCpu, String maxCpuUnits, int maxMemory, Date metricPollDate, Date modifyDate, String notes, boolean privateNetworkOnly, int startCpus, int statusId, String uuid, String primaryBackendIpAddress, String primaryIpAddress,BillingItemVirtualGuest billingItem) { @@ -281,13 +281,13 @@ public class VirtualGuest implements Comparable { @Override public int compareTo(VirtualGuest arg0) { - return new Long(id).compareTo(arg0.getId()); + return new Integer(id).compareTo(arg0.getId()); } /** * @return A computing instance's associated account id */ - public long getAccountId() { + public int getAccountId() { return accountId; } @@ -330,7 +330,7 @@ public class VirtualGuest implements Comparable { /** * @return Unique ID for a computing instance. */ - public long getId() { + public int getId() { return id; } @@ -438,13 +438,13 @@ public class VirtualGuest implements Comparable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int) (accountId ^ (accountId >>> 32)); + result = prime * result + (accountId ^ (accountId >>> 32)); result = prime * result + ((createDate == null) ? 0 : createDate.hashCode()); result = prime * result + (dedicatedAccountHostOnly ? 1231 : 1237); result = prime * result + ((domain == null) ? 0 : domain.hashCode()); result = prime * result + ((fullyQualifiedDomainName == null) ? 0 : fullyQualifiedDomainName.hashCode()); result = prime * result + ((hostname == null) ? 0 : hostname.hashCode()); - result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + (id ^ (id >>> 32)); result = prime * result + ((lastVerifiedDate == null) ? 0 : lastVerifiedDate.hashCode()); result = prime * result + maxCpu; result = prime * result + ((maxCpuUnits == null) ? 0 : maxCpuUnits.hashCode()); diff --git a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/reference/SoftLayerConstants.java b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/reference/SoftLayerConstants.java index 200e4357c3..a90115643a 100644 --- a/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/reference/SoftLayerConstants.java +++ b/sandbox-providers/softlayer/src/main/java/org/jclouds/softlayer/reference/SoftLayerConstants.java @@ -35,15 +35,15 @@ public interface SoftLayerConstants { public static final String PROPERTY_SOFTLAYER_VIRTUALGUEST_PACKAGE_NAME = "jclouds.softlayer.virtualguest.package-name"; public static final Set DEFAULT_VIRTUAL_GUEST_PRICES = ImmutableSet.builder() - .add(ProductItemPrice.builder().id(1639L).build()) // 100 GB (SAN) - .add(ProductItemPrice.builder().id(21L).build()) // 1 IP Address - .add(ProductItemPrice.builder().id(55L).build()) // Host Ping - .add(ProductItemPrice.builder().id(58L).build()) // Automated Notification - .add(ProductItemPrice.builder().id(1800L).build()) // 0 GB Bandwidth - .add(ProductItemPrice.builder().id(57L).build()) // Email and Ticket - .add(ProductItemPrice.builder().id(274L).build()) // 1000 Mbps Public & Private Networks - .add(ProductItemPrice.builder().id(905L).build()) // Reboot / Remote Console - .add(ProductItemPrice.builder().id(418L).build()) // Nessus Vulnerability Assessment & Reporting - .add(ProductItemPrice.builder().id(420L).build()) // Unlimited SSL VPN Users & 1 PPTP VPN User per account + .add(ProductItemPrice.builder().id(1639).build()) // 100 GB (SAN) + .add(ProductItemPrice.builder().id(21).build()) // 1 IP Address + .add(ProductItemPrice.builder().id(55).build()) // Host Ping + .add(ProductItemPrice.builder().id(58).build()) // Automated Notification + .add(ProductItemPrice.builder().id(1800).build()) // 0 GB Bandwidth + .add(ProductItemPrice.builder().id(57).build()) // Email and Ticket + .add(ProductItemPrice.builder().id(274).build()) // 1000 Mbps Public & Private Networks + .add(ProductItemPrice.builder().id(905).build()) // Reboot / Remote Console + .add(ProductItemPrice.builder().id(418).build()) // Nessus Vulnerability Assessment & Reporting + .add(ProductItemPrice.builder().id(420).build()) // Unlimited SSL VPN Users & 1 PPTP VPN User per account .build(); } diff --git a/sandbox-providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageClientLiveTest.java b/sandbox-providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageClientLiveTest.java index 9a7a2b73c5..bf26b75f53 100644 --- a/sandbox-providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageClientLiveTest.java +++ b/sandbox-providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageClientLiveTest.java @@ -59,7 +59,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest { private ProductPackageClient client; private AccountClient accountClient; - private long cloudServerPackageId; + private int cloudServerPackageId; private ProductPackage cloudServerProductPackage; @Test @@ -119,7 +119,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest { Map ramToProductItem = Maps.uniqueIndex(ramItems, ProductItems.capacity()); ProductItemPrice price = ProductItems.price().apply(ramToProductItem.get(1.0f)); - assert new Long(1644L).equals(price.getId()); + assert new Integer(1644).equals(price.getId()); } @Test @@ -131,7 +131,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest { Map coresToProductItem = Maps.uniqueIndex(cpuItems, ProductItems.capacity()); ProductItemPrice price = ProductItems.price().apply(coresToProductItem.get(2.0f)); - assert new Long(1963L).equals(price.getId()); + assert new Integer(1963).equals(price.getId()); } @Test @@ -141,7 +141,7 @@ public class ProductPackageClientLiveTest extends BaseSoftLayerClientLiveTest { Map osToProductItem = Maps.uniqueIndex(operatingSystems, ProductItems.description()); ProductItemPrice price = ProductItems.price().apply(osToProductItem.get("Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)")); - assert new Long(1693L).equals(price.getId()); + assert new Integer(1693).equals(price.getId()); } @Test